diff --git a/README.md b/README.md index 146c174..927be30 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ Permanently visible date + icons above the clock, even if system messages are di ##### USB Audio Mod. By: Enlsen -## **NOT Compatible with FW v59.00.502+** +*(NOT Compatible with FW v59.00.502+)* \*\*Patches The USB Audio App With These Mods: diff --git a/app/assets/css/casdk.css b/app/assets/css/casdk.css index d71000b..cf8dbb7 100644 --- a/app/assets/css/casdk.css +++ b/app/assets/css/casdk.css @@ -121,7 +121,6 @@ hr { margin: 0 !important; } /*Exclusive Theme Colors Configuration*/ - .label-theme { background-color: #68dff0; } @@ -140,7 +139,6 @@ ul.top-menu>li>.logout { margin-top: 15px; } /*sidebar navigation*/ - #sidebar { width: 210px; height: 100%; @@ -161,7 +159,6 @@ ul.top-menu>li>.logout { padding-bottom: 10px; } /*notification*/ - #top_menu .nav>li, ul.top-menu>li { float: left; } @@ -212,7 +209,6 @@ ul.top-menu>li>a:hover, ul.top-menu>li>a:focus { -webkit-border-radius: 4px; } /* Dash Side */ - .ds { background: #ffffff; padding-top: 20px; @@ -267,7 +263,6 @@ ul.top-menu>li>a:hover, ul.top-menu>li>a:focus { color: #68dff0; } /* LINE ICONS CONFIGURATION */ - .mtbox { margin-top: 80px; margin-bottom: 40px; @@ -302,9 +297,7 @@ ul.top-menu>li>a:hover, ul.top-menu>li>a:focus { /* ************************************************************************************* PANELS CONFIGURATIONS *************************************************************************************** */ - /*Panel Size*/ - .pn { height: 315px; box-shadow: 0 2px 1px rgba(0, 0, 0, 0.2); @@ -313,7 +306,6 @@ PANELS CONFIGURATIONS box-shadow: 2px 3px 2px rgba(0, 0, 0, 0.3); } /*Grey Panel*/ - .grey-panel { text-align: center; background: #dfdfe1; @@ -331,7 +323,6 @@ PANELS CONFIGURATIONS margin-left: 5px; } /* Specific Conf for Donut Charts*/ - .donut-chart p { margin-top: 5px; font-weight: 700; @@ -343,7 +334,6 @@ PANELS CONFIGURATIONS font-size: 38px; } /* Dark Blue*/ - .darkblue-panel { text-align: center; background: #444c57; @@ -370,7 +360,6 @@ PANELS CONFIGURATIONS font-weight: 700; } /*Green Panel*/ - .green-panel { text-align: center; background: #68dff0; @@ -393,7 +382,6 @@ PANELS CONFIGURATIONS color: white; } /*White Panel */ - .white-panel { text-align: center; background: #ffffff; @@ -420,7 +408,6 @@ PANELS CONFIGURATIONS font-size: 14px; } /*STOCK CARD Panel*/ - .card { background: white; box-shadow: 0 2px 1px rgba(0, 0, 0, 0.2); @@ -467,7 +454,6 @@ PANELS CONFIGURATIONS font-size: 14px; } /*Content Panel*/ - .content-panel { background: #ffffff; box-shadow: 0px 3px 2px #aab2bd; @@ -478,7 +464,6 @@ PANELS CONFIGURATIONS margin-left: 10px; } /* BLOG PANEL */ - #blog-bg { background: url(../../files/img/casdk.jpg) no-repeat center top; margin-top: -15px; @@ -512,7 +497,6 @@ PANELS CONFIGURATIONS font-size: 12px; } /* Calendar Configuration */ - #calendar { color: white; padding: 0px !important; @@ -521,7 +505,6 @@ PANELS CONFIGURATIONS background: #43b1a9; } /* TODO PANEL */ - .mb.casdk-apps { display: block; overflow: auto; @@ -566,6 +549,8 @@ PANELS CONFIGURATIONS cursor: pointer; transition: all 0.7s ease; margin: 0px; + white-space: nowrap; + overflow: hidden; } .steps>label:before { content: ""; @@ -595,9 +580,7 @@ PANELS CONFIGURATIONS transform: translate(-42%, 0); } /* PROFILE PANELS */ - /* Profile 01*/ - #profile-01 { background: url(files/img/casdk.jpg) no-repeat center top; margin-top: -15px; @@ -646,7 +629,6 @@ PANELS CONFIGURATIONS font-size: 15px; } /* Profile 02*/ - #profile-02 { margin-top: -15px; background-attachment: relative; @@ -683,7 +665,6 @@ PANELS CONFIGURATIONS font-size: 20px; } /*spark line*/ - .chart { display: inline-block; text-align: center; @@ -747,7 +728,6 @@ PANELS CONFIGURATIONS display: inline-block; } /* showcase background */ - .showback { background: #ffffff; padding: 15px; @@ -755,7 +735,6 @@ PANELS CONFIGURATIONS box-shadow: 0px 3px 2px #aab2bd; } /* Calendar Events - Calendar.html*/ - .external-event { cursor: move; display: inline-block !important; @@ -775,7 +754,6 @@ PANELS CONFIGURATIONS background: #FFFFFF; } /* Gallery Configuration */ - .photo-wrapper { display: block; position: relative; @@ -821,7 +799,6 @@ PANELS CONFIGURATIONS filter: alpha(opacity=100); } /* EZ Checklist */ - .ez-checkbox { margin-right: 5px; } @@ -833,7 +810,6 @@ PANELS CONFIGURATIONS background: #fffbcc !important; } /* FORMS CONFIGURATION */ - .form-panel { background: #ffffff; margin: 10px; @@ -872,7 +848,6 @@ label { height: 34px; } /* TOGGLE CONFIGURATION */ - .has-switch { border-radius: 30px; -webkit-border-radius: 30px; @@ -1089,14 +1064,23 @@ span.casdk-apps { .casdk-app-img { width: 95%; max-width: 300px; + cursor: help; } .reset-fade { z-index: 999; color: #fff; } -div#file a { +span.flacmsg, input#legacyAppInst, input#legacyAppInst+label, input#advancedOptions, input#advancedOptions+label, div#file a { display: none; } div#file a:last-child { display: block; } +.casdk-help-img { + width: 100%; + text-align: center; +} +.casdk-help-img img { + width: 80%; + max-width: 500px; +} diff --git a/app/assets/css/checkboxStyles.css b/app/assets/css/checkboxStyles.css index 8fc73b2..d6f3c7d 100644 --- a/app/assets/css/checkboxStyles.css +++ b/app/assets/css/checkboxStyles.css @@ -7,7 +7,6 @@ label { padding: 3px 6px; } /* Checkbox Styles */ - input[type=checkbox] { visibility: hidden; } @@ -20,7 +19,7 @@ input[type=checkbox] { background: -o-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%); background: -ms-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%); background: linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcfff4', endColorstr='#b3bead', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fcfff4', endColorstr='#b3bead', GradientType=0); margin: 4px auto; -webkit-box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0, 0, 0, 0.5); -moz-box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0, 0, 0, 0.5); @@ -43,7 +42,7 @@ input[type=checkbox] { background: -o-linear-gradient(top, #222 0%, #45484d 100%); background: -ms-linear-gradient(top, #222 0%, #45484d 100%); background: linear-gradient(top, #222 0%, #45484d 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#222', endColorstr='#45484d', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#222', endColorstr='#45484d', GradientType=0); } .install-check label:hover::after, .uninstall-check label:hover::after { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"; @@ -84,7 +83,6 @@ input[type=checkbox] { background: linear-gradient(top, #bf0000 0%, #940000 100%); } /* Help Toggler */ - .helpToggle { width: 80px; height: 26px; @@ -143,7 +141,7 @@ input[type=checkbox] { background: -o-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%); background: -ms-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%); background: linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcfff4', endColorstr='#b3bead', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fcfff4', endColorstr='#b3bead', GradientType=0); } .helpToggle input[type=checkbox]:checked+label { left: 3px; @@ -160,7 +158,7 @@ input[type=checkbox] { background: -o-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%); background: -ms-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%); background: linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcfff4', endColorstr='#b3bead', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fcfff4', endColorstr='#b3bead', GradientType=0); margin: 20px auto; -webkit-border-radius: 50px; -moz-border-radius: 50px; @@ -188,7 +186,7 @@ input[type=checkbox] { background: -o-linear-gradient(top, #222 0%, #45484d 100%); background: -ms-linear-gradient(top, #222 0%, #45484d 100%); background: linear-gradient(top, #222 0%, #45484d 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#222', endColorstr='#45484d', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#222', endColorstr='#45484d', GradientType=0); } .menuCheck label:after { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; @@ -278,7 +276,7 @@ input[type=checkbox] { background: -o-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%); background: -ms-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%); background: linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcfff4', endColorstr='#b3bead', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fcfff4', endColorstr='#b3bead', GradientType=0); /*margin: 20px auto;*/ -webkit-border-radius: 50px; -moz-border-radius: 50px; @@ -306,7 +304,7 @@ input[type=checkbox] { background: -o-linear-gradient(top, #222 0%, #45484d 100%); background: -ms-linear-gradient(top, #222 0%, #45484d 100%); background: linear-gradient(top, #222 0%, #45484d 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#222', endColorstr='#45484d', GradientType=0); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#222', endColorstr='#45484d', GradientType=0); } .extraCheck, .extraRadio label:after { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; @@ -344,7 +342,7 @@ input[type=checkbox] { span.toggleExtra:before { font-size: 16px; padding: 2px; - z-index: 8; + z-index: 2; position: absolute; cursor: pointer; display: inline-block !important; @@ -360,7 +358,6 @@ span.toggleExtra.icon-plus-square:before { padding: 3px 4px; outline: 1px double transparent; }*/ - span.toggleExtra.icon-plus-square+* { display: none !important; } @@ -447,7 +444,6 @@ span.toggleExtra:hover:before { } /* Do not change following properties, they aren't generated automatically and are common for each slider. */ - .accordion { overflow: hidden; } @@ -633,14 +629,14 @@ input[type=color]::-webkit-color-swatch { border: 1px solid #000; } /* Popover Body */ - .icon-question~.popover .popover-content { background-color: #000; color: #FFFFFF; - padding: 15px; + padding: 8px 0px; border: 2px groove #0000ff; - width: 500px; + width: 700px; border-radius: 10px; + line-height: 1.2; } .icon-question~.popover { background-color: #000; diff --git a/app/assets/css/contact.css b/app/assets/css/contact.css index f0c760a..7256b75 100644 --- a/app/assets/css/contact.css +++ b/app/assets/css/contact.css @@ -34,7 +34,8 @@ box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22); } div#contact-form { - max-height: 635px; + height: 635px; + max-height: 100%; } /* Contact Form Styles */ diff --git a/app/assets/css/index.css b/app/assets/css/index.css index 08b3e99..83331a0 100644 --- a/app/assets/css/index.css +++ b/app/assets/css/index.css @@ -47,7 +47,6 @@ html, body { src: url("../vendor/fonts/Ignis.ttf") format("truetype"); } /* Fix Flickering */ - [ng:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak { display: none !important; } @@ -82,7 +81,6 @@ i[class*="icon-"] { margin-left: -10px; } /* for locking top menu bar */ - .hideNav li.menu-icons { font-size: 20px; cursor: pointer; @@ -134,7 +132,6 @@ div#header, #notices, nav#mySidenav, header span#openNav, header span#openSidePa padding: 6px 0 3px 2px; } /* Safety levels */ - .sfty { color: #fff; font-weight: 800; @@ -186,7 +183,6 @@ tr:hover td .inline-safety { margin-bottom: 50px !important; } /* notices */ - #notices { background: #57f7ff; position: fixed; @@ -638,14 +634,14 @@ nav#mySidenav span[class^="icon-"] { width: 39.5%; margin-left: 2%; font-size: 0.8em; - min-height: 480px; + min-height: 520px; margin-top: 0; } .sidePanel .w3-btn { text-overflow: ellipsis; } .sidePanel.adv { - min-height: 480px; + min-height: 520px; } .sidePanel li div table { cursor: default; @@ -753,7 +749,6 @@ min-width: 0px; table#colorOptions tbody tr:first-child { width: 100%; }*/ - #custbgOptions tbody { width: 100%; display: table; @@ -889,7 +884,6 @@ label.w3-validate+.tooltip>.tooltip-inner { width: 800px !important; } /* DARK MODE */ - .w3-black .w3-dropdown-content a { color: #000; } @@ -1047,7 +1041,6 @@ a:active { opacity: .9; } /* The snackbar - position it at the bottom and in the middle of the screen */ - #snackbar { visibility: hidden; width: 600px; @@ -1072,7 +1065,6 @@ a:active { outline-style: dotted; } /* Show the snackbar when clicking on a button (class added with JavaScript) */ - #snackbar.show { visibility: visible; /* Show the snackbar */ @@ -1107,7 +1099,6 @@ a:active { -webkit-user-select: none; } /* Animations to fade the snackbar in and out */ - @-webkit-keyframes fadein { from { bottom: 0; @@ -1149,14 +1140,12 @@ a:active { } } /* Scrollbar */ - ::-webkit-scrollbar { width: 20px; opacity: .3; cursor: pointer; } /* Track */ - ::-webkit-scrollbar-thumb, ::-webkit-scrollbar-track, ::-webkit-scrollbar-thumb:window-inactive { color: transparent; zoom: 1; @@ -1171,7 +1160,6 @@ a:active { -webkit-box-shadow: inset 1px 0px 15px 1.3px rgba(0, 5, 5, .81); } /* Handle */ - .featherlight .featherlight-content:hover::-webkit-scrollbar-thumb, ::-webkit-scrollbar-thumb:hover { /*-webkit-border-radius: 20px; border-radius: 8px;*/ @@ -1210,7 +1198,6 @@ div#outer-thumbs:hover div#thumbs::-webkit-scrollbar { /*height:12px;*/ } /* Scrollbar Track */ - div#thumbs::-webkit-scrollbar-track:horizontal { -webkit-box-shadow: inset 0px 0px 4px rgba(0, 0, 0, .9); -webkit-border-radius: 0px; @@ -1220,7 +1207,6 @@ div#thumbs:hover::-webkit-scrollbar-track:horizontal { -webkit-box-shadow: inset 0px 0px 10px rgba(0, 0, 0, .9); } /* Handle */ - div#thumbs:hover::-webkit-scrollbar-thumb { -webkit-border-radius: 10px; border-radius: 40px; @@ -1341,7 +1327,6 @@ span.icon-question { /*div#fullSystemRestore { top: 30%; }*/ - #systemRestoreInfo { top: 15%; width: 900px; @@ -1372,7 +1357,6 @@ th#twkOpsTitle { text-indent: 5px; } /* Videos */ - .vid-container { width: 800px; } @@ -1633,7 +1617,6 @@ select#spdOp-barThemeStart { display: inline; } /* @media Queries */ - @media only screen and (min-width: 801px) { div#sidePanel { /*width: 35%;*/ @@ -1955,6 +1938,17 @@ select#spdOp-barThemeStart { height: 450px; } } +@media only screen and (max-height: 640px) { + .slide-pop { + bottom: 10%; + } + div#header { + height: 50px; + } + #mzd-title>*:not(.btn-group) { + display: none; + } +} #imgmodal.slideshow img { left: 0px; animation: slideshow 30s steps(10, end) infinite; @@ -1965,7 +1959,6 @@ select#spdOp-barThemeStart { } } /* Big update modal for v2.2.0 */ - .bootbox.update-info .modal-dialog { max-width: 90%; width: 1400px; @@ -2519,3 +2512,50 @@ input#spdOp-interval { input:disabled { cursor: not-allowed; } +.slide-pop { + bottom: 20%; + right: 10px; + position: absolute; + border: 3px groove #524a8a; + border-radius: 20px; + padding: 5px; + font-size: 20px; + color: #fff; + transition: .3s ease; + background: #008e88; + box-shadow: 1px 2px 1px 0px #000; + text-shadow: 1px 1px 0px #000000; +} +.slide-pop:hover { + background: #c200ff; + border: 3px ridge #006b44; + box-shadow: 1px 2px 1px 0px rgba(10, 10, 10, 0.90); + text-shadow: 0px 0px 1px #000; +} +.slide-pop:active { + box-shadow: 0px 1px 0px 0px rgba(100, 100, 100, 0.30); +} +.slide-pop~.popover h5 { + border-bottom: 1px solid #fff; + padding-bottom: 1px; +} +#presetMessageEditor input { + border: 2px solid #dadada; +} +#messageReplyLanguages option { + font-weight: 800; + font-size: 16px; +} +#messageReplyLanguages select.w3-select { + font-weight: 800; +} +.vpOps .w3-third span { + font-size: 18px; + font-weight: 600; +} +#PhotoJoiner #header { + height: 75px; +} +#PhotoJoiner #mzd-title small { + display: initial; +} diff --git a/app/assets/js/build-tweaks.js b/app/assets/js/build-tweaks.js index 27bd0b0..3624b67 100644 --- a/app/assets/js/build-tweaks.js +++ b/app/assets/js/build-tweaks.js @@ -13,23 +13,6 @@ \* ************************************************************************** */ /* jshint esversion:6 */ /* jshint -W033 */ -var approot -if (isDev) { - approot = './app/' // for dev -} else { - approot = app.getAppPath() // for dist -} -var builddir = `${approot}/files/tweaks/` // Location of tweak files (as .txt files) -var extradir = app.getPath('userData') // Location of downloaded tweak files (userData) -var logFileName = 'MZD_LOG' // Name of log file (without extension) -var varDir = `${extradir}/background/` // Location of files with saved variables -const appender = require('appender') // Appends the tweak files syncronously -const crlf = require('crlf') // Converts line endings (from CRLF to LF) -const copydir = require('copy-dir') // Copys full directories -const drivelist = require('drivelist') // Module that gets the list of available USB drives -const extract = require('extract-zip') // For Unzipping -const mkdirp = require('mkdirp') // Equiv of Unix command mkdir -p -const rimraf = require('rimraf') // Equiv of Unix command rm -rf // First line of AIO log var AIO_LOG = `# __MZD-AIO-TI__ ${app.getVersion()}| MZD All In One Tweaks Installer\n#### AIO COMPILATION LOG - ${Date()}\r\n___\n- *START!*\n` var AIO_LOG_HTML = `

MZD-AIO-TI ${app.getVersion()} | MZD All In One Tweaks Installer


AIO COMPILATION LOG - ${Date()}


`) }, 5000) } @@ -1322,10 +1308,11 @@ function saveInstallerOps(user) { settings.set('keepBackups', user.backups.org) settings.set('testBackups', user.backups.test) settings.set('skipConfirm', user.backups.skipconfirm) + settings.set('apps2resources', user.backups.apps2resources) } function cleanCopyDir() { - rimraf(`${tmpdir}`, function() { appendAIOlog(`
  • Deleted '_copy_to_usb' Folder
  • `) }) + rimraf(`${tmpdir}`, () => { appendAIOlog(`
  • Deleted '_copy_to_usb' Folder
  • `) }) } function casdkAppOptions(apps, inst) { @@ -1375,7 +1362,7 @@ function casdkAppOptions(apps, inst) { function addCASDKapp(add, app) { if (add) { - copydir(`${builddir}casdk/apps/app.${app}`, `${tmpdir}/casdk/apps/app.${app}`, function(err) { + copydir(`${builddir}casdk/apps/app.${app}`, `${tmpdir}/casdk/apps/app.${app}`, (err) => { if (err) { aioLog(`File Copy Error: ${err}`, err.message) return @@ -1392,6 +1379,7 @@ function buildCASDK(user, apps) { mkdirp.sync(`${tmpdir}/casdk/`) if (!user.casdkAppsOnly) { tweaks2write.push(`${builddir}00__casdk-i.txt`) + tweaks2write.push(`${builddir}00_storage-i.txt`) if (user.casdk.region === 'eu') { fs.writeFileSync(`${varDir}/casdkreg.txt`, `sed -i "s/'na'/'eu'/g" /jci/gui/apps/custom/runtime/runtime.js && log_message "=== Region Changed to EU ==="`) } else { @@ -1405,7 +1393,7 @@ function buildCASDK(user, apps) { return false } return true; - }, function(err) { + }, (err) => { if (err) { aioLog(`File Copy Error: ${err}`, err.message) return @@ -1425,15 +1413,18 @@ function buildCASDK(user, apps) { function fullSystemRestore(user) { addRootFiles() tweaks2write.push(`${builddir}00___fullRestore.sh`) - if (fs.existsSync(`${extradir}/color-schemes/Red/jci.zip`)) { + if (fs.existsSync(`${colordir}/Red/jci.zip`)) { mkdirp.sync(`${tmpdir}/config/color-schemes/Red`) aioLog(`Unzipping Red color theme folder`) - extract(`${extradir}/color-schemes/Red/jci.zip`, { dir: `${tmpdir}/config/color-schemes/Red` }, function(err) { - if (err) { aioLog(err) } - aioLog(`Red Color Scheme Added Successfully`) + extract(`${colordir}/Red/jci.zip`, { dir: `${tmpdir}/config/color-schemes/Red` }, (err) => { + if (err) { + aioLog(err, err) + } else { + aioLog(`Red Color Scheme Added Successfully`) + } }) } - copydir(`${builddir}config_org`, `${tmpdir}/config_org`, function(err) { + copydir(`${builddir}config_org`, `${tmpdir}/config_org`, (err) => { if (err) { aioLog(`File Copy Error: ${err}`, err.message) return @@ -1446,15 +1437,20 @@ function fullSystemRestore(user) { function buildAutorunInstaller(user) { if (user.autorun.serial) { tmpdir = `${tmpdir}/XX` - mkdirp.sync(`${tmpdir}`) + try{ + mkdirp.sync(`${tmpdir}`) + } catch (e) { + errFlag = true + aioLog(`ERROR CREATING ${tmpdir}`, e) + } } - copydir(`${approot}/files/tweaks/cmu-autorun/installer`, `${tmpdir}`, function(err) { + copydir(`${approot}/files/tweaks/cmu-autorun/installer`, `${tmpdir}`, (err) => { if (err) { errFlag = true aioLog('ERROR COPYING AUTORUN FILES', err) } else { - if (user.autorun.id7recovery) { - copydir(`${approot}/files/tweaks/cmu-autorun/sdcard/recovery`, `${tmpdir}`, function(err) { + if (user.autorun.id7recovery || user.autorun.serial) { + copydir(`${approot}/files/tweaks/cmu-autorun/sdcard/recovery`, `${tmpdir}`, (err) => { if (err) { errFlag = true aioLog('ERROR COPYING ID7RECOVERY FILES', err) @@ -1465,22 +1461,22 @@ function buildAutorunInstaller(user) { fs.unlinkSync(`${tmpdir}/run.sh`) } aioLog('ID7_recovery Pack Copied Successfully!') - addWifiApp(user) + addWifiAP(user) } }) } else { aioLog('Autorun Installer/Uninstaller Copied Successfully!') - addWifiApp(user) + addWifiAP(user) } } }) } -function addWifiApp(user) { +function addWifiAP(user) { filesComplete = true opsComplete = true if (user.autorun.autoADB || user.autorun.autoWIFI) { - copydir(`${approot}/files/tweaks/cmu-autorun/sdcard/recovery-extra`, `${tmpdir}`, function(err) { + copydir(`${approot}/files/tweaks/cmu-autorun/sdcard/recovery-extra`, `${tmpdir}`, (err) => { if (err) { errFlag = true aioLog('ERROR COPYING AUTORUN FILES', err) @@ -1495,7 +1491,7 @@ function addWifiApp(user) { }) } if (user.autorun.dryrun && !user.autorun.serial) { - copydir(`${approot}/files/tweaks/cmu-autorun/sdcard/dryrun`, `${tmpdir}`, function(err) { + copydir(`${approot}/files/tweaks/cmu-autorun/sdcard/dryrun`, `${tmpdir}`, (err) => { if (err) { errFlag = true } }) } @@ -1514,7 +1510,7 @@ function addWifiApp(user) { size: "small", title: "Values Were Not Changed", message: "WiFi AP Will not be installed", - callback: function() { + callback: () => { rimraf.sync(`${tmpdir}/00-start-wifiAP/`) serialCheck(user) } @@ -1548,3 +1544,29 @@ function serialCheck(user) { } printAIOlog() } + +function writePresetMessageFile(result) { + try { + mkdirp.sync(`${varDir}/message_replies/jci/settings/configurations`) + fs.writeFileSync(`${varDir}/message_replies/jci/settings/configurations/blm_msg-system.xml`, result) + snackbar('Preset Messages Saved!') + } catch (e) { + snackbar(`ERROR CREATING PRESET MESSAGES FILE 'blm_msg-system.xml': ${e}`) + } +} + +function copyPresetMessageFile() { + if(fs.existsSync(`${varDir}/message_replies`)) { + copydir(`${varDir}/message_replies`, `${tmpdir}/config/message_replies`, (err) => { + if (err) { + aioLog(err + " copy default preset text messages") + addTweakDir('message_replies', true) + } else { + aioLog('Copied Preset Messages!') + } + }) + } else { + aioLog("Copy default preset text messages") + addTweakDir('message_replies', true) + } +} diff --git a/app/assets/js/ex-links.js b/app/assets/js/ex-links.js index 83ace9b..64e463b 100644 --- a/app/assets/js/ex-links.js +++ b/app/assets/js/ex-links.js @@ -1,9 +1,9 @@ // Open all external links *with class="link"* outside the app // Credit: Electron API Demos app -const links = document.querySelectorAll('a.link') +var links = document.querySelectorAll('a.link') Array.prototype.forEach.call(links, function (link) { - const url = link.getAttribute('href') + var url = link.getAttribute('href') if (url.indexOf('http') === 0) { link.addEventListener('click', function (e) { e.preventDefault() diff --git a/app/assets/js/index.js b/app/assets/js/index.js index 4deec24..874de3d 100644 --- a/app/assets/js/index.js +++ b/app/assets/js/index.js @@ -28,13 +28,25 @@ const { writeFileSync } = require('fs') const isDev = require('electron-is-dev') const path = require('path') const os = require('os') +const appender = require('appender') // Appends the tweak files syncronously +const crlf = require('crlf') // Converts line endings (from CRLF to LF) +const copydir = require('copy-dir') // Copys full directories +const drivelist = require('drivelist') // Module that gets the list of available USB drives +const extract = require('extract-zip') // For Unzipping +const mkdirp = require('mkdirp') // Equiv of Unix command mkdir -p +const rimraf = require('rimraf') // Equiv of Unix command rm -rf var copyFolderLocation = persistantData.get('copyFolderLocation') var visits = persistantData.get('visits') || 0 var hasColorFiles = fs.existsSync(`${app.getPath('userData')}/color-schemes/`) var hasSpeedCamFiles = fs.existsSync(`${app.getPath('userData')}/speedcam-patch/`) var translateSchema, langPath, lang, langDefault -var tempDir = `${app.getPath('userData')}/background` +var approot = (isDev ? './app/' : app.getAppPath()) +var builddir = `${approot}/files/tweaks/` // Location of tweak files (as .txt files) +var colordir = `${app.getPath('userData')}/color-schemes` // Location of downloaded tweak files (userData) +var logFileName = 'MZD_LOG' // Name of log file (without extension) +var varDir = `${app.getPath('userData')}/background/` // Location of files with saved variables var date = function() { return new Date() } +var updateVer = 281 // require('./lib/log')('MZD-AIO-LOG') // var output = process.stdout // var errorOutput = process.stderr @@ -74,7 +86,7 @@ fs.readdir(testFolder, (err, files) => { }) */ function getBackground() { - return `${tempDir}/background.png` + return `${varDir}/background.png` } function saveMenuLock() { @@ -82,14 +94,17 @@ function saveMenuLock() { $('body, .hideNav, .w3-overlay').toggleClass('showNav') } /* Create Temporary Folder To Hold Images Before Compiling */ -if (!fs.existsSync(tempDir)) { - fs.mkdirSync(tempDir) +if (!fs.existsSync(varDir)) { + fs.mkdirSync(varDir) } function helpMessageFreeze(item) { $(item).children().toggleClass('w3-show') } +function runAAPatcher(apk) { + require('./assets/js/aapatcher.js')(apk) +} function runInstallCSApp() { require('./assets/js/installCS.js')() @@ -139,48 +154,55 @@ function openDlFolder() { function openDefaultFolder() { shell.showItemInFolder(path.normalize(path.join('file://', __dirname, '../background-images/default/defaut.png'))) } + function autoHelp() { $.featherlight('views/autoHelp.htm', { closeSpeed: 500, variant: 'autoHelpBox' }) } + function myStance() { - //updateNotesCallback() - //ipc.send('reset-window-size') + ipc.send('reset-window-size') $.featherlight('views/stance.htm', { closeSpeed: 2000, variant: 'myStance', afterClose: updateNotesCallback }) } + function announcement() { - var anoncmntNum = localStorage.getItem('anoncmnt') + +// announcement } + function showAnnouncement() { - $.featherlight('https://aio.trevelopment.com/aio.php',{closeSpeed:1000,variant:'announcementWindow'}) - } +//announcement +} + function hideAnnouncement(anonNum) { $('.communicationFile').hide() $.featherlight.close() localStorage.setItem('anoncmnt', anonNum) } + function anonData(anonNum) { localStorage.setItem('anondat', anonNum) } + function updateNotes() { $.get('views/update.htm', function(data) { $('#changelog').html(data) }) bootbox.dialog({ title: `
    Welcome To MZD-AIO-TI v${app.getVersion()} | MZD All In One Tweaks Installer
    `, - message: `

    `, + message: `

    `, className: 'update-info', size: 'large', closeButton: true }) - setTimeout(function() { + setTimeout(() => { $('.modal-dialog').animate({ 'margin-top': '40px', 'margin-bottom': '60px' }, 3000) - $('#newVerBtn').fadeIn(5000) + $('#upVerBtn').fadeIn(5000) }, 2000) } function firstTimeVisit() { - if (!persistantData.has('updateVer') || persistantData.get('updateVer') < 280) { + if (!persistantData.has('updateVer') || persistantData.get('updateVer') < updateVer) { myStance() settings.set('reset', true) - persistantData.set('updateVer', 280) + persistantData.set('updateVer', updateVer) persistantData.set('updated', false) persistantData.delete('ver270') persistantData.delete('message-502') @@ -214,13 +236,12 @@ function updateNotesCallback() { closeButton: false, className: "first-time-dialog" }) - setTimeout(function() { $('#super-overlay').remove() }, 3000) - setTimeout(function() { + setTimeout(() => { $('#super-overlay').remove() }, 3000) + setTimeout(() => { $('#first-time-msg-btn').html(`
    `) $('#newVerBtn').fadeIn(10000) }, 5000) } - } var helpClick = false @@ -382,7 +403,7 @@ function toggleOverDraws() { function writeRotatorVars() { if ($('#imgCount').text() > 1) { - fs.writeFileSync(`${tempDir}/bg-rotator.txt`, `BG_STEPS=${$('#imgCount').text()}\nBG_SECONDS=${$('#imgCount').text() * $('#bgRotatorSeconds').val()}\nBG_SEC_EACH=${$('#bgRotatorSeconds').val()}\nBG_WIDTH=${$('#imgCount').text() * 800}`) + fs.writeFileSync(`${varDir}/bg-rotator.txt`, `BG_STEPS=${$('#imgCount').text()}\nBG_SECONDS=${$('#imgCount').text() * $('#bgRotatorSeconds').val()}\nBG_SEC_EACH=${$('#bgRotatorSeconds').val()}\nBG_WIDTH=${$('#imgCount').text() * 800}`) } } @@ -394,7 +415,7 @@ function saveAIOLogHTML() { } function checkForUpdate(ver) { - $.featherlight(`https://aio.trevelopment.com/update.php?ver=280`, { closeSpeed: 100, variant: 'checkForUpdate' }) + $.featherlight(`https://aio.trevelopment.com/update.php?ver=${updateVer}`, { closeSpeed: 100, variant: 'checkForUpdate' }) } function formatDateCustom(dateFormatType) { @@ -436,13 +457,13 @@ function showCompatibility() {
    -

    **AIO IS COMPATIBLE WITH ALL FW V55, V56, V58, V59 AND UP TO V70.00.000**

    +

    **AIO IS COMPATIBLE WITH ALL FW V55, V56, V58, V59 AND UP TO V70.00.021**

    NOTE: FW v59.00.502+ Requires Additional Steps To Install Tweaks. If updating to v59.00.502+ install Autorun & Recovery Scripts to allow Tweaks to be installed after updating.

    `).insertAfter($('#mzd-title')) } $(function() { $('.toggleExtra.1').addClass('icon-plus-square').removeClass('icon-minus-square') - setTimeout(function() { + setTimeout(() => { $('#IN21').click(function() { snackbar('THERE MAY BE ISSUES REGARDING COMPATIBILITY WITH THIS TWEAK. AFTER INSTALLING, YOUR USB PORTS MAY BECOME UNREADABLE TO THE CMU.
    AUTORUN-RECOVERY SCRIPT WILL BE INSTALLED IN CASE RECOVERY BY SD CARD SLOT IS NEEDED TO RECOVER USB FUNCTION
    ') }) diff --git a/app/assets/js/messages-settings.js b/app/assets/js/messages-settings.js new file mode 100644 index 0000000..4005cda --- /dev/null +++ b/app/assets/js/messages-settings.js @@ -0,0 +1,55 @@ +var xml2js = require('xml2js') +//var settingsData = new Config({ 'name': 'msgSettings' }) +var data2edit, msgLangs = [], + currLangMsgs = [] +var currMsgLang +var parser = new xml2js.Parser() + +function getMsgLangs() { + var messageFile = (fs.existsSync(`${varDir}/message_replies/jci/settings/configurations/blm_msg-system.xml`) ? `${varDir}` : `${builddir}/config`) + messageFile += `/message_replies/jci/settings/configurations/blm_msg-system.xml` + fs.readFile(path.resolve(messageFile), function(err, data) { + if (err) console.log(err) + parser.parseString(data, function(err, result) { + if (err) console.log(err) + if (data2edit !== result) { + data2edit = result + // console.dir(data2edit.Node.Node[0].Node[0].$.key) + for (var x in data2edit.Node.Node[0].Node) msgLangs.push(data2edit.Node.Node[0].Node[x].$.key) + //getMsgsForLang(msgLangs[currentMsgLang]) + //console.dir(msgLangs) + //return msgLangs + } + }) + }) +} +function resetMsgLang() { + rimraf.sync(`${varDir}/message_replies/`) + getMsgLangs() +} +function getMsgsForLang(msgLang) { + currLangMsgs = [] + for (var x in data2edit.Node.Node[0].Node) { + if (data2edit.Node.Node[0].Node[x].$.key === msgLang) { + for (var y in data2edit.Node.Node[0].Node[x].Node) { + currLangMsgs.push(data2edit.Node.Node[0].Node[x].Node[y].$.value) + //console.dir(data2edit.Node.Node[0].Node[x].Node[y].$.value) + } + } + } +} +getMsgLangs() + +function rebuildMessageXml(msgLang, newMsgs) { + var builder = new xml2js.Builder({ headless: true }) + for (var x in data2edit.Node.Node[0].Node) { + if (data2edit.Node.Node[0].Node[x].$.key === msgLang) { + for (var y in data2edit.Node.Node[0].Node[x].Node) { + data2edit.Node.Node[0].Node[x].Node[y].$.value = newMsgs[y] + //console.dir(data2edit.Node.Node[0].Node[x].Node[y].$.value) + } + } + } + var xml = builder.buildObject(data2edit) + writePresetMessageFile(xml) +} diff --git a/app/assets/vendor/jquery.tabSlide.js b/app/assets/vendor/jquery.tabSlide.js index 4c3c411..150e7a4 100644 --- a/app/assets/vendor/jquery.tabSlide.js +++ b/app/assets/vendor/jquery.tabSlide.js @@ -99,7 +99,7 @@ if(settings.tabLocation === 'left' || settings.tabLocation === 'right') { obj.css({ - 'height' : properties.containerHeight, + //'height' : properties.containerHeight, 'top' : settings.topPos }); diff --git a/app/changelog.htm b/app/changelog.htm index de275aa..232a919 100644 --- a/app/changelog.htm +++ b/app/changelog.htm @@ -5,7 +5,76 @@

    MZD-AIO-TI v2 CHANGELOG

    Full Changelog

    AIO + CASDK

    +

    v2.8.1

    +

    Android Auto Headunit App v1.10

    + +

    Video Player App v3.6

    + +

    AIO Tweaks App v0.8

    + +

    Remove Message Replies:

    + +

    Install Options:

    + +

    CASDK:

    + +

    Bug Fixes:

    +
  • No More Disclaimer/Order Audio Sources & App List Patch (v59+): Uses proper Application list structure based on vehicle configuration type (old or new)
      +
    • (v70) Fixed AA/CarPlay button disappearing from statusbar.
    • +
    +
  • +
  • USB Audio Mod: Fixed "Powered by Gracenote" text not displaying (normal & custom text)
  • +
  • Pause On Mute (v70): Installation is skipped for v70+ because pause on mute behavior is built in.
  • +
  • Boot Animations (v59.00.502+) Fixed Custom Boot Animations, v59.00.502+ only one boot animation is used (LoopLogo in AIO Options)
  • +
  • tweaks.sh: Coding/Error handling improvements.
      +
    • AIO_logs saved in /bakups/ folder on USB now contain all error output from stdout & stderr
    • +
    • Additional log is created /bakups/info.log with some general system information for troubleshooting issues if needed
    • +
    • The Most important thing AIO does is create backups of the original system files before modifying them
      • If a file backup fails the install will abort with a warning message
      • This issue was seen on v70.00.021, Backups could not be created due to lack of disk space making it very difficult to revert tweaks.
    • +
    + +
  • AIO will use a default image when no image is chosen in the options (instead of hanging during compile due to missing image file) for tweaks that are expecting an image (Background, Change Blank Album Art, etc.).
  • +
  • Install Options tab is shown in all applicable views (CASDK, Full System Recovery & autorun).
  • v2.8.0

    CASDK

    diff --git a/app/controllers/home.js b/app/controllers/home.js index be8d08b..ec6e066 100644 --- a/app/controllers/home.js +++ b/app/controllers/home.js @@ -53,6 +53,7 @@ colors: 1, aaVer: 1, d2sbOps: 3, + replyMsgLang: 0, zipbackup: false, forcessh: false, useColorBG: false, @@ -65,7 +66,9 @@ aaWifi: true, autosort: true, barautosort: true, - gracenoteText: "Powered By Gracenote®", + runsh: false, + screenOffBoot: false, + gracenoteText: 'Powered By Gracenote®', altLayout: settings.get('altLayout') || false, darkMode: settings.get('darkMode') || false, flipOption: settings.get('flipOption') || '', @@ -102,13 +105,13 @@ $scope.user.casdk = { inst: false, uninst: false, - region: "na" + region: 'na' } - $scope.user.backups = { org: settings.get('keepBackups') || false, test: settings.get('testBackups') || true, - skipconfirm: settings.get('skipConfirm') || false + skipconfirm: settings.get('skipConfirm') || false, + apps2resources: settings.get('apps2resources') || false } $scope.user.boot = { logo1: 0, @@ -168,6 +171,25 @@ mount: true, resources: false } + $scope.user.vpOps = { + shuffle: true, + repeat: 2, + fullscreen: 1 + } + $scope.vpOpsRepeat = { + None: 0, + One: 1, + All: 2 + } + $scope.vpOpsFullscreen = { + Windowed: 0, + "Keep Aspect Ratio": 1, + Full: 2 + } + $scope.vpOpsShuffle = { + On: true, + Off: false + } $scope.user.rmvallbg = function() { $scope.user.uistyle.nobtnbg = true $scope.user.uistyle.nonpbg = true @@ -240,6 +262,17 @@ { bootLogo: 'MZD Title Slam', logo: 10 }, { bootLogo: 'Trans End (Default)', logo: 11 } ] + $scope.replyLangs = msgLangs + $scope.getMsgsForLang = function() { + getMsgsForLang($scope.user.replyMsgLang) + $scope.replyMsgs = currLangMsgs + if ($scope.replyMsgs.length > 0) { + $('#presetMessageEditor').show() + } + } + $scope.savePresetMsgs = function() { + rebuildMessageXml($scope.user.replyMsgLang, $scope.replyMsgs) + } $scope.checkDuplicatePos = function(inputArray) { var lastSeenDuplicate, seenDuplicate = [], @@ -250,7 +283,7 @@ inputArray.map(function(item) { var itemPosition = item[propertyName] // Don't count hidden values - if (itemPosition[0] !== "2") { + if (itemPosition[0] !== '2') { var itemName = item[elmntName] if (itemPosition in testObject) { testObject[itemPosition].duplicate = true @@ -267,11 +300,9 @@ } $scope.colorDuplicates = function() { var duplicates = $scope.checkDuplicatePos($scope.user.spdValues) - //$('.spdOps span~select').css({ "color": "" }) $('.spdOps span~select').removeClass("ng-invalid") for (var x in duplicates) { $('#spdOp-' + duplicates[x] + '~select').addClass("ng-invalid") - //$('#spdOp-' + duplicates[x] + '~select').css({ "color": "red" }) } } $scope.checkForMain = function(value) { @@ -412,7 +443,7 @@ $(this).fadeOut(500) $('#ctxt-title').fadeIn(500) }) - $('#background').on('click', function() { $('#infotnmtBG,#modalimg').attr('src', `${tempDir}/background.png`) }) + $('#background').on('click', function() { $('#infotnmtBG,#modalimg').attr('src', `${varDir}/background.png`) }) $('[data-toggle="tooltip"]').tooltip({ html: true, delay: { show: 1200, hide: 200 } }) $('[data-toggle="popover"]').popover({ html: true }) $('.imgframe').mousewheel(function(event, delta) { @@ -427,18 +458,6 @@ $('.twkfltr input').on('blur', function() { $('#compileButton').removeClass('left') }) - $('.slide-out-div').tabSlideOut({ - tabHandle: '.handle', // class of the element that will become your tab - // pathToTabImage: 'files/img/tab.png', //path to the image for the tab //Optionally can be set using css - imageHeight: '40px', // height of tab image //Optionally can be set using css - imageWidth: '90px', // width of tab image //Optionally can be set using css - tabLocation: 'left', // side of screen where tab lives, top, right, bottom, or left - speed: 300, // speed of animation - action: 'click', // options: 'click' or 'hover', action to trigger animation - topPos: '90px', // position from the top/ use if tabLocation is left or right - leftPos: '50px', // position from left/ use if tabLocation is bottom or top - fixedPosition: false // options: true makes it stick(fixed position) on scroll - }) startTime() }) } @@ -793,6 +812,7 @@ }, callback: function(result) { if (result) { + $('button.btn.btn-success').prop('disabled', true) if ($scope.user.mainOps.indexOf(2) !== -1) { $('#imgframe').click() $('#slideShowBtn').click() @@ -861,13 +881,10 @@ return scope.$eval(attrs.compile) }, function(value) { - // when the 'compile' expression changes - // assign it into the current DOM + // when the 'compile' expression changes assign it into the current DOM element.html(value) - // compile the new DOM and link it to the current - // scope. - // NOTE: we only compile .childNodes so that - // we don't get into infinite loop compiling ourselves + // compile the new DOM and link it to the current scope. + // NOTE: we only compile .childNodes so that we don't get into infinite loop compiling ourselves $compile(element.contents())(scope) } ) @@ -941,6 +958,61 @@ } $scope.secretCodes = function(code) { switch (code.replace(/(\(.*\)|[\ \(\)\\\/\_\-])/g, '').toLowerCase()) { + case "vdvda": + $scope.visibleApps.vdd = true + casdkApps.set('vdd', true) + snackbar("Unlocked: Vehicle Data Diagnostic (VDD)") + break + case "dultimash": + $scope.visibleApps.multidash = true + casdkApps.set('multidash', true) + snackbar("Unlocked: MultiDash Speedometer") + break + case "terminator": + $scope.visibleApps.terminal = true + casdkApps.set('terminal', true) + snackbar("Unlocked: Terminal") + break + case "gpspeed": + $scope.visibleApps.gpsspeed = true + casdkApps.set('gpsspeed', true) + snackbar("Unlocked: GPS Speedometer") + break + case "trevelop": + $scope.visibleApps.devtools = true + casdkApps.set('devtools', true) + snackbar("Unlocked: Dev Tools") + break + case "frontsky": + $scope.visibleApps.background = true + casdkApps.set('background', true) + snackbar("Unlocked: Background") + break + case "dropblocks": + $scope.visibleApps.tetris = true + casdkApps.set('tetris', true) + snackbar("Unlocked: Tetris") + break + case "trousersnake": + $scope.visibleApps.snake = true + casdkApps.set('snake', true) + snackbar("Unlocked: Snake") + break + case "outbreak": + $scope.visibleApps.breakout = true + casdkApps.set('breakout', true) + snackbar("Unlocked: Breakout") + break + case "ticktock": + $scope.visibleApps.clock = true + casdkApps.set('clock', true) + snackbar("Unlocked: Clock") + break + case "ss": + $scope.visibleApps.simplespeedo = true + casdkApps.set('simplespeedo', true) + snackbar("Unlocked: Simple Speedometer") + break case "reset": casdkApps.set('clock', false) casdkApps.set('multidash', false) diff --git a/app/files/tweaks/00_59patch.txt b/app/files/tweaks/00_59patch.txt index b9f2d6c..6e386e5 100644 --- a/app/files/tweaks/00_59patch.txt +++ b/app/files/tweaks/00_59patch.txt @@ -1,11 +1,11 @@ -backup_org /jci/gui/apps/system/js/systemApp.js # for FW v59 if they do not have No more disclamer or order of audio source # apply patch to show apps in app List if [ $COMPAT_GROUP -gt 2 ] && ! grep -Fq "app.casdkapps" /jci/gui/apps/system/js/systemApp.js then + backup_org /jci/gui/apps/system/js/systemApp.js if [ $COMPAT_GROUP -lt 6 ] then - cp -a ${MYDIR}/config/jci/gui/apps/system/js/systemApp.js /jci/gui/apps/system/js + cp -a ${MYDIR}/config/jci/gui/apps/system/js/systemApp.js /jci/gui/apps/system/js/ log_message "=== Patched systemApp.js for AIO + CASDK apps for v59 ===" elif [ $COMPAT_GROUP -eq 6 ] then diff --git a/app/files/tweaks/00___fullRestore.sh b/app/files/tweaks/00___fullRestore.sh index f78cb34..4bfc87f 100644 --- a/app/files/tweaks/00___fullRestore.sh +++ b/app/files/tweaks/00___fullRestore.sh @@ -1,56 +1,60 @@ +if [ ! -e "${MYDIR}/org_files" ] +then + mkdir "${MYDIR}/org_files" +fi +restore_full() +{ + FILE="${1}" + BACKUP_FILE="${1}.org" + FILENAME=$(basename -- "$FILE") + if [ -s "${BACKUP_FILE}" ] + then + cp "${BACKUP_FILE}" "${MYDIR}/org_files/" + cp -a "${BACKUP_FILE}" "${FILE}" && log_message "***+++---===|___ Restored ${FILENAME} From Backup ___|===---+++***" + if [ $DEL_BAKUPS -eq 1 ] + then + rm -f "${BACKUP_FILE}" + log_message "=== Deleted backup: ${FILENAME}.org ===" + fi + return 0 + else + return 1 + fi +} log_message "*************************************************************************" log_message "********************* BEGIN FULL SYSTEM RESTORE *************************" log_message "*************************************************************************" -log_message " " -show_message "DISABLE TOUCHSCREEN WHILE DRIVING ..." -log_message "=====********* UNINSTALL REMOVE TOUCHSCREEN RESTRICTION ... *********====" +show_message "BEGIN FULL SYSTEM RESTORE ...\nALL FILES TWEAKED BY AIO WILL BE RESTORED\nALL APPS INSTALLED BY AIO WILL BE REMOVED\nBY: TREZDOG44 ..." +log_message "=======************ ENABLE TOUCHSCREEN RESTRICTION ... ***********=======" /jci/scripts/set_lvds_speed_restriction_config.sh enable /jci/scripts/set_speed_restriction_config.sh enable -log_message "=== Touchscreen Speed Restriction Enabled ===" -log_message "======*** END UNINSTALLATION OF REMOVE TOUCHSCREEN RESTRICTION ***=======" -log_message " " -# restore data.zip back to original -if [ -e /jci/nng/data.zip.org ] -then - # remove speedcam patch and speedcam.txt - show_message "REMOVE SPEEDCAM PATCH AND SPEEDCAM.TXT ..." - log_message "===****** UNINSTALL SPEEDCAM PATCH AND SPEEDCAM.TXT ... ******===" - log_message "=== Original data.zip is available as backup ===" - cp -a /jci/nng/data.zip.org /jci/nng/data.zip - log_message "=== Renamed data.zip.org back to data.zip ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/nng/data.zip.org - log_message "=== Deleted backup: data.zip.org ===" - fi - chmod 755 /jci/nng/data.zip -fi -# restore jci-linux_imx6_volans-release back to original if [ -e /jci/nng/jci-linux_imx6_volans-release.org ] then - mv /jci/nng/jci-linux_imx6_volans-release.org /jci/nng/jci-linux_imx6_volans-release - show_message "RESTORED JCI-LINUX_IMX6_VOLANS-RELEASE BACK TO ORIGINAL" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/nng/jci-linux_imx6_volans-release.org - log_message "=== Deleted backup: jci-linux_imx6_volans-release.org ===" - fi - chmod 755 /jci/nng/jci-linux_imx6_volans-release + if (restore_full /jci/nng/jci-linux_imx6_volans-release) + then + log_message "========********* REMOVING SPEEDCAM PATCH ... ***********========" + log_message "=======******** jci-linux_imx6_volans-release RESTORED *********======" + fi + chmod 755 /jci/nng/jci-linux_imx6_volans-release +fi +if (restore_full /jci/nng/data.zip) +then + log_message "=============************ data.zip RESTORED *************=============" + chmod 755 /jci/nng/data.zip fi rm -f /jci/nng/2 -if [ -e /mnt/sd_nav/content/speedcam ] +if [ -e /mnt/sd_nav/content/speedcam/speedcam.txt ] || [ -e /mnt/sd_nav/content/speedcam/speedcam.spdb ] then - # cp -a /mnt/sd_nav/content/speedcam/speedcam.txt ${MYDIR} - # log_message "=== Copied speedcam.txt to USB ===" - # rm -f /mnt/sd_nav/content/speedcam/speedcam.txt - # rm -f /mnt/sd_nav/content/speedcam/speedcam.spdb - log_message "***Remove speedcam.txt and speedcam.spdb from SD card to complete uninstalation of speedcam patch***" - log_message "===***** END UNINSTALLATION OF SPEEDCAM PATCH AND SPEEDCAM.TXT ******===" - log_message " " + # cp -a /mnt/sd_nav/content/speedcam/speedcam.txt ${MYDIR} + # log_message "=== Copied speedcam.txt to USB ===" + # rm -f /mnt/sd_nav/content/speedcam/speedcam.txt + # rm -f /mnt/sd_nav/content/speedcam/speedcam.spdb + log_message "===*** Remove speedcam.txt and speedcam.spdb from SD card to complete uninstalation of speedcam patch ***===" fi # remove track-order and FLAC support +# Uncomment to remove #if [ -e /jci/lib/libmc_user.so.org ] #then # show_message "REMOVE TRACK-ORDER AND FLAC SUPPORT ..." @@ -64,462 +68,215 @@ fi # if [ $DEL_BAKUPS -eq 1 ] # then # rm -f /jci/lib/libmc_user.so.org -# log_message "=== Deleted backup: libmc_user.so.org ===" +# log_message "=====****** Deleted backup: libmc_user.so.org ********========" # fi # log_message "===*** END UNINSTALLATION OF TRACK-ORDER AND FLAC SUPPORT ***===" -# log_message " " -#fi +# #fi # restore systemApp.js -if [ -e /jci/gui/apps/system/js/systemApp.js.org ] -then - show_message "RESTORE DISCLAIMER & ORDER OF AUDIO SOURCE LIST ..." - log_message "===*** UNINSTALL NO-MORE-DISCLAIMER & ORDER OF AUDIO SOURCE LIST...***===" - cp -a /jci/gui/apps/system/js/systemApp.js.org /jci/gui/apps/system/js/systemApp.js - log_message "=== Restored systemApp.js from backup ===" - rm -f /jci/gui/apps/system/js/systemApp.js.audio - rm -f /jci/gui/apps/system/js/systemApp.js.disclaimer - log_message "=== Removed systemApp.js.audio and systemApp.js.disclaimer flags ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/gui/apps/system/js/systemApp.js.org - log_message "=== Deleted backup: systemApp.js.org ===" - fi - log_message "=====********** END UNINSTALLATION OF NO-MORE-DISCLAIMER *********======" - log_message "=====*************** AND ORDER OF AUDIO SOURCE LIST ************======" - log_message " " +if (restore_full /jci/gui/apps/system/js/systemApp.js) +then + log_message "==========*************** systemApp.js RESTORED ************==========" + rm -f /jci/gui/apps/system/js/systemApp.js.audio + rm -f /jci/gui/apps/system/js/systemApp.js.disclaimer + log_message "===*** Removed systemApp.js.audio & systemApp.js.disclaimer flags ***===" fi # restore MainMenuCtrl.js -if [ -e /jci/gui/apps/system/controls/MainMenu/js/MainMenuCtrl.js.org ] -then - # remove main menu loop - show_message "REMOVE MAIN-MENU-LOOP ..." - log_message "============********** UNINSTALL MAIN-MENU-LOOP ... ********=============" - cp -a /jci/gui/apps/system/controls/MainMenu/js/MainMenuCtrl.js.org /jci/gui/apps/system/controls/MainMenu/js/MainMenuCtrl.js - log_message "=== Restored Original MainMenuCtrl.js From Backup ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/gui/apps/system/controls/MainMenu/js/MainMenuCtrl.js.org - log_message "=== Deleted backup: MainMenuCtrl.js.org ===" - fi - log_message "========******** END UNINSTALLATION OF MAIN-MENU-LOOP ***********========" - log_message " " +if (restore_full /jci/gui/apps/system/controls/MainMenu/js/MainMenuCtrl.js) +then + log_message "==========************ MainMenuCtrl.js RESTORED ************==========" fi # restore List2Ctrl.js -if [ -e /jci/gui/common/controls/List2/js/List2Ctrl.js.org ] -then - show_message "REMOVE LIST_LOOP_MOD ..." - log_message "=========******** UNINSTALL LIST_LOOP_MOD ... *********=======" - cp -a /jci/gui/common/controls/List2/js/List2Ctrl.js.org /jci/gui/common/controls/List2/js/List2Ctrl.js - log_message "=== Restored List2Ctrl.js from backup ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/gui/common/controls/List2/js/List2Ctrl.js.org - log_message "=== Deleted backup: List2Ctrl.js.org ===" - fi - log_message "======******* END UNINSTALLATION OF LIST_LOOP_MOD *******======" - log_message " " +if (restore_full /jci/gui/common/controls/List2/js/List2Ctrl.js) +then + log_message "============************ List2Ctrl.js RESTORED *************==========" fi - - -#remove diagmenu with 1 sec. press at clock in display settings menu, script made by Sumire_Racing_JPN if [ -e /jci/gui/apps/diag/js/diagApp.js.org2 ] then - show_message "REMOVE DIAGMENU W. 1 SEC. PRESS AT CLOCK \nIN DISPLAY SETTINGS MENU" - log_message "===**** UNINSTALL DIAGMENU AT CLOCK IN DISPLAY SETTINGS MENU ... *****===" - cp -a /jci/gui/apps/diag/js/diagApp.js.org2 /jci/gui/apps/diag/diagApp.js -elif [ -e /jci/gui/apps/diag/js/diagApp.js.org ] + cp -a /jci/gui/apps/diag/js/diagApp.js.org2 /jci/gui/apps/diag/diagApp.js + log_message "============************* diagApp.js RESTORED *************===========" + rm -f /jci/gui/apps/diag/js/diagApp.js.org2 +elif (restore_full /jci/gui/apps/diag/js/diagApp.js) then - show_message "REMOVE DIAGMENU W. 1 SEC. PRESS AT CLOCK \nIN DISPLAY SETTINGS MENU" - log_message "===**** UNINSTALL DIAGMENU AT CLOCK IN DISPLAY SETTINGS MENU ... *****===" - cp -a /jci/gui/apps/diag/js/diagApp.js.org /jci/gui/apps/diag/diagApp.js + log_message "============************* diagApp.js RESTORED *************===========" fi -if [ -e /jci/gui/apps/diag/js/diagApp.js.org ] || [ -e /jci/gui/apps/diag/js/diagApp.js.org2 ] +if [ -e /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js.org2 ] then - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/gui/apps/diag/js/diagApp.js.org - rm -f /jci/gui/apps/diag/js/diagApp.js.org2 - log_message "=== Deleted backup: diagApp.js.org ===" - fi + if ! grep -Fq "formatDateCustom" /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js.org2 + then + cp -a /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js.org2 /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js.org + fi + rm -f /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js.org2 fi -if [ -e /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js.org2 ] +if [ -e /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js.org ] && grep -Fq "formatDateCustom" /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js.org then - if ! grep formatDateCustom /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js.org2 - then - cp -a /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js.org2 /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js - fi - rm -f /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js.org2 + log_message "=== Repairing backup file StatusBarCtrl.js.org ===" + sed -i '/this.date/d' /jci/gui/common/controls/StatusBar/css/StatusBarCtrl.js.org +fi +if (restore_full /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js) +then + log_message "============*********** StatusBarCtrl.js RESTORED **************=========" +else + # in this scenerio we need to repair StatusBarCtrl.js since there is no backup file + # but there is leftover code from date2statusbar because of a bug in AIO 1.x + if grep -Fq "formatDateCustom" /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js + then + log_message "==========********* Repairing file StatusBarCtrl.js ***********==========" + sed -i '/this.date/d' /jci/gui/common/controls/StatusBar/css/StatusBarCtrl.js + fi fi if [ -e /jci/gui/common/js/Common.js.org2 ] then - if ! grep "isMuted \? \"Global.Pause\" : \"Global.Resume\");" /jci/gui/common/js/Common.js.org2 - then - cp -a /jci/gui/common/js/Common.js.org2 /jci/gui/common/js/Common.js.org - fi - rm -f /jci/gui/common/js/Common.js.org2 -fi -if [ -e /jci/gui/apps/diag/controls/Test/js/TestCtrl.js.org ] -then - cp -a /jci/gui/apps/diag/controls/Test/js/TestCtrl.js.org /jci/gui/apps/diag/controls/Test/js/TestCtrl.js - log_message "=== Restored TestCtrl.js From Backup ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/gui/apps/diag/controls/Test/js/TestCtrl.js.org - log_message "=== Deleted backup: TestCtrl.js.org ===" - fi -fi -if [ -e /jci/gui/apps/diag/controls/Test/css/TestCtrl.css.org ] -then - cp -a /jci/gui/apps/diag/controls/Test/css/TestCtrl.css.org /jci/gui/apps/diag/controls/Test/css/TestCtrl.css - log_message "=== Restored TestCtrl.css From Backup ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/gui/apps/diag/controls/Test/css/TestCtrl.css.org - log_message "=== Deleted backup: TestCtrl.css.org ===" - fi -fi -log_message " " -# remove pause on mute -if [ -e /jci/gui/common/js/Common.js.org ] -then - show_message "REMOVE PAUSE_ON_MUTE ..." - log_message "===========*********** UNINSTALL PAUSE_ON_MUTE ... **********============" - if ! grep "Sumire Racing" /jci/gui/common/js/Common.js.org - then - cp -a /jci/gui/common/js/Common.js.org /jci/gui/common/js/Common.js - else - rm -f /jci/gui/common/js/Common.js.org - fi - cp -a /jci/gui/common/js/Common.js.org /jci/gui/common/js/Common.js - log_message "=== Common.js Restored From Backup ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/gui/common/js/Common.js.org - log_message "=== Deleted backup: Common.js.org ===" - fi - log_message "========********** END UNINSTALLATION OF PAUSE-ON-MUTE **********========" - log_message " " + if ! grep -q "isMuted \? \"Global.Pause\" : \"Global.Resume\");" /jci/gui/common/js/Common.js.org2 + then + cp -a /jci/gui/common/js/Common.js.org2 /jci/gui/common/js/Common.js.org + fi + rm -f /jci/gui/common/js/Common.js.org2 +fi +if (restore_full /jci/gui/common/js/Common.js) +then + log_message "==============*********** Common.js RESTORED ***********=================" +fi +if (restore_full /jci/gui/apps/diag/controls/Test/js/TestCtrl.js) +then + log_message "============*********** TestCtrl.js RESTORED ***********=================" +fi +if (restore_full /jci/gui/apps/diag/controls/Test/css/TestCtrl.css) +then + log_message "===========*********** TestCtrl.css RESTORED ***********=================" +fi +if (restore_full /jci/gui/common/controls/Sbn/css/SbnCtrl.css) +then + log_message "============************* SbnCtrl.css RESTORED ***************===========" + rm -f /jci/gui/common/controls/Sbn/css/SbnCtrl.all.css +fi +if (restore_full /jci/gui/common/controls/StatusBar/css/StatusBarCtrl.css) +then + log_message "===========************ StatusBarCtrl.css RESTORED ************==========" +fi +if (restore_full /jci/gui/common/controls/StatusBar/images/StatusBarBg.png) +then + log_message "============************ StatusBarBg.png RESTORED ***************========" +fi +if (restore_full /jci/gui/framework/js/Utility.js) +then + log_message "============************* Utility.js RESTORED **************=============" fi sed -i 's/"settleTime" : 1000,/"settleTime" : 20000,/g' /jci/gui/apps/diag/js/diagApp.js sed -i '/Sumire Racing/d' /jci/gui/common/js/Common.js sed -i 's/"holdTimeout" : 1000,/"holdTimeout" : 5000,/g' /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js - # restore background image and common.css to original -if [ -e /jci/gui/common/css/common.css.org ] -then - show_message "UNINSTALL BACKGROUND ROTATOR ..." - log_message "========********** UNINSTALL BACKGROUND ROTATOR ... *******========" - cp -a /jci/gui/common/css/common.css.org /jci/gui/common/css/common.css - log_message "=== Restored /jci/gui/common/css/common.css from backup ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/gui/common/css/common.css.org - log_message "=== Deleted backup: common.css.org ===" - fi - if grep "keyframes slide" /jci/gui/common/css/common.css - then - cp -a ${MYDIR}/config_org/BackgroundRotator/jci/gui/common/css/common.css /jci/gui/common/css/ - fi - log_message "=====*********** END UNINSTALLATION OF BACKGROUND ROTATOR **********=====" - log_message " " +if (restore_full /jci/gui/common/css/common.css) +then + log_message "=============*********** Common.css RESTORED ***********=================" +fi +if grep -Fq "keyframes slide" /jci/gui/common/css/common.css +then + cp -a ${MYDIR}/config_org/BackgroundRotator/jci/gui/common/css/common.css /jci/gui/common/css/ + log_message "=======******* Common.css RESTORED FROM USB FALLBACK **********==========" fi +show_message "RESTORING TWEAKED FILES ...\nPLEASE WAIT ..." # restore message replies -if [ -e /jci/settings/configurations/blm_msg-system.xml.org ] -then - show_message "RESTORE MESSAGE REPLIES ..." - log_message "=========********* UNINSTALL REMOVE MESSAGE REPLIES ... ********=========" - cp -a /jci/settings/configurations/blm_msg-system.xml.org /jci/settings/configurations/blm_msg-system.xml - log_message "=== Message Replies Restored From Backup blm_msg-system.xml.org ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/settings/configurations/blm_msg-system.xml.org - log_message "=== Deleted backup: blm_msg-system.xml.org ===" - fi - log_message "=====******** END UNINSTALLATION OF REMOVE MESSAGE REPLIES ********======" - log_message " " +if (restore_full /jci/settings/configurations/blm_msg-system.xml) +then + log_message "==========*********** blm_msg-system.xml RESTORED ***********============" fi # restore boot animation -if [ -e /jci/resources/LoopLogo.ivf.org ] -then - show_message "RESTORE BOOT ANIMATION ..." - log_message "========******** UNINSTALL DISABLE BOOT ANIMATION ... ********========" - cp -a /jci/resources/LoopLogo.ivf.org /jci/resources/LoopLogo.ivf - log_message "=== Restored original /jci/resources/LoopLogo.ivf ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/resources/LoopLogo.ivf.org - log_message "=== Deleted backup: LoopLogo.ivf.org ===" - fi -fi -if [ -e /jci/resources/ExitLogo.ivf.org ] -then - cp -a /jci/resources/ExitLogo.ivf.org /jci/resources/ExitLogo.ivf - log_message "=== Restored original /jci/resources/ExitLogo.ivf ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/resources/ExitLogo.ivf.org - log_message "=== Deleted backup: ExitLogo.ivf.org ===" - fi -fi -if [ -e /jci/resources/TranLogo.ivf.org ] -then - cp -a /jci/resources/TranLogo.ivf.org /jci/resources/TranLogo.ivf - log_message "=== Restored original /jci/resources/TranLogo.ivf ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/resources/TranLogo.ivf.org - log_message "=== Deleted backup: TranLogo.ivf.org ===" - fi -fi -if [ -e /jci/resources/TranLogoEnd.ivf.org ] -then - cp -a /jci/resources/TranLogoEnd.ivf.org /jci/resources/TranLogoEnd.ivf - log_message "=== Restored original /jci/resources/TranLogoEnd.ivf ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/resources/TranLogoEnd.ivf.org - log_message "=== Deleted backup: TranLogoEnd.ivf.org ===" - fi - log_message "======******** END UNINSTALLATION OF DISABLE BOOT ANIMATION ******======" - log_message " " -fi -# remove Date_to_Statusbar mod -if [ -e /jci/gui/common/controls/Sbn/css/SbnCtrl.css.org ] -then - show_message "REMOVE STATUSBAR TWEAKS ..." - log_message "=======********* UNINSTALL STATUSBAR TWEAKS ... **********========" - cp -a /jci/gui/common/controls/Sbn/css/SbnCtrl.css.org /jci/gui/common/controls/Sbn/css/SbnCtrl.css - log_message "=== Restored backup from SbnCtrl.css.org ===" - rm -f /jci/gui/common/controls/Sbn/css/SbnCtrl.all.css - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/gui/common/controls/Sbn/css/SbnCtrl.css.org - log_message "=== Deleted backup: SbnCtrl.css.org ===" - fi -fi -if [ -e /jci/gui/common/controls/StatusBar/css/StatusBarCtrl.css.org ] -then - cp -a /jci/gui/common/controls/StatusBar/css/StatusBarCtrl.css.org /jci/gui/common/controls/StatusBar/css/StatusBarCtrl.css - log_message "=== Restored backup from StatusBarCtrl.css.org ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/gui/common/controls/StatusBar/css/StatusBarCtrl.css.org - log_message "=== Deleted backup: StatusBarCtrl.css.org ===" - fi -fi -if [ -e /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js.org ] -then - # make sure the backup does not have date entries from a bug in AIO v1.x - if grep formatDateCustom /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js.org - then - log_message "=== Repairing backup file StatusBarCtrl.js.org ===" - sed -i '/this.date/d' /jci/gui/common/controls/StatusBar/css/StatusBarCtrl.js.org - fi - cp -a /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js.org /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js - log_message "=== Restored backup from StatusBarCtrl.js.org ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js.org - log_message "=== Deleted backup: StatusBarCtrl.js.org ===" - fi -else - # in this scenerio we need to repair StatusBarCtrl.js since there is no backup file - # but there is leftover code from date2statusbar because of a bug in AIO 1.x - if grep formatDateCustom /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js - then - log_message "=== Repairing file StatusBarCtrl.js ===" - sed -i '/this.date/d' /jci/gui/common/controls/StatusBar/css/StatusBarCtrl.js - fi -fi -if [ -e /jci/gui/common/controls/StatusBar/images/StatusBarBg.png.org ] -then - cp -a /jci/gui/common/controls/StatusBar/images/StatusBarBg.png.org /jci/gui/common/controls/StatusBar/images/StatusBarBg.png - log_message "=== Restored backup from StatusBarBg.png.org ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/gui/common/controls/StatusBar/images/StatusBarBg.png.org - log_message "=== Deleted backup: StatusBarBg.png.org ===" - fi -fi -if [ -e /jci/gui/framework/js/Utility.js.org ] -then - cp -a /jci/gui/framework/js/Utility.js.org /jci/gui/framework/js/Utility.js - log_message "=== Restored backup from Utility.js.org ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/gui/framework/js/Utility.js.org - log_message "=== Deleted backup: Utility.js.org ===" - fi - log_message "=====********* END UNINSTALLATION OF STATUSBAR TWEAKS *******=====" - log_message " " +if (restore_full /jci/resources/LoopLogo.ivf) +then + log_message "============************ LoopLogo.ivf RESTORED **************============" +fi +if (restore_full /jci/resources/ExitLogo.ivf) +then + log_message "============************ ExitLogo.ivf RESTORED **************============" +fi +if (restore_full /jci/resources/TranLogo.ivf) +then + log_message "============************ TranLogo.ivf RESTORED ***************===========" +fi +if (restore_full /jci/resources/TranLogoEnd.ivf) +then + log_message "============*********** TranLogoEnd.ivf RESTORED **************==========" fi # restore button background graphics -if [ -e /jci/gui/common/controls/Ump3/css/Ump3Ctrl.css.org ] -then - show_message "RESTORE BUTTON BACKGROUND GRAPHICS ..." - log_message "======********* UNINSTALL NO BUTTON BACKGROUND GRAPHICS ... ******======" - cp -a /jci/gui/common/controls/Ump3/css/Ump3Ctrl.css.org /jci/gui/common/controls/Ump3/css/Ump3Ctrl.css - log_message "=== Restored Ump3Ctrl.css from backup ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/gui/common/controls/Ump3/css/Ump3Ctrl.css.org - log_message "=== Deleted backup: Ump3Ctrl.css.org ===" - fi - log_message "=====********* END UNINSTALLATION OF NO BUTTON BACKGROUND *******========" - log_message " " +if (restore_full /jci/gui/common/controls/Ump3/css/Ump3Ctrl.css) +then + log_message "===========************ Ump3Ctrl.css RESTORED **************=============" fi # Restore Backgounds that were changed prior to AIO v2.1 -if [ -e /jci/gui/common/controls/Ump3/images/UMP_Bg.png.org ] -then - rm -f /jci/gui/common/controls/Ump3/images/UMP_Bg.png - mv /jci/gui/common/controls/Ump3/images/UMP_Bg.png.org /jci/gui/common/controls/Ump3/images/UMP_Bg.png - log_message "=== Restored Original UMP_Bg.png ===" - if [ -e /jci/gui/common/controls/Ump3/images/UMP_Bg_Arch.png.org ] - then - rm -f /jci/gui/common/controls/Ump3/images/UMP_Bg_Arch.png - mv /jci/gui/common/controls/Ump3/images/UMP_Bg_Arch.png.org /jci/gui/common/controls/Ump3/images/UMP_Bg_Arch.png - log_message "=== Restored Original UMP_Bg_Arch.png ===" - if [ -e /jci/gui/common/controls/Ump3/images/UMP_Btn_Separator.png.org ] - then - rm -f /jci/gui/common/controls/Ump3/images/UMP_Btn_Separator.png - mv /jci/gui/common/controls/Ump3/images/UMP_Btn_Separator.png.org /jci/gui/common/controls/Ump3/images/UMP_Btn_Separator.png - log_message "=== Restored Original UMP_Btn_Separator.png ===" - fi - fi +if (restore_full /jci/gui/common/controls/Ump3/images/UMP_Bg.png) +then + rm -f /jci/gui/common/controls/Ump3/images/UMP_Bg.png.org + log_message "==============************** UMP_Bg RESTORED ****************============" + if (restore_full /jci/gui/common/controls/Ump3/images/UMP_Bg_Arch.png) + then + rm -f /jci/gui/common/controls/Ump3/images/UMP_Bg_Arch.png.org + log_message "============************* UMP_Bg_Arch RESTORED **************============" + if (restore_full /jci/gui/common/controls/Ump3/images/UMP_Btn_Separator.png) + then + rm -f /jci/gui/common/controls/Ump3/images/UMP_Btn_Separator.png.org + log_message "===========*********** UMP_Btn_Separator RESTORED ************===========" + fi + fi fi # UI Style Tweaks -if [ -e /jci/gui/common/controls/List2/css/List2Ctrl.css.org ] -then - show_message "UNINSTALL USER INTERFACE TEXT STYLE TWEAKS ..." - log_message "========******** UNINSTALL UI TEXT STYLE TWEAKS ... ********========" - cp -a /jci/gui/common/controls/List2/css/List2Ctrl.css.org /jci/gui/common/controls/List2/css/List2Ctrl.css - log_message "=== Restored backup from List2Ctrl.css.org ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/gui/common/controls/List2/css/List2Ctrl.css.org - log_message "=== Deleted backup: List2Ctrl.css.org ===" - fi -fi -if [ -e /jci/gui/common/controls/NowPlaying4/css/NowPlaying4Ctrl.css.org ] -then - cp -a /jci/gui/common/controls/NowPlaying4/css/NowPlaying4Ctrl.css.org /jci/gui/common/controls/NowPlaying4/css/NowPlaying4Ctrl.css - log_message "=== Restored backup from NowPlaying4Ctrl.css.org ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/gui/common/controls/NowPlaying4/css/NowPlaying4Ctrl.css.org - log_message "=== Deleted backup: NowPlaying4Ctrl.css.org ===" - fi -fi -if [ -e /jci/gui/apps/system/controls/MainMenu/css/MainMenuCtrl.css.org ] -then - cp -a /jci/gui/apps/system/controls/MainMenu/css/MainMenuCtrl.css.org /jci/gui/apps/system/controls/MainMenu/css/MainMenuCtrl.css - log_message "=== Restored backup from MainMenuCtrl.css.org ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/gui/apps/system/controls/MainMenu/css/MainMenuCtrl.css.org - log_message "=== Deleted backup: MainMenuCtrl.css.org ===" - fi - log_message "=====***** END UNINSTALLATION OF UI TEXT STYLE TWEAKS ... *****=====" - log_message " " +if (restore_full /jci/gui/common/controls/List2/css/List2Ctrl.css) +then + log_message "============************ List2Ctrl.css RESTORED *************============" +fi +if (restore_full /jci/gui/common/controls/NowPlaying4/css/NowPlaying4Ctrl.css) +then + log_message "==========*********** NowPlaying4Ctrl.css RESTORED ***********===========" +fi +if (restore_full /jci/gui/apps/system/controls/MainMenu/css/MainMenuCtrl.css) +then + log_message "===========*********** MainMenuCtrl.css RESTORED *************===========" fi # FuelConsumptionTweak -if [ -e /jci/gui/apps/ecoenergy/controls/FuelConsumption/css/FuelConsumptionCtrl.css.org ] -then - show_message "REMOVE FUEL CONSUMPTION TWEAK ..." - log_message "========********* UNINSTALL FUEL CONSUMPTION TWEAK ... *********========" - cp -a /jci/gui/apps/ecoenergy/controls/FuelConsumption/css/FuelConsumptionCtrl.css.org /jci/gui/apps/ecoenergy/controls/FuelConsumption/css/FuelConsumptionCtrl.css - log_message "=== Restored original FuelConsumptionCtrl.css from backup ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/gui/apps/ecoenergy/controls/FuelConsumption/css/FuelConsumptionCtrl.css.org - log_message "=== Deleted backup: FuelConsumptionCtrl.css.org ===" - fi -fi -if [ -e /jci/gui/apps/ecoenergy/controls/FuelConsumption/images/FuelConsBG.png.org ] -then - cp -a /jci/gui/apps/ecoenergy/controls/FuelConsumption/images/FuelConsBG.png.org /jci/gui/apps/ecoenergy/controls/FuelConsumption/images/FuelConsBG.png - log_message "=== Restored original FuelConsumptionCtrl.png from backup ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/gui/apps/ecoenergy/controls/FuelConsumption/images/FuelConsBG.png.org - log_message "=== Deleted backup: FuelConsBG.png.org ===" - fi -fi -if [ -e /jci/gui/apps/ecoenergy/controls/FuelConsumption/js/FuelConsumptionCtrl.js.org ] -then - cp -a /jci/gui/apps/ecoenergy/controls/FuelConsumption/js/FuelConsumptionCtrl.js.org /jci/gui/apps/ecoenergy/controls/FuelConsumption/js/FuelConsumptionCtrl.js - log_message "=== Restored original FuelConsBG.png from backup ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/gui/apps/ecoenergy/controls/FuelConsumption/js/FuelConsumptionCtrl.js.org - log_message "=== Deleted backup: FuelConsumptionCtrl.js.org ===" - fi - log_message "=======******* END UNINSTALLATION OF FUEL CONSUMPTION TWEAK *******======" - log_message " " +if (restore_full /jci/gui/apps/ecoenergy/controls/FuelConsumption/css/FuelConsumptionCtrl.css) +then + log_message "========************ FuelConsumptionCtrl.css RESTORED ************=======" +fi +if (restore_full /jci/gui/apps/ecoenergy/controls/FuelConsumption/images/FuelConsBG.png) +then + log_message "=========*************** FuelConsBG.png RESTORED **************==========" +fi +if (restore_full /jci/gui/apps/ecoenergy/controls/FuelConsumption/js/FuelConsumptionCtrl.js) +then + log_message "========*********** FuelConsumptionCtrl.js RESTORED *************=======" fi # change off screen background image -if [ -e /jci/gui/apps/system/controls/OffScreen/images/OffScreenBackground.png.org ] -then - show_message "REVERTING OFF SCREEN BACKGROUND IMAGE ..." - log_message "========******* UNINSTALL OFF SCREEN BACKGROUND IMAGE ... *******========" - cp -a /jci/gui/apps/system/controls/OffScreen/images/OffScreenBackground.png.org /jci/gui/apps/system/controls/OffScreen/images/OffScreenBackground.png - log_message "=== Reverting From Backup OffScreenBackground.png.org ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/gui/apps/system/controls/OffScreen/images/OffScreenBackground.png.org - log_message "=== Deleted backup: OffScreenBackground.png.org ===" - fi - log_message "=====****** END UNINSTALLATION OF OFF SCREEN BACKGROUND IMAGE ******=====" - log_message " " +if (restore_full /jci/gui/apps/system/controls/OffScreen/images/OffScreenBackground.png) +then + log_message "========********** OffScreenBackground.png RESTORED *************=======" fi -if [ -e /jci/gui/apps/usbaudio/js/usbaudioApp.js.org ] -then - log_message "==========************ UNINSTALL USB AUDIO MOD ... ************==========" - cp -a /jci/gui/apps/usbaudio/js/usbaudioApp.js.org /jci/gui/apps/usbaudio/js/usbaudioApp.js - log_message "=== /jci/gui/apps/usbaudio/js/usbaudioApp.js Restored from backup ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/gui/apps/usbaudio/js/usbaudioApp.js.org - log_message "=== Deleted backup: usbaudioApp.js.org ===" - fi -fi -if [ -e /jci/gui/common/controls/NowPlaying4/js/NowPlaying4Ctrl.js.org ] -then - cp -a /jci/gui/common/controls/NowPlaying4/js/NowPlaying4Ctrl.js.org /jci/gui/common/controls/NowPlaying4/js/NowPlaying4Ctrl.js - log_message "=== Restored NowPlaying4Ctrl.js from backup ===" - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/gui/common/controls/NowPlaying4/js/NowPlaying4Ctrl.js.org - log_message "=== Deleted backup: NowPlaying4Ctrl.js.org ===" - fi - log_message "==========****** END UNINSTALLATION OF OFF USB AUDIO MOD ******==========" - log_message " " -fi -# Remove patch to asound.conf from AA 1.03 -SOUND_X=$(grep -c "tel_asymed" /etc/asound.conf) -if [ $SOUND_X -eq 1 ]; then - # remove patch to /etc/asound.conf Bluetooth calling Bug is fixed - log_message "=== Detected Bluetooth call patch in asound.conf reverting file ===" - if [ -e /etc/asound.conf.org ]; then - if mv /etc/asound.conf.org /etc/asound.conf; then - log_message "=== /etc/asound.conf reverted from backup /etc/asound.conf.org ===" - else - log_message "=== Error removing patch from /etc/asound.conf ===" - fi - fi +if (restore_full /jci/gui/apps/usbaudio/js/usbaudioApp.js) +then + log_message "===========************ usbaudioApp.js RESTORED **************==========" +fi +if (restore_full /jci/gui/common/controls/NowPlaying4/js/NowPlaying4Ctrl.js) +then + log_message "=========*********** NowPlaying4Ctrl.js RESTORED **************==========" +fi +if [ -e /etc/asound.conf.org ] +then + # fix link from previous version + if ! [ -L /etc/asound.conf ]; then + mv /etc/asound.conf ${MYDIR}/asound.conf.AA + ln -sf /data/asound.conf /etc/asound.conf + fi + rm -f /etc/asound.conf.org + log_message "=== /etc/asound.conf reverted from factory /data/asound.conf ===" fi # restore phoneApp if the pach was applied -if [ -e /jci/gui/apps/phone/js/phoneApp.js.org ] +if (restore_full /jci/gui/apps/phone/js/phoneApp.js) then - cp -a /jci/gui/apps/phone/js/phoneApp.js.org /jci/gui/apps/phone/js/phoneApp.js - log_message "=== Restored phoneApp.js From Backup ===" rm -f /jci/gui/apps/phone/js/phoneApp.js.org - log_message "=== Deleted backup: phoneApp.js.org ===" + log_message "=======********* Deleted backup: phoneApp.js.org ********========" fi # Remove APPS show_message "REMOVE VIDEOPLAYER - SPEEDOMETER \n ANDROID AUTO - CASTSCREEN FILES \n & AIO TWEAKS APP FILES..." @@ -530,240 +287,149 @@ log_message "=======********* ANDROID AUTO & CASTSCREEN RECIEVER ... ********== killall -q -9 headunit pkill cs_receiver_arm pkill websocketd -rm -rf /jci/gui/addon-common -log_message "=== Removed /jci/gui/addon-common ===" +rm -rf /jci/gui/addon-common && log_message "==========**************** Removed addon-common **************===========" if grep -Fq "input_filter" /jci/sm/sm.conf then - sed -i '/input_filter/d' /jci/sm/sm.conf - log_message "=== input_filter removed from sm.conf. ===" + sed -i '/input_filter/d' /jci/sm/sm.conf + log_message "========********* input_filter removed from sm.conf. ************========" fi - +rm -fr /jci/gui/apps/_androidauto +rm -fr /tmp/mnt/data_persist/dev/androidauto +rm -fr /tmp/mnt/data_persist/dev/bin/headunit* +rm -fr /tmp/mnt/data_persist/dev/headunit* +rm -fr /tmp/mnt/data_persist/dev/system_restore rm -fr /jci/gui/addon-player rm -fr /jci/gui/addon-speedometer rm -fr /jci/gui/speedometer rm -fr /jci/gui/apps/_speedometer -rm -fr /jci/gui/apps/_mzdmeter rm -fr /jci/gui/apps/_videoplayer rm -fr /jci/gui/apps/_aiotweaks -rm -f /jci/opera/opera_dir/userjs/aio-startup.js -rm -f /jci/opera/opera_dir/userjs/addon-startup.js +rm -fr /jci/gui/apps/_androidauto +rm -fr /jci/gui/apps/_mzdmeter rm -f /jci/opera/opera_dir/userjs/mySpeedometer* rm -f /jci/opera/opera_dir/userjs/speedometer* +rm -f /jci/opera/opera_dir/userjs/*-startup.* +rm -f /jci/opera/opera_dir/userjs/additionalApps.* +rm -f /jci/opera/opera_dir/userjs/aio* rm -f /jci/scripts/get-gps-data* rm -f /jci/scripts/get-log-data* rm -f /jci/scripts/get-vehicle-data-other* rm -f /jci/scripts/get-vehicle-gear* rm -f /jci/scripts/get-vehicle-speed* -rm -f /jci/opera/opera_dir/userjs/*-startup.* -rm -f /jci/opera/opera_dir/userjs/additionalApps.* -rm -f /jci/opera/opera_dir/userjs/aio.js rm -f /jci/scripts/wait_adb_arm.sh rm -f /jci/scripts/adb rm -f /jci/scripts/cs_receiver_arm rm -f /jci/scripts/cs_receiver_conn_arm rm -f /jci/scripts/mirroring.sh -rm -fr /tmp/mnt/data_persist/dev/androidauto -rm -fr /tmp/mnt/data_persist/dev/headunit_libs -rm -fr /tmp/mnt/data_persist/dev/bin/headunit_libs +rm -f ${STAGE_WIFI}.bak? +rm -f ${STAGE_WIFI}.old +rm -f ${STAGE_WIFI}.org +rm -f ${STAGE_WIFI}.org2 +rm -f ${STAGE_WIFI}.org3 +rm -f ${STAGE_WIFI}.AA +rm -f /tmp/mnt/data_persist/dev/bin/flac-usb-recover rm -f /tmp/mnt/data_persist/dev/bin/websocketd -rm -f /tmp/mnt/data_persist/dev/bin/headunit rm -f /tmp/mnt/data_persist/dev/bin/aaserver -rm -f /tmp/mnt/data_persist/dev/bin/headunit-wrapper rm -f /tmp/mnt/data_persist/dev/bin/input_filter -rm -fr /jci/gui/apps/_androidauto +rm -f /tmp/mnt/data_persist/dev/bin/check-usb.sh +rm -f /tmp/mnt/data_persist/dev/bin/usb-allow.list rm -f /tmp/mnt/data/enable_input_filter rm -f /tmp/mnt/data/input_filter rm -f /usr/lib/gstreamer-0.10/libgsth264parse.so -rm -f /jci/scripts/stage_wifi.sh.bak? -rm -f /jci/scripts/stage_wifi.sh.old -rm -f /jci/scripts/stage_wifi.sh.org -rm -f /jci/scripts/stage_wifi.sh.org2 -rm -f /jci/scripts/stage_wifi.sh.org3 -rm -f /jci/scripts/stage_wifi.sh.AA -rm -fr /jci/gui/apps/_* -if [ -e /usr/lib/gstreamer-0.10/libgstalsa.so.org ] -then - cp -a /usr/lib/gstreamer-0.10/libgstalsa.so.org /usr/lib/gstreamer-0.10/libgstalsa.so - cmp --silent ${MYDIR}/config_org/androidauto/usr/lib/gstreamer-0.10/libgstalsa.so /usr/lib/gstreamer-0.10/libgstalsa.so.org || cp -a ${MYDIR}/config_org/androidauto/usr/lib/gstreamer-0.10/libgstalsa.so /usr/lib/gstreamer-0.10/ - log_message "=== Restored libgstalsa.so ===" - rm -f /usr/lib/gstreamer-0.10/libgstalsa.so.org - /bin/fsync /usr/lib/gstreamer-0.10/libgstalsa.so -fi -echo "#!/bin/sh" > /jci/scripts/stage_wifi.sh -if [ -e /jci/scripts/jci-fw.sh.org ] -then - log_message "=== Restoring /jci/scripts/jci-fw.sh ===" - cp -a /jci/scripts/jci-fw.sh.org /jci/scripts/jci-fw.sh - if [ $DEL_BAKUPS -eq 1 ] - then - rm -f /jci/scripts/jci-fw.sh.org - log_message "=== Deleted backup: jci-fw.sh.org ===" - fi -fi -log_message "=======************ END UNINSTALLATION OF VIDEOPLAYER ************=======" -log_message "=======************* END UNISTALLATION OF SPEEDOMETER ************=======" -log_message "=======********* END UNINSTALLATION OF CASTSCREEN-RECEIVER *******=======" -log_message "=======***** END UNINSTALLATION OF ANDROID AUTO HEADUNIT APP ****=======" -log_message " " - -# restore safety warning from reverse camera -show_message "RESTORE SAFETY WARNING FROM REVERSE CAMERA ..." -log_message "===***** UNINSTALL REMOVE SAFETY WARNING FROM REVERSE CAMERA ... *****===" - -# Copy reverse camera safety warning images +# if [ -e /usr/lib/gstreamer-0.10/libgstalsa.so.org ] +# then +# cp -a /usr/lib/gstreamer-0.10/libgstalsa.so.org /usr/lib/gstreamer-0.10/libgstalsa.so +# cmp --silent ${MYDIR}/config_org/androidauto/usr/lib/gstreamer-0.10/libgstalsa.so /usr/lib/gstreamer-0.10/libgstalsa.so.org || cp -a ${MYDIR}/config_org/androidauto/usr/lib/gstreamer-0.10/libgstalsa.so /usr/lib/gstreamer-0.10/ +# log_message "=======************* Restored libgstalsa.so ********========" +# rm -f /usr/lib/gstreamer-0.10/libgstalsa.so.org +# /bin/fsync /usr/lib/gstreamer-0.10/libgstalsa.so +# fi +echo "#!/bin/sh" > ${STAGE_WIFI} +if (restore_full /jci/scripts/jci-fw.sh) +then + log_message "===========************* jci-fw.js RESTORED ****************=============" +fi +show_message "RESTORE ALL INFOTAINMENT COLORS AND IMAGES\n(BACK TO RED) ..." cp -a ${MYDIR}/config_org/safety-warning-reverse-camera/jci/nativegui/images/*.png /jci/nativegui/images/ -log_message "=== Reverse Camera Safety Warning Restored ===" - -log_message "===*** END UNINSTALLATION OF REMOVE REVERSE CAMERA SAFETY WARNING ***===" -log_message " " - -# remove semi-transparent parking sensor graphics for the proximity sensors -show_message "REMOVE SEMI-TRANSPARENT PARKING SENSOR GRAPHICS ..." -log_message "===***** UNINSTALL SEMI-TRANSPARENT PARKING SENSOR GRAPHICS ... ******===" - -# Copy parking sensor images +log_message "=======******* SAFETY WARNING FROM REVERSE CAMERA RESTORED *******=======" cp -a ${MYDIR}/config_org/transparent-parking-sensor/jci/nativegui/images/VerticalSensors/* /jci/nativegui/images/VerticalSensors/ -log_message "=== Copied /jci/nativegui/images/VerticalSensors/*.png ===" cp -a ${MYDIR}/config_org/transparent-parking-sensor/jci/nativegui/images/HorizontalSensors/* /jci/nativegui/images/HorizontalSensors/ -log_message "=== Copied /jci/nativegui/images/HorizontalSensors/*.png ===" cp -a ${MYDIR}/config_org/transparent-parking-sensor/jci/nativegui/images/MiniView/* /jci/nativegui/images/MiniView/ -log_message "=== Copied /jci/nativegui/images/MiniView/*.png ===" - -log_message "==*** END UNINSTALLATION OF SEMI-TRANSPARENT PARKING SENSOR GRAPHICS **==" -log_message " " +log_message "===========********* PARKING SENSOR GRAPHICS RESTORED **********=========" cp -a "${MYDIR}/config_org/blank-album-art-frame/jci/gui/common/controls/InCall2/images/NowPlayingImageFrame.png" /jci/gui/common/controls/InCall2/images cp -a "${MYDIR}/config_org/blank-album-art-frame/jci/gui/common/controls/NowPlaying4/images/NowPlayingImageFrame.png" /jci/gui/common/controls/NowPlaying4/images cp -a "${MYDIR}/config_org/blank-album-art-frame/jci/gui/common/images/no_artwork_icon.png" /jci/gui/common/images -# remove custom infotainment colors - back to original red scheme, speedometer too +log_message "===========*********** BLANK ALBUM ART FRAME RESTORED ***********========" if [ -e ${MYDIR}/config/color-schemes/Red/jci/ ] then - show_message "RESTORE ALL INFOTAINMENT COLORS AND IMAGES (BACK TO RED) ..." - log_message "===**** RESTORE INFOTAINMENT COLORS AND IMAGES (BACK TO RED) ... ****===" - cp -a ${MYDIR}/config/color-schemes/Red/jci / + log_message "===**** RESTORE INFOTAINMENT COLORS AND IMAGES (BACK TO RED) ... *****===" + cp -a ${MYDIR}/config/color-schemes/Red/jci / - if [ -e /jci/nng/ux/_skin_jci_bluedemo.zip ] - then - rm -f /jci/nng/ux/_skin_jci_bluedemo.zip - log_message "=== Deleted blue color scheme for NAV App ===" - fi - rm -f /jci/gui/common/images/blue.aio - rm -f /jci/gui/common/images/green.aio - rm -f /jci/gui/common/images/orange.aio - rm -f /jci/gui/common/images/pink.aio - rm -f /jci/gui/common/images/purple.aio - rm -f /jci/gui/common/images/silver.aio - rm -f /jci/gui/common/images/yellow.aio + if [ -e /jci/nng/ux/_skin_jci_bluedemo.zip ] + then + rm -f /jci/nng/ux/_skin_jci_bluedemo.zip + log_message "=======********* Deleted blue color scheme for NAV App **********========" + fi + rm -f /jci/gui/common/images/blue.aio + rm -f /jci/gui/common/images/green.aio + rm -f /jci/gui/common/images/orange.aio + rm -f /jci/gui/common/images/pink.aio + rm -f /jci/gui/common/images/purple.aio + rm -f /jci/gui/common/images/silver.aio + rm -f /jci/gui/common/images/yellow.aio - log_message "===***** END UNINSTALLATION OF CUSTOM INFOTAINMENT COLOR SCHEME ******===" - log_message " " fi cp -a "${MYDIR}/config_org/background.png" /jci/gui/common/images log_message "============******** RESTORED ORIGINAL BACKGROUND ***********============" -log_message " " +mount -o rw,remount /tmp/mnt/resources sleep 2 +rm -fr /tmp/mnt/resources/aio # uninstall CASDK if [ -e /jci/casdk/casdk.aio ] then show_message "===****** UNINSTALLING CASDK ******===" log_message "==========************ BEGIN UNINSTALLING CASDK ************===========" - log_message " " - - # mount resources - mount -o rw,remount /tmp/mnt/resources # kill all watch processes - log_message "- Removing watch processes" pkill -f watch pkill -f 'watch -n 1' pkill -f 'watch -n 60' pkill -f 'watch -n 300' pkill -f 'mzd-casdk.start' + rm -rf /jci/casdk + rm -rf /jci/gui/apps/custom + rm -f /jci/opera/opera_dir/userjs/CustomApplicationsProxy.js + rm -f /jci/opera/opera_dir/userjs/nativeApps.js + log_message "==========************ Removing watch processes ************===========" # reset storage if [ -e /tmp/mnt/data_persist/storage ] then - log_message "- Removing storage folder" - rm -rf /tmp/mnt/data_persist/storage + rm -rf /tmp/mnt/data_persist/storage + log_message "==========************ Removing storage folder *************===========" fi if [ -e /jci/opera/opera_home/pstorage/psindex.dat ] then if [ -f /jci/opera/opera_home/pstorage/psindex.dat.org ] then - log_message "- Removing local storage settings" cp -a /jci/opera/opera_home/pstorage/psindex.dat.org /jci/opera/opera_home/pstorage/psindex.dat - rm /jci/opera/opera_home/pstorage/psindex.dat.org + rm /jci/opera/opera_home/pstorage/psindex.dat.org + log_message "==========********* Removing local storage settings ********===========" else - log_message "- Removing local storage settings and pstorage" rm -rf /jci/opera/opera_home/pstorage + log_message "======***** Removing local storage settings and pstorage ********======" fi fi - # remove data reader files - if [ -e /jci/casdk ] - then - log_message "- Removing data script folder /jci/casdk" - rm /jci/casdk/* - rmdir --ignore-fail-on-non-empty /jci/casdk - else - log_message "- CASDK Data script folder '/jci/casdk' not found" - fi - - # remove initialization file - if grep -q "# CASDK" /jci/scripts/stage_wifi.sh - then - log_message "- Removing staging scripts" - # echo '#!/bin/sh' > /jci/scripts/stage_wifi.sh - sed -i '/# CASDK/d' /jci/scripts/stage_wifi.sh - sed -i '/casdk/d' /jci/scripts/stage_wifi.sh - sed -i '/################/d' /jci/scripts/stage_wifi.sh - sed -i '/# one time/d' /jci/scripts/stage_wifi.sh - sed -i '/# 1s update/d' /jci/scripts/stage_wifi.sh - sed -i '/# 60s update/d' /jci/scripts/stage_wifi.sh - sed -i '/# 300s update/d' /jci/scripts/stage_wifi.sh - sed -i '/mzd-casdk.start/d' /jci/scripts/stage_wifi.sh - else - log_message "- No staging scripts fouund in /jci/scripts/stage_wifi.sh" - fi - - # remove proxy - if [ -f /jci/opera/opera_dir/userjs/CustomApplicationsProxy.js ] - then - log_message "- Removing proxys & startups" - rm -f /jci/opera/opera_dir/userjs/CustomApplicationsProxy.js - rm -f /jci/opera/opera_dir/userjs/nativeApps.js - fi - - if [ -f /jci/opera/opera_dir/userjs/additionalApps.js.org ] - then - log_message "- Restoring additionalApps.js" - mv /jci/opera/opera_dir/userjs/additionalApps.js.org /jci/opera/opera_dir/userjs/additionalApps.js - fi - - # delete custom - if [ -e /jci/gui/apps/custom ] - then - log_message "- Removing custom application folder" - rm -rf /jci/gui/apps/custom||true - else - log_message "- Custom application folder does not exist" - fi - - if [ -e /tmp/mnt/resources/aio ] - then - log_message "- Removing custom runtime & apps" - rm -rf /resources/aio/mzd-casdk||true - else - log_message "- CASDK runtime & apps do not exist" - fi fi log_message "************************* SYSTEM FULLY RESTORED *************************" show_message "========== SYSTEM FULLY RESTORED ==========" # a window will appear before the system reboots automatically sleep 3 -killall jci-dialog +killall -q jci-dialog /jci/tools/jci-dialog --info --title="SYSTEM FULLY RESTORED" --text="THE SYSTEM WILL REBOOT IN A FEW SECONDS!" --no-cancel & sleep 10 -killall jci-dialog +killall -q jci-dialog reboot diff --git a/app/files/tweaks/00__casdk-i.txt b/app/files/tweaks/00__casdk-i.txt index 0f4156d..71a0a49 100644 --- a/app/files/tweaks/00__casdk-i.txt +++ b/app/files/tweaks/00__casdk-i.txt @@ -24,74 +24,39 @@ else log_message "=== Javascript Logging Already Enabled ===" fi -# modify opera storage and move to persistant data -if [ ! -e /tmp/mnt/data_persist/storage ] -then - mkdir -p /tmp/mnt/data_persist/storage - log_message "=== Created Storage Folder ===" -else - log_message "=== Storage Folder Present ===" -fi - -if [ ! -e /jci/opera/opera_home/pstorage/psindex.dat.org ] -then - # check if system file exists - if [ -e /jci/opera/opera_home/pstorage/psindex.dat ] - then - # make a copy - cp -a /jci/opera/opera_home/pstorage/psindex.dat /jci/opera/opera_home/pstorage/psindex.dat.org - else - # create directory - mkdir -p /jci/opera/opera_home/pstorage/ - fi - # copy psindex file - cp -a ${MYDIR}/casdk/storage/psindex.dat /jci/opera/opera_home/pstorage/ - log_message "=== Copied psindex.dat file ===" -else - log_message "=== Persistant Storage Already Modified ===" -fi - # install data reader files -if [ ! -e /jci/casdk ] -then - mkdir -p /jci/casdk - cp -a ${MYDIR}/casdk/scripts/* /jci/casdk - find /jci/casdk/ -name "vdt*.sh" -exec chmod 755 {} \; - log_message "=== Installed data reader files ===" -else - log_message "=== Data reader files already installed ===" -fi +[ ! -e /jci/casdk ] && mkdir -p /jci/casdk +cp -a ${MYDIR}/casdk/scripts/* /jci/casdk +find /jci/casdk/ -name "vdt*.sh" -exec chmod 755 {} \; +log_message "=== Installed data reader files ===" # copy initialization file -if ! grep -Fq "#!/bin/sh" /jci/scripts/stage_wifi.sh +if ! grep -Fq "#!/bin/sh" ${STAGE_WIFI} then - cp -a ${MYDIR}/casdk/jci/stage_wifi.sh /jci/scripts/ - log_message "=== CASDK Entries Added To Stage_wifi.sh ===" -elif grep -Fq 'mzd-casdk.start' /jci/scripts/stage_wifi.sh + echo "#!/bin/sh" > ${STAGE_WIFI} + log_message "=== CASDK Entries Added To Stage_wifi.sh ===" +fi +if grep -Fq 'sh /tmp/mnt/resources/aio/autorun/mzd-casdk.start &' ${STAGE_WIFI} then - log_message "=== CASDK Entries already present in stage_wifi.sh ===" + log_message "=== CASDK Entries already present in stage_wifi.sh ===" else - #cat <> /jci/scripts/stage_wifi.sh - ### CASDK Data Gathering Script - #sh /tmp/mnt/resources/aio/autorun/mzd-casdk.start & - #EOT - sed -i '/#!/ a\### CASDK Data' /jci/scripts/stage_wifi.sh + sed -i '/vdt/d' ${STAGE_WIFI} + sed -i '/CASDK Data/d' ${STAGE_WIFI} + sed -i '/#!/ a\### CASDK Data' ${STAGE_WIFI} sleep 1 - sed -i '/CASDK Data/ i\ ' /jci/scripts/stage_wifi.sh - sed -i '/CASDK Data/ a\sh /tmp/mnt/resources/aio/autorun/mzd-casdk.start &' /jci/scripts/stage_wifi.sh - chmod 755 /jci/scripts/stage_wifi.sh + sed -i '/CASDK Data/ i\ ' ${STAGE_WIFI} + sed -i '/CASDK Data/ a\sh /tmp/mnt/resources/aio/autorun/mzd-casdk.start &' ${STAGE_WIFI} + chmod 755 ${STAGE_WIFI} log_message "=== CASDK Entries Added To Stage_wifi.sh ===" fi -chmod 755 /jci/scripts/stage_wifi.sh +chmod 755 ${STAGE_WIFI} # copy CustomApplicationsProxy and aio.js cp -a ${MYDIR}/casdk/proxy/CustomApplicationsProxy.js /jci/opera/opera_dir/userjs/ cp -a ${MYDIR}/casdk/proxy/aio.js /jci/opera/opera_dir/userjs/ chmod 755 /jci/opera/opera_dir/userjs/aio.js chmod 755 /jci/opera/opera_dir/userjs/CustomApplicationsProxy.js -chown 1018:3015 /jci/opera/opera_dir/userjs/aio.js -chown 1018:3015 /jci/opera/opera_dir/userjs/CustomApplicationsProxy.js log_message "=== Copied CustomApplicationsProxy.js ===" if [ -e /jci/opera/opera_dir/userjs/additionalApps.js ] @@ -100,37 +65,30 @@ then log_message "=== Disable AdditionalApps.js ===" fi -if [ -e /jci/opera/opera_dir/userjs/additionalApps.json ] +if [ -e ${ADDITIONAL_APPS_JSON} ] then - echo "additionalApps = $(cat /jci/opera/opera_dir/userjs/additionalApps.json)" > /jci/opera/opera_dir/userjs/nativeApps.js - log_message "=== Created nativeApps.js for CASDK ===" + echo "additionalApps = $(cat ${ADDITIONAL_APPS_JSON})" > /jci/opera/opera_dir/userjs/nativeApps.js + log_message "=== Created nativeApps.js for CASDK ===" else echo "additionalApps = [" > /jci/opera/opera_dir/userjs/nativeApps.js echo "];" >> /jci/opera/opera_dir/userjs/nativeApps.js log_message "=== No Apps Found - Created Empty nativeApps.js for CASDK ===" fi -# install CASDK runtime if it doesnt exist or newer version -if [ ! -e /tmp/mnt/resources/aio/mzd-casdk/runtime ] || [[ "${_CASDK_VER}" < "${CASDK_VER}" ]] -then - cp -a ${MYDIR}/casdk/resources /tmp/mnt - chmod -R 755 /tmp/mnt/resources/aio - chmod -R 755 /tmp/mnt/resources/dev/bin - echo "_AIO_VER=${AIO_VER}" > /jci/casdk/casdk.aio - echo "_CASDK_VER=${CASDK_VER}" >> /jci/casdk/casdk.aio - log_message "=== Installed CASDK Runtime ===" -else - # for development use - # cp -a ${MYDIR}/casdk/resources/aio/mzd-casdk /tmp/mnt/resources/aio - log_message "=== CASDK Runtime Already Installed ===" -fi +# install CASDK runtime +cp -a ${MYDIR}/casdk/resources /tmp/mnt +chmod -R 755 /tmp/mnt/resources/aio +chmod -R 755 /tmp/mnt/resources/dev/bin +echo "_AIO_VER=${AIO_VER}" > /jci/casdk/casdk.aio +echo "_CASDK_VER=${CASDK_VER}" >> /jci/casdk/casdk.aio +log_message "=== Installed CASDK Runtime ===" # create custom folder -if [ ! -e /jci/gui/apps/custom ] +if [ ! -L /jci/gui/apps/custom ] then - # create custom apps symlink - ln -sf /tmp/mnt/resources/aio/mzd-casdk /jci/gui/apps/custom - log_message "=== Created Symlinks To Custom App Folder ===" + rm -rf /jci/gui/apps/custom + ln -sf /tmp/mnt/resources/aio/mzd-casdk /jci/gui/apps/custom + log_message "=== Created Symlinks To Custom App Folder ===" else log_message "=== Custom App Folder Already Exists ===" fi diff --git a/app/files/tweaks/00__casdk-u.txt b/app/files/tweaks/00__casdk-u.txt index 6e64921..043d1a3 100644 --- a/app/files/tweaks/00__casdk-u.txt +++ b/app/files/tweaks/00__casdk-u.txt @@ -7,7 +7,7 @@ log_message "==========************ BEGIN UNINSTALLING CASDK ************======= log_message " " # kill all watch processes -log_message "- Removing watch processes" +log_message "=== Removing watch processes ====" pkill -f watch pkill -f 'watch -n 1' pkill -f 'watch -n 60' @@ -16,86 +16,86 @@ pkill -f 'mzd-casdk.start' pkill -f websocketd # reset storage -if [ -e /tmp/mnt/data_persist/storage ] -then - log_message "- Removing storage folder" - rm -rf /tmp/mnt/data_persist/storage -fi -if [ -e /jci/opera/opera_home/pstorage/psindex.dat ] -then - if [ -f /jci/opera/opera_home/pstorage/psindex.dat.org ] - then - log_message "- Removing local storage settings" - cp -a /jci/opera/opera_home/pstorage/psindex.dat.org /jci/opera/opera_home/pstorage/psindex.dat - rm /jci/opera/opera_home/pstorage/psindex.dat.org - else - log_message "- Removing local storage settings and pstorage" - rm -rf /jci/opera/opera_home/pstorage - fi -fi +# if [ -e /tmp/mnt/data_persist/storage ] +# then +# log_message "=== Removing storage folder ====" +# rm -rf /tmp/mnt/data_persist/storage +# fi +# if [ -e /jci/opera/opera_home/pstorage/psindex.dat ] +# then +# if [ -f /jci/opera/opera_home/pstorage/psindex.dat.org ] +# then +# log_message "=== Removing local storage settings ====" +# cp -a /jci/opera/opera_home/pstorage/psindex.dat.org /jci/opera/opera_home/pstorage/psindex.dat +# rm /jci/opera/opera_home/pstorage/psindex.dat.org +# else +# log_message "=== Removing local storage settings and pstorage ====" +# rm -rf /jci/opera/opera_home/pstorage +# fi +# fi # remove data reader files if [ -e /jci/casdk ] then - log_message "- Removing data script folder /jci/casdk" - rm /jci/casdk/* - rmdir --ignore-fail-on-non-empty /jci/casdk + log_message "=== Removing data script folder /jci/casdk ====" + rm -rf /jci/casdk else - log_message "- CASDK Data script folder '/jci/casdk' not found" + log_message "=== CASDK Data script folder '/jci/casdk' not found ====" fi # remove initialization file -if grep -q "# CASDK" /jci/scripts/stage_wifi.sh +if grep -Fq "# CASDK" ${STAGE_WIFI} then - log_message "- Removing staging scripts" - # echo '#!/bin/sh' > /jci/scripts/stage_wifi.sh - sed -i '/# CASDK/d' /jci/scripts/stage_wifi.sh - sed -i '/casdk/d' /jci/scripts/stage_wifi.sh - sed -i '/################/d' /jci/scripts/stage_wifi.sh - sed -i '/# one time/d' /jci/scripts/stage_wifi.sh - sed -i '/# 1s update/d' /jci/scripts/stage_wifi.sh - sed -i '/# 60s update/d' /jci/scripts/stage_wifi.sh - sed -i '/# 300s update/d' /jci/scripts/stage_wifi.sh - sed -i '/mzd-casdk.start/d' /jci/scripts/stage_wifi.sh + log_message "=== Removing staging scripts ====" + # echo '#!/bin/sh' > ${STAGE_WIFI} + sed -i '/# CASDK/d' ${STAGE_WIFI} + sed -i '/casdk/d' ${STAGE_WIFI} + sed -i '/vdt/d' ${STAGE_WIFI} + sed -i '/################/d' ${STAGE_WIFI} + sed -i '/# one time/d' ${STAGE_WIFI} + sed -i '/# 1s update/d' ${STAGE_WIFI} + sed -i '/# 60s update/d' ${STAGE_WIFI} + sed -i '/# 300s update/d' ${STAGE_WIFI} + sed -i '/mzd-casdk.start/d' ${STAGE_WIFI} else - log_message "- No staging scripts fouund in /jci/scripts/stage_wifi.sh" + log_message "=== No staging scripts fouund in ${STAGE_WIFI} ====" fi # remove proxy if [ -f /jci/opera/opera_dir/userjs/CustomApplicationsProxy.js ] then - log_message "- Removing proxys & startups" + log_message "=== Removing proxys & startups ====" rm -f /jci/opera/opera_dir/userjs/CustomApplicationsProxy.js rm -f /jci/opera/opera_dir/userjs/nativeApps.js fi -sed -i '/Terminal/d' /jci/scripts/stage_wifi.sh -sed -i '/terminal/d' /jci/scripts/stage_wifi.sh +sed -i '/Terminal/d' ${STAGE_WIFI} +sed -i '/terminal/d' ${STAGE_WIFI} if [ -f /jci/opera/opera_dir/userjs/additionalApps.js.org ] then - log_message "- Restoring additionalApps.js" + log_message "=== Restoring additionalApps.js ====" mv /jci/opera/opera_dir/userjs/additionalApps.js.org /jci/opera/opera_dir/userjs/additionalApps.js fi # delete custom if [ -e /jci/gui/apps/custom ] then - log_message "- Removing custom application folder" - rm -rf /jci/gui/apps/custom||true + log_message "=== Removing custom application folder ====" + rm -rf /jci/gui/apps/custom else - log_message "- Custom application folder does not exist" + log_message "=== Custom application folder does not exist ====" fi if [ -e /tmp/mnt/resources/aio ] then - log_message "- Removing custom runtime & apps" - rm -rf /resources/aio/mzd-casdk||true + log_message "=== Removing custom runtime & apps ====" + rm -rf /resources/aio/mzd-casdk else - log_message "- CASDK runtime & apps do not exist" + log_message "=== CASDK runtime & apps do not exist ====" fi -log_message "- Done!" +log_message "=== Done! ====" sleep 5 -killall jci-dialog +killall -q jci-dialog /jci/tools/jci-dialog --title="CASDK UNINSTALLED" --text="THE CUSTOM APPLICATION RUNTIME\nWAS SUCCESSFULLY UNINSTALLED.\n\nTHE SYSTEM WILL REBOOT IN A FEW SECONDS." --no-cancel & sleep 10 reboot diff --git a/app/files/tweaks/00__casdkapps-i.txt b/app/files/tweaks/00__casdkapps-i.txt index 71d3bb9..3f44b6c 100644 --- a/app/files/tweaks/00__casdkapps-i.txt +++ b/app/files/tweaks/00__casdkapps-i.txt @@ -15,7 +15,7 @@ then rm -rf ${MZD_APP_DIR} ln -sf ${MZD_APP_SD}/apps ${MZD_APP_DIR} log_message "=== Created App Symlink To NAV_SD Card ===" - killall jci-dialog + killall -q jci-dialog /jci/tools/jci-dialog --confirm --title="INSTALL APPS TO SD CARD?" --text="INSTALL CASDK APPS ONTO SD CARD?\n\n1. YES - INSTALL APPS ONTO SD CARD.\nOR\n2. NO - SKIP (MANUALLY INSTALL APPS TO SD CARD)." --ok-label="1. YES - INSTALL" --cancel-label="2. NO - SKIP" if [ $? -eq 1 ] then @@ -29,7 +29,7 @@ then show_message "INSTALLING CASDK APPS TO SD CARD ... " fi else - killall jci-dialog + killall -q jci-dialog /jci/tools/jci-dialog --confirm --title="INSTALL CASDK APPS?" --text="NO SD CARD CONNECTED, TO USE CASDK APPS:\n\n1. MANUALLY INSTALL APPS TO SD CARD\nOR\n2. INSTALL APPS TO SYSTEM (NO SD CARD NEEDED)." --ok-label="1. SD CARD" --cancel-label="2. SYSTEM DISK" if [ $? -eq 1 ] then @@ -71,10 +71,10 @@ else fi # Set up terminal app to directly execute shell commands -if [ ${APPTERMINAL} -eq 1 ] && ! grep -Fq "terminal" /jci/scripts/stage_wifi.sh +if [ ${APPTERMINAL} -eq 1 ] && ! grep -Fq "terminal" ${STAGE_WIFI} then - echo '### Terminal' >> /jci/scripts/stage_wifi.sh - echo 'sh /jci/gui/apps/custom/apps/app.terminal/terminal.sh &' >> /jci/scripts/stage_wifi.sh + echo '### Terminal' >> ${STAGE_WIFI} + echo 'sh /jci/gui/apps/custom/apps/app.terminal/terminal.sh &' >> ${STAGE_WIFI} log_message "=== Added Terminal Startup ===" fi @@ -94,14 +94,14 @@ add_casdk_app "${APPSNAKE}" "snake" echo '];' >> ${MZD_APPS_JS} chmod -R 755 ${MZD_APP_DIR} -backup_org /jci/gui/apps/system/js/systemApp.js # for FW v59 if they do not have No more disclamer or order of audio source # apply patch to show apps in app List if [ $COMPAT_GROUP -gt 2 ] && ! grep -Fq "app.casdkapps" /jci/gui/apps/system/js/systemApp.js then + backup_org /jci/gui/apps/system/js/systemApp.js if [ $COMPAT_GROUP -lt 6 ] then - cp -a ${MYDIR}/casdk/patch/systemApp.js /jci/gui/apps/system/js + cp -a ${MYDIR}/casdk/patch/systemApp.js /jci/gui/apps/system/js/ log_message "=== Patched systemApp.js for AIO + CASDK apps for v59 ===" elif [ $COMPAT_GROUP -eq 6 ] then @@ -114,7 +114,7 @@ fi sleep 5 log_message "=========************* CASDK INSTALLATION FINISHED *************=========" -killall jci-dialog +killall -q jci-dialog /jci/tools/jci-dialog --title="AIO + CASDK INSTALLED" --text="THE CUSTOM APPLICATION RUNTIME\nWAS SUCCESSFULLY INSTALLED\n\nTHE SYSTEM WILL REBOOT IN A FEW SECONDS." --no-cancel & sleep 10 reboot diff --git a/app/files/tweaks/00__casdkapps-u.txt b/app/files/tweaks/00__casdkapps-u.txt index 708c554..91e3e52 100644 --- a/app/files/tweaks/00__casdkapps-u.txt +++ b/app/files/tweaks/00__casdkapps-u.txt @@ -15,10 +15,10 @@ then MZD_APPS_JS=${MZD_APP_DIR}/apps.js #Remove terminal from stage_wifi.sh - if [ ${APPTERMINAL} -eq 1 ] && grep -Fq "terminal" /jci/scripts/stage_wifi.sh + if [ ${APPTERMINAL} -eq 1 ] && grep -Fq "terminal" ${STAGE_WIFI} then - sed -i /Terminal/d /jci/scripts/stage_wifi.sh - sed -i /terminal.sh/d /jci/scripts/stage_wifi.sh + sed -i /Terminal/d ${STAGE_WIFI} + sed -i /terminal.sh/d ${STAGE_WIFI} log_message "=== Removed Terminal Startup ===" fi if [ -e ${MZD_APPS_JS} ] @@ -40,7 +40,7 @@ fi sleep 5 log_message "=========************ CASDK UNINSTALLATION FINISHED ************=========" -killall jci-dialog +killall -q jci-dialog /jci/tools/jci-dialog --title="CASDK APPS UNINSTALLED" --text="CASDK APPS SUCCESSFULLY UNINSTALLED.\n\nTHE SYSTEM WILL REBOOT IN A FEW SECONDS." --no-cancel & sleep 10 reboot diff --git a/app/files/tweaks/00_background.txt b/app/files/tweaks/00_background.txt index 779bc22..a5d80c8 100644 --- a/app/files/tweaks/00_background.txt +++ b/app/files/tweaks/00_background.txt @@ -4,7 +4,7 @@ log_message "=======********* INSTALL CHANGE BACKGROUND IMAGE ... *********== if [ $KEEPBKUPS -eq 1 ] then - cp -a /jci/gui/common/images/background.png "${MYDIR}/bakups/background.png" + cp /jci/gui/common/images/background.png "${MYDIR}/bakups/background.png" aio_info \"background.png\", log_message "=== Previous Infotainment Background Saved To: === " log_message "=== ${MYDIR}/bakups/background.png ===" diff --git a/app/files/tweaks/00_backup.txt b/app/files/tweaks/00_backup.txt index 506bc2b..c6de381 100644 --- a/app/files/tweaks/00_backup.txt +++ b/app/files/tweaks/00_backup.txt @@ -18,6 +18,12 @@ else then log_message "===== Backing up /jci to ${BACKUPDIR} =====" cp -R /jci ${BACKUPDIR} + #log_message "===== Backing up /resources to ${BACKUPDIR} =====" + #cp -R /tmp/mnt/resources ${BACKUPDIR} + #log_message "===== Backing up /data to ${BACKUPDIR} =====" + #cp -R /tmp/mnt/data ${BACKUPDIR} + #log_message "===== Backing up /data_persist to ${BACKUPDIR} =====" + #cp -R /tmp/mnt/data_persist ${BACKUPDIR} echo "DATE: $(timestamp)" > ${BACKUPDIR}/jci.txt echo "CMU_VER: ${CMU_SW_VER}" >> ${BACKUPDIR}/jci.txt echo "AIO_VER: ${AIO_VER}" >> ${BACKUPDIR}/jci.txt diff --git a/app/files/tweaks/00_bgrotator-i.txt b/app/files/tweaks/00_bgrotator-i.txt index 4d6c5d5..0f5e434 100644 --- a/app/files/tweaks/00_bgrotator-i.txt +++ b/app/files/tweaks/00_bgrotator-i.txt @@ -5,29 +5,30 @@ log_message "==========********** INSTALL BACKGROUND ROTATOR ... ************=== sed -i "/.. MZD-AIO-TI CSS ../,/.. END AIO CSS ../d" /jci/gui/common/css/common.css log_message "=== Removed old AIO Custom CSS in common.css ===" - -cat <> /jci/gui/common/css/common.css -/* MZD-AIO-TI CSS */ -/* Custom Background Animation */ -.CommonBgImg { - background-position:0; - animation: slide ${BG_SECONDS}s steps(${BG_STEPS},end) infinite; -} -/* The Animation */ -@keyframes slide { - to { - background-position:-${BG_WIDTH}px; +if [ "${BG_SECONDS}" != "" ] +then + cat <> /jci/gui/common/css/common.css + /* MZD-AIO-TI CSS */ + /* Custom Background Animation */ + .CommonBgImg { + background-position:0; + animation: slide ${BG_SECONDS}s steps(${BG_STEPS},end) infinite; + } + /* The Animation */ + @keyframes slide { + to { + background-position:-${BG_WIDTH}px; + } } -} -/* END AIO CSS */ + /* END AIO CSS */ EOT -log_message "=== Background Set To Show ${BG_STEPS} Images ===" -log_message "=== For ${BG_SEC_EACH} Seconds Each ===" -log_message "=== Background Animation Added to common.css ===" - + log_message "=== Background Set To Show ${BG_STEPS} Images ===" + log_message "=== For ${BG_SEC_EACH} Seconds Each ===" + log_message "=== Background Animation Added to common.css ===" +fi if [ $TESTBKUPS -eq 1 ] then - cp -a /jci/gui/common/css/common.css "${MYDIR}/bakups/test/common_after-background.css" + cp /jci/gui/common/css/common.css "${MYDIR}/bakups/test/common_after-background.css" fi log_message "========********** END INSTALLATION OF BACKGROUND ROTATOR *********======" log_message " " diff --git a/app/files/tweaks/00_bgrotator-u.txt b/app/files/tweaks/00_bgrotator-u.txt index 8560a52..f1ff3f2 100644 --- a/app/files/tweaks/00_bgrotator-u.txt +++ b/app/files/tweaks/00_bgrotator-u.txt @@ -9,18 +9,10 @@ log_message "=== Removed MZD-AIO-TI Custom CSS in common.css if grep -Fq "animation: slide .* infinite" /jci/gui/common/css/common.css then log_message "=== Leftover code found Restoring common.css ===" - if [ -e /jci/gui/common/css/common.css.org ] + if ! (restore_org /jci/gui/common/css/common.css) then - if [ $KEEPBKUPS -eq 1 ] - then - cp /jci/gui/common/css/common.css.org "${MYDIR}/bakups/" - aio_info \"common.css.org\", - fi - cp /jci/gui/common/css/common.css.org /jci/gui/common/css/common.css - log_message "=== Restored /jci/gui/common/css/common.css from backup ===" - else cp -a "${MYDIR}/config_org/BackgroundRotator/jci/gui/common/css/common.css" /jci/gui/common/css - log_message "=== No backup available. Restored /jci/gui/common/css/common.css USB ===" + log_message "=== No backup available. Restored common.css from USB Fallback ===" fi fi diff --git a/app/files/tweaks/00_end.txt b/app/files/tweaks/00_end.txt index 94eb8e4..927ecae 100644 --- a/app/files/tweaks/00_end.txt +++ b/app/files/tweaks/00_end.txt @@ -1,19 +1,11 @@ -if [ -e ${ADDITIONAL_APPS_JSON} ] -then - # Delete Blank Lines In additionalApps.json - sed -i '/^ *$/ d' ${ADDITIONAL_APPS_JSON} - cp ${ADDITIONAL_APPS_JSON} "${MYDIR}/bakups/test/additionalApps.after.json" -fi -if [ -e /tmp/mnt/data/aio.log ] +show_message "========== END OF TWEAKS INSTALLATION ==========" +if [ -f "${MYDIR}/AIO_log.txt" ] then - # copy aio log if present - mv /tmp/mnt/data/aio.log ${MYDIR}/bakups/ + log_message " " + sleep 2 + log_message "======================= END OF TWEAKS INSTALLATION ======================" fi -log_message " " -sleep 2 -log_message "======================= END OF TWEAKS INSTALLATION ======================" -show_message "========== END OF TWEAKS INSTALLATION ==========" -if [ $KEEPBKUPS -eq 1 ] +if [ $KEEPBKUPS -eq 1 ] && [ -e ${MYDIR}/AIO_info.json ] then json="$(cat ${MYDIR}/AIO_info.json)" rownend=$(echo -n $json | tail -c 1) @@ -27,10 +19,10 @@ then fi # a window will appear before the system reboots automatically sleep 3 -killall jci-dialog +killall -q jci-dialog /jci/tools/jci-dialog --info --title="SELECTED AIO TWEAKS APPLIED" --text="THE SYSTEM WILL REBOOT IN A FEW SECONDS!" --no-cancel & sleep 10 -killall jci-dialog +killall -q jci-dialog /jci/tools/jci-dialog --info --title="MZD-AIO-TI v.${AIO_VER}" --text="YOU CAN REMOVE THE USB DRIVE NOW\n\nENJOY!" --no-cancel & reboot -killall jci-dialog +exit 0 diff --git a/app/files/tweaks/00_factory-reset-end.txt b/app/files/tweaks/00_factory-reset-end.txt new file mode 100644 index 0000000..7479cec --- /dev/null +++ b/app/files/tweaks/00_factory-reset-end.txt @@ -0,0 +1,32 @@ +sleep 2 +log_message "======================= END OF TWEAKS INSTALLATION ======================" +show_message "========== END OF TWEAKS INSTALLATION ==========" +if [ -e ${MYDIR}/AIO_info.json ] +then + rm -f ${MYDIR}/AIO_info.json +fi +# a window will appear before the system reboots automatically +sleep 3 +if [ $SKIPCONFIRM -eq 1 ] +then + show_message "THE SYSTEM WILL BE FACTORY RESET TO APPLY\n\nMESSAGE REPLY AND DEFAULT SETTINGS TWEAKS" + sleep 5 +else + killall -q jci-dialog + /jci/tools/jci-dialog --confirm --title="MZD-AIO-TI | FACTORY RESET?" --text="TO APPLY MESSAGE REPLY AND DEFAULT SETTINGS TWEAKS\nTHE SYSTEM NEEDS TO BE FACTORY RESET\nNOTE: ALL SETTINGS AND FAVORITES WILL BE RESET" --ok-label="FACTORY RESET" --cancel-label="REBOOT ONLY" +fi +if [ $? = 0 ] || [ $SKIPCONFIRM -eq 1 ] +then + log_message "=======********************* FACTORY RESET!! *********************=======*" + show_message "NOTE: THE *ONLY* TWEAK THAT WILL BE RESET IS\n\"TOUCHSCREEN WHILE DRIVING\"\nALL OTHER TWEAKS WILL REMAIN" + sleep 5 + show_message "FACTORY RESET!!" + sleep 2 + /jci/scripts/jci-factoryreset.sh -r +else + killall -q jci-dialog + /jci/tools/jci-dialog --info --title="SELECTED AIO TWEAKS APPLIED" --text="THE SYSTEM WILL REBOOT IN A FEW SECONDS!" --no-cancel & + sleep 3 + reboot +fi +exit 0 diff --git a/app/files/tweaks/00_intro.txt b/app/files/tweaks/00_intro.txt index 315290e..075ee6b 100644 --- a/app/files/tweaks/00_intro.txt +++ b/app/files/tweaks/00_intro.txt @@ -1,23 +1,35 @@ #!/bin/sh -# tweaks.sh - MZD-AIO-TI Version 2.8.0 +# tweaks.sh - MZD-AIO-TI Version 2.8.1 # Special thanks to Siutsch for collecting all the tweaks and for the original AIO # Big Thanks to Modfreakz, khantaena, Xep, ID7, Doog, Diginix, oz_paulb, VIC_BAM85, & lmagder # For more information visit https://mazdatweaks.com # Enjoy, Trezdog44 - Trevelopment.com +# (C) 2018 Trevor G Martin # Time hwclock --hctosys # AIO Variables -AIO_VER=2.8.0 -AIO_DATE=2018.08.01 -# Android Auto Version -AA_VER=1.09 +AIO_VER=2.8.1 +AIO_DATE=2018.10.01 +# Android Auto Headunit App Version +AA_VER=1.10 # Video Player Version -VP_VER=3.5 +VP_VER=3.6 # Speedometer Version -SPD_VER=5.7 +SPD_VER=5.8 # AIO Tweaks App Version -AIO_TWKS_VER=0.7 +AIO_TWKS_VER=0.8 # CASDK Version CASDK_VER=0.0.5 +# Variable paths to common locations for better code readability +# additionalApps.json +ADDITIONAL_APPS_JSON="/jci/opera/opera_dir/userjs/additionalApps.json" +# stage_wifi.sh +STAGE_WIFI="/jci/scripts/stage_wifi.sh" +# location of SD card +MZD_APP_SD="/tmp/mnt/sd_nav" +# CASDK Apps location +MZD_APP_DIR="/tmp/mnt/resources/aio/mzd-casdk/apps" +# Install location for native AIO apps +AIO_APP_DIR="/jci/gui/apps" diff --git a/app/files/tweaks/00_offbackground-u.txt b/app/files/tweaks/00_offbackground-u.txt index 7bfa800..0d6499e 100644 --- a/app/files/tweaks/00_offbackground-u.txt +++ b/app/files/tweaks/00_offbackground-u.txt @@ -2,11 +2,8 @@ show_message "REVERTING OFF SCREEN BACKGROUND IMAGE ..." log_message "======******** UNINSTALL OFF SCREEN BACKGROUND IMAGE ... ********========" -if [ -e /jci/gui/apps/system/controls/OffScreen/images/OffScreenBackground.png.org ] +if ! (restore_org /jci/gui/apps/system/controls/OffScreen/images/OffScreenBackground.png) then - cp -a /jci/gui/apps/system/controls/OffScreen/images/OffScreenBackground.png.org /jci/gui/apps/system/controls/OffScreen/images/OffScreenBackground.png - log_message "=== Reverting From Backup OffScreenBackground.png.org ===" -else cp -a ${MYDIR}/config/OffScreenBackground.png /jci/gui/apps/system/controls/OffScreen/images/ log_message "=== Copied OffScreenBackground.png from USB ===" fi diff --git a/app/files/tweaks/00_sshbringback.txt b/app/files/tweaks/00_sshbringback.txt index 75b8fce..9fb6282 100644 --- a/app/files/tweaks/00_sshbringback.txt +++ b/app/files/tweaks/00_sshbringback.txt @@ -5,49 +5,49 @@ # Added force SSH option to force update SSH settings SSH_COPY=0 log_message "=======************* START INSTALL SSH BRINGBACK ************========" -if [ "${CMU_SW_VER}" == "56.00.511A-EU" ] \ -|| [ "${CMU_SW_VER}" == "56.00.512A-EU" ] \ -|| [ "${CMU_SW_VER}" == "56.00.513B-EU" ] \ -|| [ "${CMU_SW_VER}" == "56.00.511A-ADR" ] \ -|| [ "${CMU_SW_VER}" == "56.00.512A-ADR" ] \ -|| [ "${CMU_SW_VER}" == "56.00.513C-ADR" ] \ -|| [ "${CMU_SW_VER}" == "56.00.514A-ADR" ] \ -|| [ "${CMU_SW_VER}" == "56.00.521A-EU" ] \ -|| [ "${CMU_SW_VER}" == "56.00.513C-EU" ] \ +if [ "${CMU_SW_VER}" = "56.00.511A-EU" ] \ +|| [ "${CMU_SW_VER}" = "56.00.512A-EU" ] \ +|| [ "${CMU_SW_VER}" = "56.00.513B-EU" ] \ +|| [ "${CMU_SW_VER}" = "56.00.511A-ADR" ] \ +|| [ "${CMU_SW_VER}" = "56.00.512A-ADR" ] \ +|| [ "${CMU_SW_VER}" = "56.00.513C-ADR" ] \ +|| [ "${CMU_SW_VER}" = "56.00.514A-ADR" ] \ +|| [ "${CMU_SW_VER}" = "56.00.521A-EU" ] \ +|| [ "${CMU_SW_VER}" = "56.00.513C-EU" ] \ || [ $COMPAT_GROUP -ne 1 ] \ || [ $FORCESSH -eq 1 ] then - SSH_COPY=1 + SSH_COPY=1 fi if [ $SSH_COPY -eq 1 ] then - show_message "${CMU_SW_VER} DETECTED: SSH_BRINGBACK WILL BE INSTALLED ..." - cp /jci/scripts/jci-fw.sh ${MYDIR}/config/jci-fw.sh.test - if grep -Fq 'Disable ICMP services CI-2952' ${MYDIR}/config/jci-fw.sh.test || [ $FORCESSH -eq 1 ] - then - cp -a ${MYDIR}/config/ssh_bringback/jci-fw.sh /jci/scripts - chmod 755 /jci/scripts/jci-fw.sh - log_message "=== Fixed firewall settings in jci-fw.sh ===" - fi - if ! grep -q '^jci:' /config-mfg/passwd || [ $FORCESSH -eq 1 ] - then - cp -a ${MYDIR}/config/ssh_bringback/passwd /tmp - cp -a ${MYDIR}/config/ssh_bringback/authorized_keys /tmp - cp -a ${MYDIR}/config/ssh_bringback/sshd_config /etc/ssh - cp -a ${MYDIR}/config/ssh_bringback/config-update.sh /tmp - cp -a ${MYDIR}/config/ssh_bringback/mksquashfs /tmp - cp -a ${MYDIR}/config/ssh_bringback/passwd_update.sh /tmp - chmod 755 /tmp/mksquashfs - chmod 755 /jci/scripts/jci-fw.sh - chmod 755 /tmp/config-update.sh - chmod 755 /tmp/passwd_update.sh - /tmp/passwd_update.sh - log_message "=== ${CMU_SW_VER} detected: SSH activated! ===" - else - log_message "=== ${CMU_SW_VER} detected: but SSH is already activated! ===" - fi + show_message "${CMU_SW_VER} DETECTED: SSH_BRINGBACK WILL BE INSTALLED ..." + cp /jci/scripts/jci-fw.sh ${MYDIR}/config/jci-fw.sh.test + if grep -Fq 'Disable ICMP services CI-2952' ${MYDIR}/config/jci-fw.sh.test || [ $FORCESSH -eq 1 ] + then + cp -a ${MYDIR}/config/ssh_bringback/jci-fw.sh /jci/scripts + chmod 755 /jci/scripts/jci-fw.sh + log_message "=== Fixed firewall settings in jci-fw.sh ===" + fi + if ! grep -q '^jci:' /config-mfg/passwd || [ $FORCESSH -eq 1 ] + then + cp -a ${MYDIR}/config/ssh_bringback/passwd /tmp + cp -a ${MYDIR}/config/ssh_bringback/authorized_keys /tmp + cp -a ${MYDIR}/config/ssh_bringback/sshd_config /etc/ssh + cp -a ${MYDIR}/config/ssh_bringback/config-update.sh /tmp + cp -a ${MYDIR}/config/ssh_bringback/mksquashfs /tmp + cp -a ${MYDIR}/config/ssh_bringback/passwd_update.sh /tmp + chmod 755 /tmp/mksquashfs + chmod 755 /jci/scripts/jci-fw.sh + chmod 755 /tmp/config-update.sh + chmod 755 /tmp/passwd_update.sh + /tmp/passwd_update.sh + log_message "=== ${CMU_SW_VER} detected: SSH activated! ===" + else + log_message "=== ${CMU_SW_VER} detected: but SSH is already activated! ===" + fi else - log_message "=== ${CMU_SW_VER} detected, so SSH must already be activated! ===" + log_message "=== ${CMU_SW_VER} detected, so SSH must already be activated! ===" fi log_message "======************ END INSTALLATION OF SSH BRINGBACK ***********========" diff --git a/app/files/tweaks/00_start.txt b/app/files/tweaks/00_start.txt index 8c8e650..1d1ffed 100644 --- a/app/files/tweaks/00_start.txt +++ b/app/files/tweaks/00_start.txt @@ -29,14 +29,12 @@ aio_info() { if [ $KEEPBKUPS -eq 1 ] then - echo "$*" 1>&2 + # echo "$*" 1>&2 echo "$*" >> "${MYDIR}/AIO_info.json" /bin/fsync "${MYDIR}/AIO_info.json" fi } # CASDK functions -MZD_APP_SD=/tmp/mnt/sd_nav -MZD_APP_DIR=/tmp/mnt/resources/aio/mzd-casdk/apps get_casdk_mode() { if [ -e /jci/casdk/casdk.aio ] @@ -72,15 +70,16 @@ remove_casdk_app() log_message "=== Uninstalled CASDK App: ${CASDK_APP:0:10} ===" fi } +# Compatibility check falls into 7 groups: +# 70.00.100+ ($COMPAT_GROUP=7 *Temporary, until tested*) +# 70.00.XXX ($COMPAT_GROUP=6) +# 59.00.5XX ($COMPAT_GROUP=5) +# 59.00.4XX ($COMPAT_GROUP=4) +# 59.00.3XX ($COMPAT_GROUP=3) +# 58.00.XXX ($COMPAT_GROUP=2) +# 55.00.XXX - 56.00.XXX ($COMPAT_GROUP=1) compatibility_check() { - # Compatibility check falls into 6 groups: - # 70.00.XXX ($COMPAT_GROUP=6) - # 59.00.5XX ($COMPAT_GROUP=5) - # 59.00.4XX ($COMPAT_GROUP=4) - # 59.00.3XX ($COMPAT_GROUP=3) - # 58.00.XXX ($COMPAT_GROUP=2) - # 55.00.XXX - 56.00.XXX ($COMPAT_GROUP=1) _VER=$(get_cmu_ver) _VER_EXT=$(grep "^JCI_SW_VER=" /jci/version.ini | sed 's/^.*_\([^_]*\)\"$/\1/' | cut -d '.' -f 3) _VER_MID=$(grep "^JCI_SW_VER=" /jci/version.ini | sed 's/^.*_\([^_]*\)\"$/\1/' | cut -d '.' -f 2) @@ -129,71 +128,153 @@ remove_aio_js() INPUT=${1##*/} log_message "=== Removed ${2:0:11} JavaScript From ${INPUT:0:13} ===" } +backup_failed() +{ + FILE="${1}" + # Double Check The Backup + if [ -s $FILE ] + then + return + else + rm -f $FILE + show_message "FAILED TO CREATE BACKUP FILE:\n$FILE\nCHECK AIO_log.txt FOR MORE INFO" + log_message "BACKUP FOR $FILE FAILED... SEE FOLLOWING LINES FOR SPACE ANALYSIS" + df -h >> "${MYDIR}/AIO_log.txt" + sleep 10 + show_message "THE INSTALLATION HAS ABORTED... REMOVE USB DRIVE NOW\nTHE SYSTEM WILL REBOOT" + sleep 2 + reboot + exit 1 + fi +} +# Make a ".org" backup +# pass the full file path +# If creating backup fails the installation is aborted backup_org() { - FILE=${1} + FILE="${1}" BACKUP_FILE="${1}.org" FILENAME=$(basename -- "$FILE") FEXT="${FILENAME##*.}" FNAME="${FILENAME%.*}" if [ ! -e "${BACKUP_FILE}" ] then - cp -a "${FILE}" "${BACKUP_FILE}" - log_message "***+++---===|___ Created Backup of ${FILENAME} ___|===---+++***" + cp -a "${FILE}" "${BACKUP_FILE}" && log_message "===+++---***|\___ Created Backup of ${FILENAME} ___/|***---+++===" fi if [ $KEEPBKUPS -eq 1 ] && [ ! -e "${MYDIR}/bakups/${FILENAME}.org" ] then - cp -a "${BACKUP_FILE}" "${MYDIR}/bakups/" - aio_info \"${FILENAME}\", + cp "${BACKUP_FILE}" "${MYDIR}/bakups/" + aio_info \"${FILENAME}\", fi if [ $TESTBKUPS -eq 1 ] && [ ! -e "${MYDIR}/bakups/test/${FNAME}_before.${FEXT}" ] then - cp -a ${FILE} "${MYDIR}/bakups/test/${FNAME}_before.${FEXT}" + cp ${FILE} "${MYDIR}/bakups/test/${FNAME}_before.${FEXT}" + fi + # checks to make sure the backup created is not an empty file + [ -s ${BACKUP_FILE} ] || backup_failed ${BACKUP_FILE} +} +# Restore file from the ".org" backup +# pass the full file path (without ".org") +# return 1 if no ".org" file exists, 0 if it does +restore_org() +{ + FILE="${1}" + BACKUP_FILE="${1}.org" + FILENAME=$(basename -- "$FILE") + FEXT="${FILENAME##*.}" + FNAME="${FILENAME%.*}" + if [ -s "${BACKUP_FILE}" ] + then + if [ $TESTBKUPS -eq 1 ] && [ ! -e "${MYDIR}/bakups/test/${FNAME}_before-uninstall.${FEXT}" ] + then + cp ${FILE} "${MYDIR}/bakups/test/${FNAME}_before-uninstall.${FEXT}" + fi + cp -a "${BACKUP_FILE}" "${FILE}" && log_message "===+++---***|\___ Restored ${FILENAME} From Backup ___/|***---+++===" + if [ $KEEPBKUPS -eq 1 ] && [ ! -e "${MYDIR}/bakups/${FILENAME}.org" ] + then + cp "${BACKUP_FILE}" "${MYDIR}/bakups/" + aio_info \"${FILENAME}\", + fi + return 0 + else + return 1 fi } show_message() { sleep 5 - killall jci-dialog + killall -q jci-dialog # log_message "= POPUP: $* " /jci/tools/jci-dialog --info --title="MZD-AIO-TI v.${AIO_VER}" --text="$*" --no-cancel & } show_message_OK() { sleep 4 - killall jci-dialog + killall -q jci-dialog # log_message "= POPUP: $* " /jci/tools/jci-dialog --confirm --title="MZD-AIO-TI | CONTINUE INSTALLATION?" --text="$*" --ok-label="YES - GO ON" --cancel-label="NO - ABORT" if [ $? != 1 ] then - killall jci-dialog + killall -q jci-dialog return else log_message "********************* INSTALLATION ABORTED *********************" show_message "INSTALLATION ABORTED! PLEASE UNPLUG USB DRIVE" sleep 10 - killall jci-dialog + killall -q jci-dialog exit 0 fi } -# Shotrhand for location of additionalApps.json -ADDITIONAL_APPS_JSON="/jci/opera/opera_dir/userjs/additionalApps.json" +# create additionalApps.json file from scratch if the file does not exist +create_app_json() +{ + if [ ! -e ${ADDITIONAL_APPS_JSON} ] + then + echo "[" > ${ADDITIONAL_APPS_JSON} + echo "]" >> ${ADDITIONAL_APPS_JSON} + chmod 755 ${ADDITIONAL_APPS_JSON} + log_message "=== Created additionalApps.json ===" + fi +} +info_log() +{ + INFOLOG="${MYDIR}/bakups/info.log" + rm -f $INFOLOG + show_version.sh > $INFOLOG + echo "INFO LOG: ${INFOLOG} $(timestamp)" >> $INFOLOG + echo "> df -h" >> $INFOLOG + df -h >> $INFOLOG + echo "> cat /proc/mounts" >> $INFOLOG + cat /proc/mounts >> $INFOLOG + echo "> cat /proc/meminfo" >> $INFOLOG + cat /proc/meminfo >> $INFOLOG + echo "> ps" >> $INFOLOG + ps >> $INFOLOG + # echo "> netstat -a" >> $INFOLOG + # netstat -a >> $INFOLOG + # echo "> du -h /jci" >> $INFOLOG + # du -h /jci >> $INFOLOG + # echo "> du -h /tmp/mnt/resources" >> $INFOLOG + # du -h /tmp/mnt/resources >> $INFOLOG + echo "END INFO LOG: $(timestamp)" >> $INFOLOG +} # script by vic_bam85 add_app_json() { - if which node > /dev/null && which add_app_json.js > /dev/null - then - add_app_json.js ${ADDITIONAL_APPS_JSON} "${1}" "${2}" "${3}" >> ${MYDIR}/node.log 2>&1 - log_message "=== node add_app_json.js ${2:0:10} ===" - elif [ -e ${MYDIR}/config/bin/node ] && [ -e ${MYDIR}/config/bin/add_app_json.js ] + # check if entry in additionalApps.json still exists, if so nothing is to do + count=$(grep -c '{ "name": "'"${1}"'"' ${ADDITIONAL_APPS_JSON}) + if [ $count -eq 0 ] then - ${MYDIR}/config/bin/node ${MYDIR}/config/bin/add_app_json.js ${ADDITIONAL_APPS_JSON} "${1}" "${2}" "${3}" >> ${MYDIR}/node.log 2>&1 - log_message "=== ${MYDIR}/config/bin/node add_app_json.js ${2:0:10} ===" - else - # check if entry in additionalApps.json still exists, if so nothing is to do - count=$(grep -c '{ "name": "'"${1}"'"' ${ADDITIONAL_APPS_JSON}) - if [ $count -eq 0 ] + # try to use node if it exists + if which node > /dev/null && which add_app_json.js > /dev/null + then + add_app_json.js ${ADDITIONAL_APPS_JSON} "${1}" "${2}" "${3}" >> ${MYDIR}/node.log 2>&1 + log_message "=== node add_app_json.js ${2:0:10} ===" + elif [ -e ${MYDIR}/config/bin/node ] && [ -e ${MYDIR}/config/bin/add_app_json.js ] then + ${MYDIR}/config/bin/node ${MYDIR}/config/bin/add_app_json.js ${ADDITIONAL_APPS_JSON} "${1}" "${2}" "${3}" >> ${MYDIR}/node.log 2>&1 + log_message "=== ${MYDIR}/config/bin/node add_app_json.js ${2:0:10} ===" + else log_message "=== ${2:0:10} not found in additionalApps.json, first installation ===" mv ${ADDITIONAL_APPS_JSON} ${ADDITIONAL_APPS_JSON}.old sleep 2 @@ -215,7 +296,7 @@ add_app_json() log_message "=== Add ${2:0:10} to last line of additionalApps.json ===" echo ' { "name": "'"${1}"'", "label": "'"${2}"'" }' >> ${ADDITIONAL_APPS_JSON} sleep 2 - if [ ${3} != "" ] + if [ "${3}" != "" ] then sed -i 's/"label": "'"${2}"'" \}/"label": "'"${2}"'", "preload": "'"${3}"'" \}/g' ${ADDITIONAL_APPS_JSON} fi @@ -223,19 +304,19 @@ add_app_json() echo "]" >> ${ADDITIONAL_APPS_JSON} sleep 2 rm -f ${ADDITIONAL_APPS_JSON}.old - else - log_message "=== ${2:0:10} already exists in additionalApps.json ===" fi - fi - cp ${ADDITIONAL_APPS_JSON} "${MYDIR}/bakups/test/additionalApps${1}-5._after.json" - if [ -e /jci/opera/opera_dir/userjs/nativeApps.js ] - then - echo "additionalApps = $(cat ${ADDITIONAL_APPS_JSON})" > /jci/opera/opera_dir/userjs/nativeApps.js - log_message "=== Updated nativeApps.js ===" + cp ${ADDITIONAL_APPS_JSON} "${MYDIR}/bakups/test/additionalApps${1}-5._after.json" + if [ -e /jci/opera/opera_dir/userjs/nativeApps.js ] + then + echo "additionalApps = $(cat ${ADDITIONAL_APPS_JSON})" > /jci/opera/opera_dir/userjs/nativeApps.js + log_message "=== Updated nativeApps.js ===" + fi + else + log_message "=== ${2:0:10} already exists in additionalApps.json ===" fi } -remove_app_json() # script by vic_bam85 +remove_app_json() { if which node > /dev/null && which remove_app_json.js > /dev/null then @@ -262,7 +343,7 @@ remove_app_json() json="$(cat ${ADDITIONAL_APPS_JSON})" # check if last sign is comma rownend=$(echo -n $json | tail -c 1) - if [ "$rownend" == "," ] + if [ "$rownend" = "," ] then # if so, remove "," from back end echo ${json%,*} > ${ADDITIONAL_APPS_JSON} @@ -296,30 +377,37 @@ remove_app_json() # disable watchdog and allow write access echo 1 > /sys/class/gpio/Watchdog\ Disable/value mount -o rw,remount / -# mount resources -mount -o rw,remount /tmp/mnt/resources/ MYDIR=$(dirname "$(readlink -f "$0")") +mount -o rw,remount ${MYDIR} + CMU_VER=$(get_cmu_ver) CMU_SW_VER=$(get_cmu_sw_version) COMPAT_GROUP=$(compatibility_check) get_casdk_mode +info_log # save logs mkdir -p "${MYDIR}/bakups/test/" +logfile="${MYDIR}/bakups/AIO_log.log" if [ -f "${MYDIR}/AIO_log.txt" ]; then if [ ! -f "${MYDIR}/bakups/count.txt" ]; then echo 0 > "${MYDIR}/bakups/count.txt" fi logcount=$(cat ${MYDIR}/bakups/count.txt) - mv "${MYDIR}/AIO_log.txt" "${MYDIR}/bakups/AIO_log-${logcount}.txt" + #mv "${MYDIR}/AIO_log.txt" "${MYDIR}/bakups/AIO_log-${logcount}.txt" + logfile="${MYDIR}/bakups/AIO_log-${logcount}.log" echo $((logcount+1)) > "${MYDIR}/bakups/count.txt" + rm -f "${MYDIR}/AIO_log.txt" fi rm -f "${MYDIR}/AIO_info.json" - +# experimental new log will expose +# all the errors in my scripts ^_^ +exec > $logfile 2>&1 log_message "=========================================================================" log_message "======================= START LOGGING TWEAKS... ======================" log_message "======================= AIO v.${AIO_VER} - ${AIO_DATE} ======================" +log_message "=$(/jci/scripts/show_version.sh)" log_message "======================= CMU_SW_VER = ${CMU_SW_VER} ======================" log_message "======================= COMPATIBILITY_GROUP = ${COMPAT_GROUP} =======================" #log_message "======================== CMU_VER = ${CMU_VER} =====================" @@ -362,19 +450,19 @@ then log_message "************************* INSTALLATION ABORTED **************************" && reboot exit 1 fi - # Compatibility Check +# Compatibility Check if [ $COMPAT_GROUP -ge 6 ] then sleep 2 - killall jci-dialog - /jci/tools/jci-dialog --confirm --title="MZD-AIO-TI | CONTINUE INSTALLATION?" --text="WARNING! VERSION ${CMU_SW_VER} DETECTED\nAIO COMPATIBILITY HAS ONLY BEEN TESTED UP TO V70.00.000\nIF YOU ARE RUNNING A LATER FW VERSION USE EXTREME CAUTION!" --ok-label="YES - GO ON" --cancel-label="NO - ABORT" + killall -q jci-dialog + /jci/tools/jci-dialog --confirm --title="MZD-AIO-TI | CONTINUE INSTALLATION?" --text="WARNING! VERSION ${CMU_SW_VER} DETECTED\nAIO COMPATIBILITY HAS ONLY BEEN TESTED UP TO V70.00.021\nIF YOU ARE RUNNING A LATER FW VERSION USE EXTREME CAUTION!" --ok-label="YES - GO ON" --cancel-label="NO - ABORT" if [ $? = 1 ] then log_message "********************* INSTALLATION ABORTED *********************" show_message "INSTALLATION ABORTED! PLEASE UNPLUG USB DRIVE" sleep 10 - killall jci-dialog + killall -q jci-dialog exit 0 fi fi @@ -396,7 +484,7 @@ else sleep 10 show_message "UNPLUG USB DRIVE NOW" sleep 15 - killall jci-dialog + killall -q jci-dialog # To run unknown FW you need to comment out or remove the following 2 lines mount -o ro,remount / exit 0 @@ -424,6 +512,8 @@ then cp -a /jci/opera/opera_home/opera.ini /jci/opera/opera_home/opera.ini.org log_message "======== Backup /jci/opera/opera_home/opera.ini to opera.ini.org ========" else + # checks to make sure opera.ini is not an empty file + [ -s /jci/opera/opera_home/opera.ini ] || cp /jci/opera/opera_home/opera.ini.org /jci/opera/opera_home/opera.ini log_message "================== Backup of opera.ini already there! ===================" fi sed -i 's/User JavaScript=0/User JavaScript=1/g' /jci/opera/opera_home/opera.ini @@ -453,26 +543,48 @@ then mkdir -p /tmp/mnt/data_persist/dev/bin/ log_message "======== Restored Missing Folder /tmp/mnt/data_persist/dev/bin/ =========" fi -if grep -Fq ,, ${ADDITIONAL_APPS_JSON} +if [ -e ${ADDITIONAL_APPS_JSON} ] && grep -Fq ,, ${ADDITIONAL_APPS_JSON} then # remove double commas sed -i 's/,,/,/g' ${ADDITIONAL_APPS_JSON} log_message "================ Fixed Issue with additionalApps.json ===================" fi DATA_PERSIST=$(df -h | (grep 'data_persist' || echo 0) | awk '{ print $5 " " $1 }') -#log_message $DATA_PERSIST +_ROOTFS=$(df -h | (grep 'rootfs' || echo 0) | awk '{ print $5 " " $1 }') +_RESOURCES=$(df -h | (grep 'resources' || echo 0) | awk '{ print $5 " " $1 }') USED=$(echo $DATA_PERSIST | awk '{ print $1}' | cut -d'%' -f1 ) -#log_message $USED -log_message "==================== data_persist partition ${USED}% used ====================" -if [ $USED -ge 80 ]; then - rm -f /tmp/mnt/data_persist/log/dumps/* +USED_ROOTFS=$(echo $_ROOTFS | awk '{ print $1}' | cut -d'%' -f1 ) +USED_RESOURCES=$(echo $_RESOURCES | awk '{ print $1}' | cut -d'%' -f1 ) +log_message "======================= data_persist ${USED}% used ===========================" +log_message "======================== rootfs ${USED_ROOTFS}% used =========================" +log_message "====================== resources ${USED_RESOURCES}% used =====================" + +if [ $USED -ge 80 ] +then + rm -f /tmp/mnt/data_persist/log/dumps/*.bz2 log_message "=== Over 80% Used Delete Dump Files ===" fi -log_message "=========************ END PRE-INSTALL OPERATIONS ***************=========" -log_message " " - +if [ $USED_ROOTFS -ge 95 ] +then + show_message "=== WARNING: ROOT FILESYSTEM OVER 95% FULL!! ===" + log_message "=== WARNING: ROOT FILESYSTEM OVER 95% FULL!! ===" + APPS2RESOURCES=1 +fi +# mount resources +mount -o rw,remount /tmp/mnt/resources/ +log_message "=== Remounted /tmp/mnt/resources ===" +if [ $APPS2RESOURCES -eq 1 ] +then + # set installation location for AIO apps + AIO_APP_DIR="/tmp/mnt/resources/aio/apps" + sleep 2 + [ -e ${AIO_APP_DIR} ] || mkdir -p ${AIO_APP_DIR} + log_message "=== App Install Locatiation set to resources ===" +fi # start JSON array of backups if [ $KEEPBKUPS -eq 1 ] then aio_info '"Backups": [' fi +log_message "=========************ END PRE-INSTALL OPERATIONS ***************=========" +log_message " " diff --git a/app/files/tweaks/00_storage-i.txt b/app/files/tweaks/00_storage-i.txt new file mode 100644 index 0000000..9f64241 --- /dev/null +++ b/app/files/tweaks/00_storage-i.txt @@ -0,0 +1,26 @@ +# modify opera storage and move to persistant data +if [ ! -e /tmp/mnt/data_persist/storage ] +then + mkdir -p /tmp/mnt/data_persist/storage + log_message "=== Created Storage Folder ===" +else + log_message "=== Storage Folder Present ===" +fi + +if [ ! -e /jci/opera/opera_home/pstorage/psindex.dat.org ] +then + # check if system file exists + if [ -e /jci/opera/opera_home/pstorage/psindex.dat ] + then + # make a copy + cp -a /jci/opera/opera_home/pstorage/psindex.dat /jci/opera/opera_home/pstorage/psindex.dat.org + else + # create directory + mkdir -p /jci/opera/opera_home/pstorage/ + fi + # copy psindex file + cp -a ${MYDIR}/casdk/storage/psindex.dat /jci/opera/opera_home/pstorage/ + log_message "=== Copied psindex.dat file ===" +else + log_message "=== Persistant Storage Already Modified ===" +fi diff --git a/app/files/tweaks/00_storage-u.txt b/app/files/tweaks/00_storage-u.txt new file mode 100644 index 0000000..0466481 --- /dev/null +++ b/app/files/tweaks/00_storage-u.txt @@ -0,0 +1,20 @@ +# reset storage +if [ -e /jci/opera/opera_home/pstorage/psindex.dat ] +then + if [ -f /jci/opera/opera_home/pstorage/psindex.dat.org ] + then + log_message "=== Reverting localStorage Settings ===" + cp -a /jci/opera/opera_home/pstorage/psindex.dat.org /jci/opera/opera_home/pstorage/psindex.dat + rm /jci/opera/opera_home/pstorage/psindex.dat.org + else + log_message "=== Removing localStorage Settings & pstorage ===" + rm -rf /jci/opera/opera_home/pstorage + if [ -e /tmp/mnt/data_persist/storage ] + then + log_message "=== Removing Storage Folder ===" + rm -rf /tmp/mnt/data_persist/storage + else + log_message "=== Storage Folder Not Present ===" + fi + fi +fi diff --git a/app/files/tweaks/00_wifi.txt b/app/files/tweaks/00_wifi.txt index f7f2b40..33f0db9 100644 --- a/app/files/tweaks/00_wifi.txt +++ b/app/files/tweaks/00_wifi.txt @@ -18,7 +18,6 @@ then cp /jci/gui/apps/syssettings/js/syssettingsApp.js "${MYDIR}/bakups/test/syssettingsApp_WIFI-after.js" else log_message "=== Wifi already active ===" - fi log_message "===============************* END ENABLE WIFI *************===============" diff --git a/app/files/tweaks/02_disclaimer-i.txt b/app/files/tweaks/02_disclaimer-i.txt index 07d42df..1f9ea5d 100644 --- a/app/files/tweaks/02_disclaimer-i.txt +++ b/app/files/tweaks/02_disclaimer-i.txt @@ -25,12 +25,12 @@ fi # 58.00.XXX - 59.00.XXX ($COMPAT_GROUP=2-5) # 55.XX.XXX - 56.XX.XXX ($COMPAT_GROUP=1) # If your firmware version falls out of those ranges email the address below -if [ ! $TRACKORDER_DISCLAIMER -eq 2 ] +if [ $TRACKORDER_DISCLAIMER -ne 2 ] then cp -a "${MYDIR}/config/audio_order_AND_no_More_Disclaimer/systemApp.js.disclaimer" /jci/gui/apps/system/js/ log_message "=== Added marker 'systemApp.js.disclaimer' ===" - if [ -e /jci/gui/apps/system/js/systemApp.js.audio ] && grep -q "^var FmRadioPos" /jci/gui/apps/system/js/systemApp.js.audio + if [ -e /jci/gui/apps/system/js/systemApp.js.audio ] && grep -q "^var aaAudioPos" /jci/gui/apps/system/js/systemApp.js.audio then if [ $TRACKORDER_DISCLAIMER -eq 1 ] then @@ -61,7 +61,7 @@ else fi if [ $TESTBKUPS = 1 ] then - cp -a /jci/gui/apps/system/js/systemApp.js "${MYDIR}/bakups/test/systemApp_after-disclaimer.js" + cp /jci/gui/apps/system/js/systemApp.js "${MYDIR}/bakups/test/systemApp_after-disclaimer.js" fi log_message "=====*********** END INSTALLATION OF NO-MORE-DISCLAIMER ***********======" diff --git a/app/files/tweaks/02_disclaimer-u.txt b/app/files/tweaks/02_disclaimer-u.txt index fc60f0f..05d0a92 100644 --- a/app/files/tweaks/02_disclaimer-u.txt +++ b/app/files/tweaks/02_disclaimer-u.txt @@ -24,27 +24,21 @@ fi # 58.00.XXX - 59.00.XXX ($COMPAT_GROUP=2-5) # 55.XX.XXX - 56.XX.XXX ($COMPAT_GROUP=1) -if [ $TRACKORDER_DISCLAIMER -ne 2 ] && [ -e /jci/gui/apps/system/js/systemApp.js.audio ] && grep -q "^var FmRadioPos" /jci/gui/apps/system/js/systemApp.js.audio +if [ $TRACKORDER_DISCLAIMER -ne 2 ] && [ -e /jci/gui/apps/system/js/systemApp.js.audio ] && grep -q "^var aaAudioPos" /jci/gui/apps/system/js/systemApp.js.audio then if [ $TRACKORDER_DISCLAIMER -eq 1 ] then - #cp -a "${MYDIR}/config/audio_order_AND_no_More_Disclaimer/only_change_audio_order/jci/gui/apps/system/js/systemApp.${TRACKORDER_DISCLAIMER_FILE}.js" /jci/gui/apps/system/js/systemApp.js cat /jci/gui/apps/system/js/systemApp.js.audio "${MYDIR}/config/audio_order_AND_no_More_Disclaimer/only_change_audio_order/jci/gui/apps/system/js/systemApp.${TRACKORDER_DISCLAIMER_FILE}.js" > /jci/gui/apps/system/js/systemApp.js log_message "=== Restored Disclaimer for ${CMU_SW_VER}, audio order still changed ===" else #[ $TRACKORDER_DISCLAIMER -eq 0 ] - #cp -a "${MYDIR}/config/audio_order_AND_no_More_Disclaimer/only_change_audio_order/jci/gui/apps/system/js/systemApp.js" /jci/gui/apps/system/js/ cat /jci/gui/apps/system/js/systemApp.js.audio "${MYDIR}/config/audio_order_AND_no_More_Disclaimer/only_change_audio_order/jci/gui/apps/system/js/systemApp.js" > /jci/gui/apps/system/js/systemApp.js log_message "=== Restored Disclaimer, audio order still changed ===" fi -elif [ -e /jci/gui/apps/system/js/systemApp.js.org ] +elif ! (restore_org /jci/gui/apps/system/js/systemApp.js) then - cp -a /jci/gui/apps/system/js/systemApp.js.org /jci/gui/apps/system/js/systemApp.js - log_message "=== Restored systemApp.js from backup ===" -else - log_message "=== No Compatible systemApp.js found ===" + log_message "=== No Backup of systemApp.js found ===" fi rm -f /jci/gui/apps/system/js/systemApp.js.disclaimer log_message "=== Removed /jci/gui/apps/system/js/systemApp.js.disclaimer ===" - log_message "=======****** END UNINSTALLATION OF NO-MORE-DISCLAIMER ... *******=======" log_message " " diff --git a/app/files/tweaks/05_mainloop-i.txt b/app/files/tweaks/05_mainloop-i.txt index 194afa5..adf77d8 100644 --- a/app/files/tweaks/05_mainloop-i.txt +++ b/app/files/tweaks/05_mainloop-i.txt @@ -1,7 +1,7 @@ backup_org /jci/gui/apps/system/controls/MainMenu/js/MainMenuCtrl.js # main menu loop show_message "INSTALL MAIN_MENU_LOOP ..." -log_message "=====******* INSTALL MAIN_MENU_LOOP ... *******=====" +log_message "=====***************** INSTALL MAIN_MENU_LOOP ... *****************=====" if [ $COMPAT_GROUP -le 6 ] then diff --git a/app/files/tweaks/05_mainloop-u.txt b/app/files/tweaks/05_mainloop-u.txt index eff0fee..8ea228d 100644 --- a/app/files/tweaks/05_mainloop-u.txt +++ b/app/files/tweaks/05_mainloop-u.txt @@ -2,17 +2,11 @@ show_message "REMOVE MAIN-MENU-LOOP ..." log_message "=========************* UNINSTALL MAIN-MENU-LOOP ... ************=========" -# IF Backup is available, we are done -if [ -e /jci/gui/apps/system/controls/MainMenu/js/MainMenuCtrl.js.org ] +if ! (restore_org /jci/gui/apps/system/controls/MainMenu/js/MainMenuCtrl.js) then - cp /jci/gui/apps/system/controls/MainMenu/js/MainMenuCtrl.js.org /jci/gui/apps/system/controls/MainMenu/js/MainMenuCtrl.js - log_message "=== Restored Original MainMenuCtrl.js From Backup ===" -else - log_message "=== No backup of MainMenuCtrl.js available, no changes were made ===" - # if you need the fallback file, uncomment the next line - # cp -a "${MYDIR}/config_org/main-menu-loop/jci/gui/apps/system/controls/MainMenu/js/MainMenuCtrl.js" /jci/gui/apps/system/controls/MainMenu/js/ - # log_message "=== Copied /jci/gui/apps/system/controls/MainMenu/js/MainMenuCtrl.js from USB Drive ===" + log_message "=== No Backup of MainMenuCtrl.js found ===" fi + log_message "======*********** END UNINSTALLATION OF MAIN-MENU-LOOP ***********=======" log_message " " diff --git a/app/files/tweaks/06_listloop-i.txt b/app/files/tweaks/06_listloop-i.txt index cc7549f..bc252fc 100644 --- a/app/files/tweaks/06_listloop-i.txt +++ b/app/files/tweaks/06_listloop-i.txt @@ -15,7 +15,7 @@ then SHORTER_DELAY_MOD=1 fi -# NO MORE COMPATIBILITY CHECK NEEDED - UNIVERSAL COMPATIBILITY FROM v55 - v70.00.000 +# NO MORE COMPATIBILITY CHECK NEEDED - UNIVERSAL COMPATIBILITY FROM v55 - v70.00.021 # v70.00.100+ will not install mod/needs verification of compatibility if [ $COMPAT_GROUP -le 6 ] then diff --git a/app/files/tweaks/06_listloop-u.txt b/app/files/tweaks/06_listloop-u.txt index 88ce5f8..05a4c65 100644 --- a/app/files/tweaks/06_listloop-u.txt +++ b/app/files/tweaks/06_listloop-u.txt @@ -5,61 +5,26 @@ log_message "========********* UNINSTALL LIST_LOOP_MOD ... ********=== grep -Fq "No More Beep" /jci/gui/common/controls/List2/js/List2Ctrl.js && REMOVE_BEEP=1 || REMOVE_BEEP=0 grep -Fq "Shorter Delay Mod" /jci/gui/common/controls/List2/js/List2Ctrl.js && SHORTER_DELAY_MOD=1 || SHORTER_DELAY_MOD=0 -# If Backup is available, then we are done. -if [ -e /jci/gui/common/controls/List2/js/List2Ctrl.js.org ] -then - cp /jci/gui/common/controls/List2/js/List2Ctrl.js.org /jci/gui/common/controls/List2/js/List2Ctrl.js - log_message "=== Original List2Ctrl.js is available as backup ===" -else - # Fallback check, Only those who have never installed this tweak with AIO will reach this case - # Just in case it is needed, you have to remove the comments below to copy the fallback files - TRACKORDER_LIST=0 - # Compatibility Check - log_message "=== FW ${CMU_SW_VER} detected, copy matching List2Ctrl.js ===" - if [ $COMPAT_GROUP -eq 4 ] - then - TRACKORDER_LIST=1 - TRACKORDER_LIST_FILE="59" - elif [ $COMPAT_GROUP -eq 3 ] - then - TRACKORDER_LIST=1 - TRACKORDER_LIST_FILE="59.330" - elif [ $COMPAT_GROUP -eq 2 ] - then - TRACKORDER_LIST=1 - TRACKORDER_LIST_FILE="58" - fi - if [ $COMPAT_GROUP -eq 1 ] - then - # Uncomment the following line if you need the fallback file (v55-56) - # cp -a "${MYDIR}/config_org/list-loop/jci/gui/common/controls/List2/js/List2Ctrl.js" /jci/gui/common/controls/List2/js/ - log_message "=== No backup of List2Ctrl.js available, No changes were made ===" - elif [ $TRACKORDER_LIST -eq 1 ] - then - # Uncomment the following line if you need the fallback file (v58+) - # cp -a "${MYDIR}/config_org/list-loop/jci/gui/common/controls/List2/js/List2Ctrl.${TRACKORDER_LIST_FILE}.js" /jci/gui/common/controls/List2/js/List2Ctrl.js - # log_message "=== Restored List2Ctrl.js for ${CMU_SW_VER} from SD card ===" - log_message "=== No backup of List2Ctrl.js available, No changes were made ===" - else - log_message "=== No backup of List2Ctrl.js available, No changes were made ===" - # log_message "=== No List2Ctrl.js found for ${CMU_SW_VER} ===" - fi -fi -# Reapply tweaks -if [ $REMOVE_BEEP -eq 1 ] +if (restore_org /jci/gui/common/controls/List2/js/List2Ctrl.js) then - sed -i 's/return framework.common.beep(pressType, eventCause);/\/\/ return framework.common.beep(pressType, eventCause); \/\/No More Beeps/g' /jci/gui/common/controls/List2/js/List2Ctrl.js - log_message "=== Reapplied Disable Beeps in List2Ctrl.js ===" -fi -if [ $SHORTER_DELAY_MOD -eq 1 ] -then - sed -i 's/autoscrollTier1Timeout : 1500,/autoscrollTier1Timeout : 150,/g' /jci/gui/common/controls/List2/js/List2Ctrl.js - sed -i 's/autoscrollTier2Timeout : 5000,/autoscrollTier2Timeout : 300,/g' /jci/gui/common/controls/List2/js/List2Ctrl.js - sed -i 's/autoscrollTier1Interval : 500,/autoscrollTier1Interval : 200,/g' /jci/gui/common/controls/List2/js/List2Ctrl.js - sed -i 's/autoscrollTier2Interval : 1000,/autoscrollTier2Interval : 300,/g' /jci/gui/common/controls/List2/js/List2Ctrl.js - sed -i '/autoscrollTier2Interval : 300,/ a\ \/\/Shorter Delay Mod' /jci/gui/common/controls/List2/js/List2Ctrl.js - log_message "=== Modified Delay in List2Ctrl.js ===" + # Reapply tweaks + if [ $REMOVE_BEEP -eq 1 ] + then + sed -i 's/return framework.common.beep(pressType, eventCause);/\/\/ return framework.common.beep(pressType, eventCause); \/\/No More Beeps/g' /jci/gui/common/controls/List2/js/List2Ctrl.js + log_message "=== Reapplied Disable Beeps in List2Ctrl.js ===" + fi + if [ $SHORTER_DELAY_MOD -eq 1 ] + then + sed -i 's/autoscrollTier1Timeout : 1500,/autoscrollTier1Timeout : 150,/g' /jci/gui/common/controls/List2/js/List2Ctrl.js + sed -i 's/autoscrollTier2Timeout : 5000,/autoscrollTier2Timeout : 300,/g' /jci/gui/common/controls/List2/js/List2Ctrl.js + sed -i 's/autoscrollTier1Interval : 500,/autoscrollTier1Interval : 200,/g' /jci/gui/common/controls/List2/js/List2Ctrl.js + sed -i 's/autoscrollTier2Interval : 1000,/autoscrollTier2Interval : 300,/g' /jci/gui/common/controls/List2/js/List2Ctrl.js + sed -i '/autoscrollTier2Interval : 300,/ a\ \/\/Shorter Delay Mod' /jci/gui/common/controls/List2/js/List2Ctrl.js + log_message "=== Modified Delay in List2Ctrl.js ===" + fi +else + log_message "=== No backup of List2Ctrl.js available, No changes were made ===" fi log_message "=====******** END UNINSTALLATION OF LIST_LOOP_MOD *******======" log_message " " diff --git a/app/files/tweaks/08_orderflac-i.txt b/app/files/tweaks/08_orderflac-i.txt index 5746488..1639c3a 100644 --- a/app/files/tweaks/08_orderflac-i.txt +++ b/app/files/tweaks/08_orderflac-i.txt @@ -1,78 +1,81 @@ -backup_org /jci/lib/libmc_user.so -# track-order and FLAC support -show_message "INSTALL TRACK-ORDER AND FLAC SUPPORT ..." -log_message "=======******** INSTALL TRACK-ORDER AND FLAC SUPPORT ... *********=======" - -TRACKORDER_FLAC=0 -if [ "${CMU_SW_VER}" == "56.00.100A-ADR" ] \ -|| [ "${CMU_SW_VER}" == "56.00.240B-ADR" ] \ -|| [ "${CMU_SW_VER}" == "56.00.230A-EU" ] \ -|| [ "${CMU_SW_VER}" == "55.00.650A-NA" ] \ -|| [ "${CMU_SW_VER}" == "55.00.753A-NA" ] \ -|| [ "${CMU_SW_VER}" == "55.00.760A-NA" ] -then - TRACKORDER_FLAC=1 - TRACKORDER_FLAC_FILE=230A-EU -fi -if [ "${CMU_SW_VER}" == "56.00.511A-EU" ] \ -|| [ "${CMU_SW_VER}" == "56.00.512A-EU" ] \ -|| [ "${CMU_SW_VER}" == "58.00.250A-NA" ] \ -|| [ "${CMU_SW_VER}" == "56.00.513C-EU" ] \ -|| [ "${CMU_SW_VER}" == "56.00.513B-EU" ] \ -|| [ "${CMU_SW_VER}" == "56.00.513C-ADR" ] \ -|| [ "${CMU_SW_VER}" == "56.00.521A-NA" ] +if [ $COMPAT_GROUP -lt 5 ] then - TRACKORDER_FLAC=1 - TRACKORDER_FLAC_FILE=511A-EU -elif [ "${CMU_SW_VER}" == "59.00.326A-ADR" ] \ -|| [ "${CMU_SW_VER}" == "59.00.330A-ADR" ] \ -|| [ "${CMU_SW_VER}" == "59.00.342A-ADR" ] \ -|| [ "${CMU_SW_VER}" == "59.00.441A-NA" ] \ -|| [ "${CMU_SW_VER}" == "59.00.443C-EU" ] \ -|| [ "${CMU_SW_VER}" == "59.00.331A-EU" ] -then - TRACKORDER_FLAC=1 - TRACKORDER_FLAC_FILE=326A-ADR -fi - -if [ ! -e /tmp/mnt/data_persist/dev/bin/autorun ] -then - cp -a ${MYDIR}/config/media-order-patching/data_persist/* /tmp/mnt/data_persist/ - log_message "=== Install autorun script in case USB ports fail after install ===" -fi -cp -a ${MYDIR}/config/media-order-patching/data_persist/dev/bin/flac-usb-recovery /tmp/mnt/data_persist/dev/bin -log_message "=== copy flac-usb-recovery if it is needed can be run via SSH ===" -chmod +x /tmp/mnt/data_persist/dev/bin/* + backup_org /jci/lib/libmc_user.so + # track-order and FLAC support + show_message "INSTALL TRACK-ORDER AND FLAC SUPPORT ..." + log_message "=======******** INSTALL TRACK-ORDER AND FLAC SUPPORT ... *********=======" + TRACKORDER_FLAC=0 + if [ "${CMU_SW_VER}" = "56.00.100A-ADR" ] \ + || [ "${CMU_SW_VER}" = "56.00.240B-ADR" ] \ + || [ "${CMU_SW_VER}" = "56.00.230A-EU" ] \ + || [ "${CMU_SW_VER}" = "55.00.650A-NA" ] \ + || [ "${CMU_SW_VER}" = "55.00.753A-NA" ] \ + || [ "${CMU_SW_VER}" = "55.00.760A-NA" ] + then + TRACKORDER_FLAC=1 + TRACKORDER_FLAC_FILE=230A-EU + fi + if [ "${CMU_SW_VER}" = "56.00.511A-EU" ] \ + || [ "${CMU_SW_VER}" = "56.00.512A-EU" ] \ + || [ "${CMU_SW_VER}" = "58.00.250A-NA" ] \ + || [ "${CMU_SW_VER}" = "56.00.513C-EU" ] \ + || [ "${CMU_SW_VER}" = "56.00.513B-EU" ] \ + || [ "${CMU_SW_VER}" = "56.00.513C-ADR" ] \ + || [ "${CMU_SW_VER}" = "56.00.521A-NA" ] + then + TRACKORDER_FLAC=1 + TRACKORDER_FLAC_FILE=511A-EU + elif [ "${CMU_SW_VER}" = "59.00.326A-ADR" ] \ + || [ "${CMU_SW_VER}" = "59.00.330A-ADR" ] \ + || [ "${CMU_SW_VER}" = "59.00.342A-ADR" ] \ + || [ "${CMU_SW_VER}" = "59.00.441A-NA" ] \ + || [ "${CMU_SW_VER}" = "59.00.443C-EU" ] \ + || [ "${CMU_SW_VER}" = "59.00.331A-EU" ] + then + TRACKORDER_FLAC=1 + TRACKORDER_FLAC_FILE=326A-ADR + fi -if [ $TRACKORDER_FLAC -eq 0 ] -then - log_message "=== Your firmware ${CMU_SW_VER} is not compatible with this tweak ===" -else - if [ $TRACKORDER_FLAC -eq 1 ] + if [ ! -e /tmp/mnt/data_persist/dev/bin/autorun ] then - cp -a ${MYDIR}/config/media-order-patching/jci/lib/libmc_user.${TRACKORDER_FLAC_FILE}.so /jci/lib/libmc_user.so - cp -a ${MYDIR}/config/media-order-patching/usr/lib/gstreamer-0.10/libgstflac.so /usr/lib/gstreamer-0.10 - cp -a ${MYDIR}/config/media-order-patching/usr/lib/libFLAC.so.8.3.0 /usr/lib - log_message "=== Detected ${CMU_SW_VER}: Copied fitting patched /jci/lib/libmc_user.so ===" - /bin/fsync /jci/lib/libmc_user.so + cp -a ${MYDIR}/config/media-order-patching/data_persist/* /tmp/mnt/data_persist/ + log_message "=== Install autorun script in case USB ports fail after install ===" fi + #cp -a ${MYDIR}/config/media-order-patching/data_persist/dev/bin/flac-usb-recovery /tmp/mnt/data_persist/dev/bin + #log_message "=== copy flac-usb-recovery if it is needed can be run via SSH ===" + chmod +x /tmp/mnt/data_persist/dev/bin/* - status=`md5sum -c ${MYDIR}/config/media-order-patching/jci/lib/checksum.${TRACKORDER_FLAC_FILE}.md5 2>&1 | grep FAILED` - if [[ $? -ne 1 ]] + + if [ $TRACKORDER_FLAC -eq 0 ] then - cp -a /jci/lib/libmc_user.so.org /jci/lib/libmc_user.so - /bin/fsync /jci/lib/libmc_user.so - log_message "=== Copying failed. Restoring original library from backup! ===" + log_message "=== Your firmware ${CMU_SW_VER} is not compatible with this tweakFLAC support tweak ===" else - log_message "=== Checksum of libmc_user.so OK. copy success ===" - fi + if [ $TRACKORDER_FLAC -eq 1 ] + then + cp -a ${MYDIR}/config/media-order-patching/jci/lib/libmc_user.${TRACKORDER_FLAC_FILE}.so /jci/lib/libmc_user.so + cp -a ${MYDIR}/config/media-order-patching/usr/lib/gstreamer-0.10/libgstflac.so /usr/lib/gstreamer-0.10 + cp -a ${MYDIR}/config/media-order-patching/usr/lib/libFLAC.so.8.3.0 /usr/lib + log_message "=== Detected ${CMU_SW_VER}: Copied fitting patched /jci/lib/libmc_user.so ===" + /bin/fsync /jci/lib/libmc_user.so + fi - chmod 755 /jci/lib/libmc_user.so - chmod 755 /usr/lib/gstreamer-0.10/libgstflac.so - chmod 755 /usr/lib/libFLAC.so.8.3.0 - ln -s /usr/lib/libFLAC.so.8.3.0 /usr/lib/libFLAC.so.8 - log_message "=== Chmod FLAC support files ===" + status=`md5sum -c ${MYDIR}/config/media-order-patching/jci/lib/checksum.${TRACKORDER_FLAC_FILE}.md5 2>&1 | grep FAILED` + if [[ $? -ne 1 ]] + then + cp -a /jci/lib/libmc_user.so.org /jci/lib/libmc_user.so + /bin/fsync /jci/lib/libmc_user.so + log_message "=== Copying failed. Restoring original library from backup! ===" + else + log_message "=== Checksum of libmc_user.so OK. copy success ===" + fi + + chmod 755 /jci/lib/libmc_user.so + chmod 755 /usr/lib/gstreamer-0.10/libgstflac.so + chmod 755 /usr/lib/libFLAC.so.8.3.0 + ln -s /usr/lib/libFLAC.so.8.3.0 /usr/lib/libFLAC.so.8 + log_message "=== Chmod FLAC support files ===" + fi + log_message "======****** END INSTALLATION OF TRACK-ORDER AND FLAC SUPPORT ******=====" + log_message " " fi -log_message "======****** END INSTALLATION OF TRACK-ORDER AND FLAC SUPPORT ******=====" -log_message " " diff --git a/app/files/tweaks/08_orderflac-u.txt b/app/files/tweaks/08_orderflac-u.txt index defd49e..c42a963 100644 --- a/app/files/tweaks/08_orderflac-u.txt +++ b/app/files/tweaks/08_orderflac-u.txt @@ -1,20 +1,23 @@ -# remove track-order and FLAC support -show_message "REMOVE TRACK-ORDER AND FLAC SUPPORT ..." -log_message "=======******* UNINSTALL TRACK-ORDER AND FLAC SUPPORT *******========" - -if [ -e /jci/lib/libmc_user.so.org ] +if [ $COMPAT_GROUP -lt 5 ] then - cp -a /jci/lib/libmc_user.so.org /jci/lib/libmc_user.so - /bin/fsync /jci/lib/libmc_user.so - log_message "=== Restored original /jci/lib/libmc_user.so from libmc_user.so.org ===" -fi + # remove track-order and FLAC support + show_message "REMOVE TRACK-ORDER AND FLAC SUPPORT ..." + log_message "=======******* UNINSTALL TRACK-ORDER AND FLAC SUPPORT *******========" -chmod 755 /jci/lib/libmc_user.so -rm -f /usr/lib/gstreamer-0.10/libgstflac.so -rm -f /usr/lib/libFLAC.so.8.3.0 -rm -f /usr/lib/libFLAC.so.8 -rm -f /tmp/mnt/data_persist/dev/bin/flac-usb-recovery -log_message "=== Removed FLAC support files ===" + if [ -e /jci/lib/libmc_user.so.org ] + then + cp -a /jci/lib/libmc_user.so.org /jci/lib/libmc_user.so + /bin/fsync /jci/lib/libmc_user.so + log_message "=== Restored original /jci/lib/libmc_user.so from libmc_user.so.org ===" + fi -log_message "======***** END UNINSTALLATION OF TRACK-ORDER AND FLAC SUPPORT ****======" -log_message " " + chmod 755 /jci/lib/libmc_user.so + rm -f /usr/lib/gstreamer-0.10/libgstflac.so + rm -f /usr/lib/libFLAC.so.8.3.0 + rm -f /usr/lib/libFLAC.so.8 + rm -f /tmp/mnt/data_persist/dev/bin/flac-usb-recovery + log_message "=== Removed FLAC support files ===" + + log_message "======***** END UNINSTALLATION OF TRACK-ORDER AND FLAC SUPPORT ****======" + log_message " " +fi diff --git a/app/files/tweaks/09_audioorder-i.txt b/app/files/tweaks/09_audioorder-i.txt index b7cc0f2..623551c 100644 --- a/app/files/tweaks/09_audioorder-i.txt +++ b/app/files/tweaks/09_audioorder-i.txt @@ -23,7 +23,7 @@ fi # 70.00.XXX ($COMPAT_GROUP=6) # 58.00.XXX - 59.00.XXX ($COMPAT_GROUP=2-5) # 55.XX.XXX - 56.XX.XXX ($COMPAT_GROUP=1) -if [ ! $TRACKORDER_AUDIO -eq 2 ] +if [ $TRACKORDER_AUDIO -ne 2 ] then cp -a "${MYDIR}/config/audio_order_AND_no_More_Disclaimer/systemApp.js.audio" /jci/gui/apps/system/js/ log_message "=== Added marker 'systemApp.js.audio' ===" @@ -32,22 +32,18 @@ then then if [ $TRACKORDER_AUDIO -eq 1 ] then - #cp -a "${MYDIR}/config/audio_order_AND_no_More_Disclaimer/systemApp.js.audio" /jci/gui/apps/system/js/ cat "${MYDIR}/config/audio_order_AND_no_More_Disclaimer/systemApp.js.audio" "${MYDIR}/config/audio_order_AND_no_More_Disclaimer/both/jci/gui/apps/system/js/systemApp.${TRACKORDER_AUDIO_FILE}.js" > /jci/gui/apps/system/js/systemApp.js log_message "=== Changed order of audio source list, disclaimer still gone ===" else - #cp -a "${MYDIR}/config/audio_order_AND_no_More_Disclaimer/systemApp.js.audio" /jci/gui/apps/system/js/systemApp.js cat "${MYDIR}/config/audio_order_AND_no_More_Disclaimer/systemApp.js.audio" "${MYDIR}/config/audio_order_AND_no_More_Disclaimer/both/jci/gui/apps/system/js/systemApp.js" > /jci/gui/apps/system/js/systemApp.js log_message "=== Changed order of audio source list, disclaimer still gone ===" fi else if [ $TRACKORDER_AUDIO -eq 1 ] then - #cp -a "${MYDIR}/config/audio_order_AND_no_More_Disclaimer/systemApp.js.audio" /jci/gui/apps/system/js/ cat "${MYDIR}/config/audio_order_AND_no_More_Disclaimer/systemApp.js.audio" "${MYDIR}/config/audio_order_AND_no_More_Disclaimer/only_change_audio_order/jci/gui/apps/system/js/systemApp.${TRACKORDER_AUDIO_FILE}.js" > /jci/gui/apps/system/js/systemApp.js log_message "=== Changed order of audio source list (no no-more-disclaimer) ===" else - #cp -a "${MYDIR}/config/audio_order_AND_no_More_Disclaimer/only_change_audio_order/jci/gui/apps/system/js/systemApp.js" /jci/gui/apps/system/js/systemApp.js cat "${MYDIR}/config/audio_order_AND_no_More_Disclaimer/systemApp.js.audio" "${MYDIR}/config/audio_order_AND_no_More_Disclaimer/only_change_audio_order/jci/gui/apps/system/js/systemApp.js" > /jci/gui/apps/system/js/systemApp.js log_message "=== Changed order of audio source list (no no-more-disclaimer) ===" fi @@ -61,7 +57,7 @@ else fi if [ $TESTBKUPS -eq 1 ] then - cp -a /jci/gui/apps/system/js/systemApp.js "${MYDIR}/bakups/test/systemApp_after-audiosources.js" + cp /jci/gui/apps/system/js/systemApp.js "${MYDIR}/bakups/test/systemApp_after-audiosources.js" fi log_message "====****** END INSTALLATION OF ORDER OF THE AUDIO SOURCE LIST ******=====" log_message " " diff --git a/app/files/tweaks/09_audioorder-u.txt b/app/files/tweaks/09_audioorder-u.txt index 0ebe67c..493d683 100644 --- a/app/files/tweaks/09_audioorder-u.txt +++ b/app/files/tweaks/09_audioorder-u.txt @@ -33,15 +33,11 @@ then cp -a ${MYDIR}/config/audio_order_AND_no_More_Disclaimer/only_no_More_Disclaimer/jci/gui/apps/system/js/systemApp.js /jci/gui/apps/system/js/ log_message "=== Restored order of audio source list, disclaimer still gone ===" fi -elif [ -e /jci/gui/apps/system/js/systemApp.js.org ] +elif ! (restore_org /jci/gui/apps/system/js/systemApp.js) then - cp -a /jci/gui/apps/system/js/systemApp.js.org /jci/gui/apps/system/js/systemApp.js - log_message "=== Restored systemApp.js from backup ===" -else - log_message "=== No Compatible systemApp.js found ===" + log_message "=== No Backup of systemApp.js found ===" fi rm -f /jci/gui/apps/system/js/systemApp.js.audio log_message "=== Removed /jci/gui/apps/system/js/systemApp.js.audio ===" -log_message "=== End restoring order of the audio source list to original ===" log_message "========******** END UNINSTALLATION OF AUDIO SOURCE LIST ********========" log_message " " diff --git a/app/files/tweaks/10_pausemute-i.txt b/app/files/tweaks/10_pausemute-i.txt index 06ef2b7..6a49a40 100644 --- a/app/files/tweaks/10_pausemute-i.txt +++ b/app/files/tweaks/10_pausemute-i.txt @@ -9,6 +9,10 @@ if grep -Fq 'isMuted ? "Global.Pause" : "Global.Resume"' /jci/gui/common/js/Comm || grep -Fq 'AIO Pause on Mute' /jci/gui/common/js/Common.js then log_message "=== Pause On Mute Mod is already installed ===" +elif [ $COMPAT_GROUP -gt 5 ] +then + log_message "=== Pause On Mute is included in v70+ ===" + show_message "PAUSE_ON_MUTE IS NOT COMPATIBLE WITH v70+ ..." else # Add this one line of code that does the magic sed -i '/this._isMutedChanged();/ a\ framework.sendEventToMmui("Common", isMuted ? "Global.Pause" : "Global.Resume"); //AIO Pause on Mute ~Trez' /jci/gui/common/js/Common.js diff --git a/app/files/tweaks/10_pausemute-u.txt b/app/files/tweaks/10_pausemute-u.txt index a820971..695c506 100644 --- a/app/files/tweaks/10_pausemute-u.txt +++ b/app/files/tweaks/10_pausemute-u.txt @@ -10,12 +10,8 @@ then # Looks for this line of code that doesnt exist in the original file for installations prior to AIO v2.1 elif grep -Fq 'isMuted ? "Global.Pause" : "Global.Resume"' /jci/gui/common/js/Common.js then - # If Backup is Available then we're done - if [ -e /jci/gui/common/js/Common.js.org ] + if ! (restore_org /jci/gui/common/js/Common.js) then - cp -a /jci/gui/common/js/Common.js.org /jci/gui/common/js/Common.js - log_message "=== Common.js Restored From Original Backup ===" - else log_message "=== No Suitable Backup Available! No Changes Were Made to Common.js. ===" fi else diff --git a/app/files/tweaks/11_msgreplies-i.txt b/app/files/tweaks/11_msgreplies-i.txt index ec475d5..b07f330 100644 --- a/app/files/tweaks/11_msgreplies-i.txt +++ b/app/files/tweaks/11_msgreplies-i.txt @@ -1,17 +1,17 @@ backup_org /jci/settings/configurations/blm_msg-system.xml # Remove Message Replies # To Apply This Tweak You Must Perform A Factory Reset After Installing -show_message "REMOVE MESSAGE REPLIES ...\n\nNOTE: TO APPLY REMOVE MESSAGE REPLIES TWEAK\nYOU MUST PREFORM 'RESTORE ALL FACTORY SETTINGS'" +show_message "REMOVE MESSAGE REPLIES ...\nNOTE: TO APPLY REMOVE MESSAGE REPLIES TWEAK\nYOU MUST PREFORM 'RESTORE ALL FACTORY SETTINGS'" log_message "========************ INSTALL REMOVE MESSAGE REPLIES ... **********=======" -cp -a ${MYDIR}/config/message_replies/jci/settings/configurations/blm_msg-system.xml /jci/settings/configurations +cp -a ${MYDIR}/config/message_replies/jci/settings/configurations/* /jci/settings/configurations log_message "=== Copied /jci/settings/configurations/blm_msg-system.xml ===" sleep 6 -# Remove input_filter to prevent bootloop on factory reset +# Remove input_filter to prevent bootloop on factory reset just in case if grep -Fq "input_filter" /jci/sm/sm.conf then - sed -i '/input_filter/ d' /jci/sm/sm.conf - log_message "=== Clean obsolete input_filter in sm.conf ===" + sed -i '/input_filter/d' /jci/sm/sm.conf + log_message "=== Clean obsolete input_filter in sm.conf ===" fi log_message "=======******* END INSTALLATION OF REMOVE MESSAGE REPLIES ********=======" log_message " " diff --git a/app/files/tweaks/11_msgreplies-u.txt b/app/files/tweaks/11_msgreplies-u.txt index ed37a69..d29868e 100644 --- a/app/files/tweaks/11_msgreplies-u.txt +++ b/app/files/tweaks/11_msgreplies-u.txt @@ -2,16 +2,9 @@ show_message "RESTORE MESSAGE REPLIES ..." log_message "========********** UNINSTALL REMOVE MESSAGE REPLIES ... *********========" -# Backup Available, we're done! -if [ -e /jci/settings/configurations/blm_msg-system.xml.org ] +if ! (restore_org /jci/settings/configurations/blm_msg-system.xml) then - cp -a /jci/settings/configurations/blm_msg-system.xml.org /jci/settings/configurations/blm_msg-system.xml - log_message "=== Message Replies Restored From Backup blm_msg-system.xml.org ===" -else - # Do you really need this fallback file? - # cp -a ${MYDIR}/config_org/message_replies/jci/settings/configurations/blm_msg-system.xml /jci/settings/configurations - # log_message "=== Message Replies Restored - Copied blm_msg-system.xml from USB Drive ===" - log_message "=== No Backup Of blm_msg-system.xml Found ===" + log_message "=== No Backup Of blm_msg-system.xml Found ===" fi log_message "======******** END UNINSTALLATION OF REMOVE MESSAGE REPLIES *********====" diff --git a/app/files/tweaks/12_diag-u.txt b/app/files/tweaks/12_diag-u.txt index ef5eb8f..e648269 100644 --- a/app/files/tweaks/12_diag-u.txt +++ b/app/files/tweaks/12_diag-u.txt @@ -9,7 +9,6 @@ then fi if grep -Fq '"settleTime" : 20000,' /jci/gui/apps/diag/js/diagApp.js then - echo "exist" log_message "=== /jci/gui/apps/diag/js/diagApp.js was not modified ===" else sed -i 's/"settleTime" : 1000,/"settleTime" : 20000,/g' /jci/gui/apps/diag/js/diagApp.js @@ -17,7 +16,6 @@ else fi if grep -Fq '"holdTimeout" : 5000,' /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js then - echo "exist" log_message "=== StatusBarCtrl.js not modified ===" else sed -i 's/"holdTimeout" : 1000,/"holdTimeout" : 5000,/g' /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js @@ -30,15 +28,13 @@ then else log_message "=== /jci/gui/common/js/Common.js was not modified ===" fi -if [ -e /jci/gui/apps/diag/controls/Test/js/TestCtrl.js.org ] +if ! (restore_org /jci/gui/apps/diag/controls/Test/js/TestCtrl.js) then - cp -a /jci/gui/apps/diag/controls/Test/js/TestCtrl.js.org /jci/gui/apps/diag/controls/Test/js/TestCtrl.js - log_message "=== Restored TestCtrl.js From Backup ===" + log_message "=== No Backup of TestCtrl.js was found ===" fi -if [ -e /jci/gui/apps/diag/controls/Test/css/TestCtrl.css.org ] +if ! (restore_org /jci/gui/apps/diag/controls/Test/css/TestCtrl.css) then - cp -a /jci/gui/apps/diag/controls/Test/css/TestCtrl.css.org /jci/gui/apps/diag/controls/Test/css/TestCtrl.css - log_message "=== Restored TestCtrl.css From Backup ===" + log_message "=== No Backup of TestCtrl.css was found ===" fi if [ $TESTBKUPS -eq 1 ] then diff --git a/app/files/tweaks/13_boot-i.txt b/app/files/tweaks/13_boot-i.txt index d248cb1..bd7823e 100644 --- a/app/files/tweaks/13_boot-i.txt +++ b/app/files/tweaks/13_boot-i.txt @@ -1,6 +1,12 @@ -backup_org /jci/resources/LoopLogo.ivf -backup_org /jci/resources/TranLogo.ivf -backup_org /jci/resources/TranLogoEnd.ivf +LOOP_LOGO="/jci/resources/LoopLogo.ivf" +if [ -e /jci/resources/newLoopLogo.ivf ] +then + LOOP_LOGO="/jci/resources/newLoopLogo.ivf" +else + backup_org /jci/resources/TranLogo.ivf + backup_org /jci/resources/TranLogoEnd.ivf +fi +backup_org "$LOOP_LOGO" backup_org /jci/resources/ExitLogo.ivf # Disable Boot Animation show_message "CUSTOMIZE BOOT ANIMATION ..." @@ -8,130 +14,134 @@ log_message "======*********** INSTALL BOOT ANIMATION ... ********** if [ $BOOTLOGO1 -eq 0 ] then - cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogo.ivf" /jci/resources/ - log_message "=== LoopLogo.ivf set to Mazda Logo ===" + cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogo.ivf" "$LOOP_LOGO" + log_message "=== LoopLogo.ivf set to Mazda Logo ===" elif [ $BOOTLOGO1 -eq 1 ] then - cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogoMatrix.ivf" /jci/resources/LoopLogo.ivf - log_message "=== LoopLogo.ivf set to Matrix ===" + cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogoMatrix.ivf" "$LOOP_LOGO" + log_message "=== LoopLogo.ivf set to Matrix ===" elif [ $BOOTLOGO1 -eq 2 ] then - cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogoRace.ivf" /jci/resources/LoopLogo.ivf - log_message "=== LoopLogo.ivf set to Large Mazda Logo ===" + cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogoRace.ivf" "$LOOP_LOGO" + log_message "=== LoopLogo.ivf set to Large Mazda Logo ===" elif [ $BOOTLOGO1 -eq 3 ] then - cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogoFiat.ivf" /jci/resources/LoopLogo.ivf - log_message "=== LoopLogo.ivf set to Fiat Logo ===" + cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogoFiat.ivf" "$LOOP_LOGO" + log_message "=== LoopLogo.ivf set to Fiat Logo ===" elif [ $BOOTLOGO1 -eq 4 ] then - cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogoZ.ivf" /jci/resources/LoopLogo.ivf - log_message "=== LoopLogo.ivf set to MaZda Logo ===" + cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogoZ.ivf" "$LOOP_LOGO" + log_message "=== LoopLogo.ivf set to MaZda Logo ===" elif [ $BOOTLOGO1 -eq 5 ] then - cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogoCinema.ivf" /jci/resources/LoopLogo.ivf - log_message "=== LoopLogo.ivf set to MZD Cinema Loop ===" + cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogoCinema.ivf" "$LOOP_LOGO" + log_message "=== LoopLogo.ivf set to MZD Cinema Loop ===" elif [ $BOOTLOGO1 -eq 6 ] then - cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogoCrissCross.ivf" /jci/resources/LoopLogo.ivf - log_message "=== LoopLogo.ivf set to MZD Criss Cross ===" + cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogoCrissCross.ivf" "$LOOP_LOGO" + log_message "=== LoopLogo.ivf set to MZD Criss Cross ===" elif [ $BOOTLOGO1 -eq 7 ] then - cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogoRace.ivf" /jci/resources/LoopLogo.ivf - log_message "=== LoopLogo.ivf set to MZD Race Loop ===" + cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogoRace.ivf" "$LOOP_LOGO" + log_message "=== LoopLogo.ivf set to MZD Race Loop ===" else - log_message "=== LoopLogo.ivf was not changed ===" + log_message "=== LoopLogo.ivf was not changed ===" fi - -if [ $BOOTLOGO2 -eq 0 ] -then - cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogo.ivf" /jci/resources/TranLogo.ivf - log_message "=== TranLogo.ivf set to Mazda Logo ===" -elif [ $BOOTLOGO2 -eq 1 ] -then - cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogoMatrix.ivf" /jci/resources/TranLogo.ivf - log_message "=== TranLogo.ivf set to Matrix ===" -elif [ $BOOTLOGO2 -eq 2 ] -then - cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogoRace.ivf" /jci/resources/TranLogo.ivf - log_message "=== TranLogo.ivf set to Large Mazda Logo ===" -elif [ $BOOTLOGO2 -eq 3 ] +if [ -e /jci/resources/newLoopLogo.ivf ] then - cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogo124Spider.ivf" /jci/resources/TranLogo.ivf - log_message "=== TranLogo.ivf set to Spider 124 Trans ===" -elif [ $BOOTLOGO2 -eq 4 ] -then - cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogoZ.ivf" /jci/resources/TranLogo.ivf - log_message "=== TranLogo.ivf set to MaZda Logo ===" -elif [ $BOOTLOGO2 -eq 5 ] -then - cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogoCinema.ivf" /jci/resources/TranLogo.ivf - log_message "=== TranLogo.ivf set to MZD Cinema Loop ===" -elif [ $BOOTLOGO2 -eq 6 ] -then - cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogoCrissCross.ivf" /jci/resources/TranLogo.ivf - log_message "=== TranLogo.ivf set to MZD Criss Cross ===" -elif [ $BOOTLOGO2 -eq 7 ] -then - cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogoRace.ivf" /jci/resources/TranLogo.ivf - log_message "=== TranLogo.ivf set to MZD Race Loop ===" -elif [ $BOOTLOGO2 -eq 8 ] -then - cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogo.ivf" /jci/resources/ - log_message "=== TranLogo.ivf set to Default Mazda Intro ===" + log_message "=== Found newLoopLogo.ivf, other boot animations will be skipped ===" else - log_message "=== TranLogo.ivf was not changed ===" -fi + if [ $BOOTLOGO2 -eq 0 ] + then + cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogo.ivf" /jci/resources/TranLogo.ivf + log_message "=== TranLogo.ivf set to Mazda Logo ===" + elif [ $BOOTLOGO2 -eq 1 ] + then + cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogoMatrix.ivf" /jci/resources/TranLogo.ivf + log_message "=== TranLogo.ivf set to Matrix ===" + elif [ $BOOTLOGO2 -eq 2 ] + then + cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogoRace.ivf" /jci/resources/TranLogo.ivf + log_message "=== TranLogo.ivf set to Large Mazda Logo ===" + elif [ $BOOTLOGO2 -eq 3 ] + then + cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogo124Spider.ivf" /jci/resources/TranLogo.ivf + log_message "=== TranLogo.ivf set to Spider 124 Trans ===" + elif [ $BOOTLOGO2 -eq 4 ] + then + cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogoZ.ivf" /jci/resources/TranLogo.ivf + log_message "=== TranLogo.ivf set to MaZda Logo ===" + elif [ $BOOTLOGO2 -eq 5 ] + then + cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogoCinema.ivf" /jci/resources/TranLogo.ivf + log_message "=== TranLogo.ivf set to MZD Cinema Loop ===" + elif [ $BOOTLOGO2 -eq 6 ] + then + cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogoCrissCross.ivf" /jci/resources/TranLogo.ivf + log_message "=== TranLogo.ivf set to MZD Criss Cross ===" + elif [ $BOOTLOGO2 -eq 7 ] + then + cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogoRace.ivf" /jci/resources/TranLogo.ivf + log_message "=== TranLogo.ivf set to MZD Race Loop ===" + elif [ $BOOTLOGO2 -eq 8 ] + then + cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogo.ivf" /jci/resources/ + log_message "=== TranLogo.ivf set to Default Mazda Intro ===" + else + log_message "=== TranLogo.ivf was not changed ===" + fi -if [ $BOOTLOGO3 -eq 0 ] -then - cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogo.ivf" /jci/resources/TranLogoEnd.ivf - log_message "=== TranLogoEnd.ivf set to Mazda Logo ===" -elif [ $BOOTLOGO3 -eq 1 ] -then - cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogoMatrix.ivf" /jci/resources/TranLogoEnd.ivf - log_message "=== TranLogoEnd.ivf set to Matrix ===" -elif [ $BOOTLOGO3 -eq 2 ] -then - cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogoEndRace.ivf" /jci/resources/TranLogoEnd.ivf - log_message "=== TranLogoEnd.ivf set to Mazda Race Logo ===" -elif [ $BOOTLOGO3 -eq 3 ] -then - cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogoCarFlash.ivf" /jci/resources/TranLogoEnd.ivf - log_message "=== TranLogoEnd.ivf set to Car Flash ===" -elif [ $BOOTLOGO3 -eq 4 ] -then - cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogoZ.ivf" /jci/resources/TranLogoEnd.ivf - log_message "=== TranLogoEnd.ivf set to MaZda Logo ===" -elif [ $BOOTLOGO3 -eq 5 ] -then - cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogoEndCinema.ivf" /jci/resources/TranLogoEnd.ivf - log_message "=== TranLogoEnd.ivf set to MZD Cinema ===" -elif [ $BOOTLOGO3 -eq 6 ] -then - cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogoEndCrissCross.ivf" /jci/resources/TranLogoEnd.ivf - log_message "=== TranLogoEnd.ivf set to MZD Criss Cross ===" -elif [ $BOOTLOGO3 -eq 7 ] -then - cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogoEndRace.ivf" /jci/resources/TranLogoEnd.ivf - log_message "=== TranLogoEnd.ivf set to MZD Race ===" -elif [ $BOOTLOGO3 -eq 8 ] -then - cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogoEndSpace.ivf" /jci/resources/TranLogoEnd.ivf - log_message "=== TranLogoEnd.ivf set to MZD Space ===" -elif [ $BOOTLOGO3 -eq 9 ] -then - cp -a "${MYDIR}/config/bootanimation/jci/resources/TranRace.ivf" /jci/resources/TranLogoEnd.ivf - log_message "=== TranLogoEnd.ivf set to MZD Race ===" -elif [ $BOOTLOGO3 -eq 10 ] -then - cp -a "${MYDIR}/config/bootanimation/jci/resources/TranIntroM.ivf" /jci/resources/TranLogoEnd.ivf - log_message "=== TranLogoEnd.ivf set to MZD Title Slam ===" -elif [ $BOOTLOGO3 -eq 11 ] -then - cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogoEnd.ivf" /jci/resources/ - log_message "=== TranLogoEnd.ivf set to Default ===" -else - log_message "=== TranLogoEnd.ivf was not changed ===" + if [ $BOOTLOGO3 -eq 0 ] + then + cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogo.ivf" /jci/resources/TranLogoEnd.ivf + log_message "=== TranLogoEnd.ivf set to Mazda Logo ===" + elif [ $BOOTLOGO3 -eq 1 ] + then + cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogoMatrix.ivf" /jci/resources/TranLogoEnd.ivf + log_message "=== TranLogoEnd.ivf set to Matrix ===" + elif [ $BOOTLOGO3 -eq 2 ] + then + cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogoEndRace.ivf" /jci/resources/TranLogoEnd.ivf + log_message "=== TranLogoEnd.ivf set to Mazda Race Logo ===" + elif [ $BOOTLOGO3 -eq 3 ] + then + cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogoCarFlash.ivf" /jci/resources/TranLogoEnd.ivf + log_message "=== TranLogoEnd.ivf set to Car Flash ===" + elif [ $BOOTLOGO3 -eq 4 ] + then + cp -a "${MYDIR}/config/bootanimation/jci/resources/LoopLogoZ.ivf" /jci/resources/TranLogoEnd.ivf + log_message "=== TranLogoEnd.ivf set to MaZda Logo ===" + elif [ $BOOTLOGO3 -eq 5 ] + then + cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogoEndCinema.ivf" /jci/resources/TranLogoEnd.ivf + log_message "=== TranLogoEnd.ivf set to MZD Cinema ===" + elif [ $BOOTLOGO3 -eq 6 ] + then + cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogoEndCrissCross.ivf" /jci/resources/TranLogoEnd.ivf + log_message "=== TranLogoEnd.ivf set to MZD Criss Cross ===" + elif [ $BOOTLOGO3 -eq 7 ] + then + cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogoEndRace.ivf" /jci/resources/TranLogoEnd.ivf + log_message "=== TranLogoEnd.ivf set to MZD Race ===" + elif [ $BOOTLOGO3 -eq 8 ] + then + cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogoEndSpace.ivf" /jci/resources/TranLogoEnd.ivf + log_message "=== TranLogoEnd.ivf set to MZD Space ===" + elif [ $BOOTLOGO3 -eq 9 ] + then + cp -a "${MYDIR}/config/bootanimation/jci/resources/TranRace.ivf" /jci/resources/TranLogoEnd.ivf + log_message "=== TranLogoEnd.ivf set to MZD Race ===" + elif [ $BOOTLOGO3 -eq 10 ] + then + cp -a "${MYDIR}/config/bootanimation/jci/resources/TranIntroM.ivf" /jci/resources/TranLogoEnd.ivf + log_message "=== TranLogoEnd.ivf set to MZD Title Slam ===" + elif [ $BOOTLOGO3 -eq 11 ] + then + cp -a "${MYDIR}/config/bootanimation/jci/resources/TranLogoEnd.ivf" /jci/resources/ + log_message "=== TranLogoEnd.ivf set to Default ===" + else + log_message "=== TranLogoEnd.ivf was not changed ===" + fi fi log_message "=========******* END INSTALLATION OF TWEAK BOOT ANIMATION ******=========" log_message " " diff --git a/app/files/tweaks/13_boot-u.txt b/app/files/tweaks/13_boot-u.txt index 412b5b9..b851ed3 100644 --- a/app/files/tweaks/13_boot-u.txt +++ b/app/files/tweaks/13_boot-u.txt @@ -2,28 +2,25 @@ show_message "RESTORE BOOT ANIMATION ..." log_message "======********** UNINSTALL DISABLE BOOT ANIMATION ... **********======" -if [ -e /jci/resources/LoopLogo.ivf.org ] +if ! (restore_org /jci/resources/LoopLogo.ivf) then - cp -a /jci/resources/LoopLogo.ivf.org /jci/resources/LoopLogo.ivf - log_message "=== Restored original /jci/resources/LoopLogo.ivf ===" -else - log_message "=== No LoopLogo.ivf.org available, no changes were made ===" + log_message "=== No LoopLogo.ivf.org available, no changes were made ===" fi -if [ -e /jci/resources/TranLogo.ivf.org ] - then - cp -a /jci/resources/TranLogo.ivf.org /jci/resources/TranLogo.ivf - log_message "=== Restored original /jci/resources/TranLogo.ivf ===" - else - # cp -a "${MYDIR}/config_org/bootanimation/jci/resources/TranLogo.ivf" /jci/resources/ - log_message "=== No TranLogo.ivf.org available, no changes were made ===" +if ! (restore_org /jci/resources/TranLogo.ivf) +then + log_message "=== No TranLogo.ivf.org available, no changes were made ===" +fi +if ! (restore_org /jci/resources/TranLogoEnd.ivf) +then + log_message "=== No TranLogoEnd.ivf.org available, no changes were made ===" fi -if [ -e /jci/resources/TranLogoEnd.ivf.org ] - then - cp -a /jci/resources/TranLogoEnd.ivf.org /jci/resources/TranLogoEnd.ivf - log_message "=== Restored original /jci/resources/TranLogoEnd.ivf ===" - else - # cp -a "${MYDIR}/config_org/bootanimation/jci/resources/TranLogoEnd.ivf" /jci/resources/ - log_message "=== No TranLogoEnd.ivf.org available, no changes were made ===" +if ! (restore_org /jci/resources/ExitLogo.ivf) +then + log_message "=== No ExitLogo.ivf.org available, no changes were made ===" +fi +if ! (restore_org /jci/resources/newLoopLogo.ivf) +then + log_message "=== No newLoopLogo.ivf.org available, no changes were made ===" fi log_message "=== End restoring boot animation to original ===" diff --git a/app/files/tweaks/14_bgart-u.txt b/app/files/tweaks/14_bgart-u.txt index cabe94d..3a1b4aa 100644 --- a/app/files/tweaks/14_bgart-u.txt +++ b/app/files/tweaks/14_bgart-u.txt @@ -2,26 +2,16 @@ show_message "RESTORE BIGGER ALBUM ART ..." log_message "=======************ UNINSTALL BIGGER ALBUM ART ... ************=======" -# Restore images -# cp -a ${MYDIR}/config_org/bigger-album-art/jci/gui/common/controls/InCall2/images/NowPlayingImageFrame.png /jci/gui/common/controls/InCall2/images/ -# cp -a ${MYDIR}/config_org/bigger-album-art/jci/gui/common/controls/NowPlaying4/images/NowPlayingImageFrame.png /jci/gui/common/controls/NowPlaying4/images/ - # Remove CSS remove_aio_css /jci/gui/common/controls/NowPlaying4/css/NowPlaying4Ctrl.css BIGGERALBM # Look for old installations (pre v2.2.4) -if grep -Fq "max-height: 210px" /jci/gui/common/controls/NowPlaying4/css/NowPlaying4Ctrl.css +if grep -Fq "max-height: 210px" /jci/gui/common/controls/NowPlaying4/css/NowPlaying4Ctrl.css && ! (restore_org /jci/gui/common/controls/NowPlaying4/css/NowPlaying4Ctrl.css) then - if [ -e /jci/gui/common/controls/NowPlaying4/css/NowPlaying4Ctrl.css.org ] - then - cp /jci/gui/common/controls/NowPlaying4/css/NowPlaying4Ctrl.css.org /jci/gui/common/controls/NowPlaying4/css/NowPlaying4Ctrl.css - log_message "=== Restored NowPlaying4Ctrl.css from backup ===" - else - # cp -a ${MYDIR}/config_org/bigger-album-art/jci/gui/common/controls/NowPlaying4/css/NowPlaying4Ctrl.css /jci/gui/common/controls/NowPlaying4/css/ - log_message "=== No NowPlaying4Ctrl.css.org found, No changes were made ===" - fi + log_message "=== No NowPlaying4Ctrl.css.org found, No changes were made ===" +else + log_message "=== Album Art Size Restored ===" fi -log_message "=== Album Art Size Restored ===" log_message "======******* END UNINSTALATION OF BIGGER ALBUM ART ********======" log_message " " diff --git a/app/files/tweaks/15_btnbackground-u.txt b/app/files/tweaks/15_btnbackground-u.txt index 5285762..85896de 100644 --- a/app/files/tweaks/15_btnbackground-u.txt +++ b/app/files/tweaks/15_btnbackground-u.txt @@ -3,20 +3,17 @@ show_message "RESTORE BACKGROUND OVERLAY GRAPHICS ..." log_message "========******** UNINSTALL REMOVE BACKGROUND OVERLAYS... ********=======" # Restore Backgounds that were changed prior to AIO v2.1 -if [ -e /jci/gui/common/controls/Ump3/images/UMP_Bg.png.org ] +if (restore_org /jci/gui/common/controls/Ump3/images/UMP_Bg.png) then - rm -f /jci/gui/common/controls/Ump3/images/UMP_Bg.png - mv /jci/gui/common/controls/Ump3/images/UMP_Bg.png.org /jci/gui/common/controls/Ump3/images/UMP_Bg.png + rm -f /jci/gui/common/controls/Ump3/images/UMP_Bg.png.org log_message "=== Restored Original UMP_Bg.png ===" - if [ -e /jci/gui/common/controls/Ump3/images/UMP_Bg_Arch.png.org ] + if (restore_org /jci/gui/common/controls/Ump3/images/UMP_Bg_Arch.png) then - rm -f /jci/gui/common/controls/Ump3/images/UMP_Bg_Arch.png - mv /jci/gui/common/controls/Ump3/images/UMP_Bg_Arch.png.org /jci/gui/common/controls/Ump3/images/UMP_Bg_Arch.png + rm -f /jci/gui/common/controls/Ump3/images/UMP_Bg_Arch.png.org log_message "=== Restored Original UMP_Bg_Arch.png ===" - if [ -e /jci/gui/common/controls/Ump3/images/UMP_Btn_Separator.png.org ] + if (restore_org /jci/gui/common/controls/Ump3/images/UMP_Btn_Separator.png) then - rm -f /jci/gui/common/controls/Ump3/images/UMP_Btn_Separator.png - mv /jci/gui/common/controls/Ump3/images/UMP_Btn_Separator.png.org /jci/gui/common/controls/Ump3/images/UMP_Btn_Separator.png + rm -f /jci/gui/common/controls/Ump3/images/UMP_Btn_Separator.png.org log_message "=== Restored Original UMP_Btn_Separator.png ===" fi fi diff --git a/app/files/tweaks/17_videoplayer-i.txt b/app/files/tweaks/17_videoplayer-i.txt index 5da17d2..8bac35f 100644 --- a/app/files/tweaks/17_videoplayer-i.txt +++ b/app/files/tweaks/17_videoplayer-i.txt @@ -9,8 +9,8 @@ log_message "=== Begin Installation of VideoPlayer V${VP_VER} if [ $TESTBKUPS -eq 1 ] then - cp /jci/scripts/stage_wifi.sh "${MYDIR}/bakups/test/stage_wifi_videoplayer-before.sh" - cp /jci/opera/opera_dir/userjs/additionalApps.json "${MYDIR}/bakups/test/additionalApps_videoplayer-1._before.json" + cp ${STAGE_WIFI} "${MYDIR}/bakups/test/stage_wifi_videoplayer-before.sh" + [ -f ${ADDITIONAL_APPS_JSON} ] && cp ${ADDITIONAL_APPS_JSON} "${MYDIR}/bakups/test/additionalApps_videoplayer-before.json" fi ### Kills all WebSocket daemons @@ -18,8 +18,9 @@ pkill websocketd # Remove previous files rm -fr /jci/gui/apps/_videoplayer/ -sed -i '/Video/d' /jci/scripts/stage_wifi.sh -sed -i '/--port=9998/d' /jci/scripts/stage_wifi.sh +rm -fr /tmp/mnt/resources/aio/apps/_videoplayer/ +sed -i '/Video/d' ${STAGE_WIFI} +sed -i '/--port=9998/d' ${STAGE_WIFI} log_message "=== Removed Old VideoPlayer Files ===" # Copies the additionalApps.js @@ -27,25 +28,15 @@ if [ $CASDK_MODE -eq 0 ] then cp -a ${MYDIR}/config/jci/opera/opera_dir/userjs/*.js /jci/opera/opera_dir/userjs/ && CASDK_MODE=1 chmod 755 /jci/opera/opera_dir/userjs/additionalApps.js - chown 1018:3015 /jci/opera/opera_dir/userjs/additionalApps.js log_message "=== Copied additionalApps.js ===" fi cp -a ${MYDIR}/config/jci/opera/opera_dir/userjs/aio.js /jci/opera/opera_dir/userjs/ chmod 755 /jci/opera/opera_dir/userjs/aio.js -chown 1018:3015 /jci/opera/opera_dir/userjs/aio.js log_message "=== Copied aio.js ===" -# create additionalApps.json file from scratch if the file does not exist -if [ ! -e /jci/opera/opera_dir/userjs/additionalApps.json ] -then - echo "[" > /jci/opera/opera_dir/userjs/additionalApps.json - echo "]" >> /jci/opera/opera_dir/userjs/additionalApps.json - chmod 755 /jci/opera/opera_dir/userjs/additionalApps.json - log_message "=== Created additionalApps.json ===" -fi - +create_app_json # Call to the function to populate the json add_app_json "_videoplayer" "Video Player" @@ -57,44 +48,55 @@ if [ ! -e /jci/gui/addon-common/websocketd ] || [ ! -e /jci/gui/addon-common/jq fi # Remove old port configuration -count=$(grep -c '/jci/gui/addon-common/websocketd --port=55555 sh' /jci/scripts/stage_wifi.sh) +count=$(grep -c '/jci/gui/addon-common/websocketd --port=55555 sh' ${STAGE_WIFI}) if [ $count -ne 0 ] then - sed -i '/### Video player/d' /jci/scripts/stage_wifi.sh - sed -i '/55555/d' /jci/scripts/stage_wifi.sh + sed -i '/### Video player/d' ${STAGE_WIFI} + sed -i '/55555/d' ${STAGE_WIFI} log_message "=== Removed Old Configuration ===" fi -count=$(grep -c '/jci/gui/addon-common/websocketd --port=9998 sh' /jci/scripts/stage_wifi.sh) +count=$(grep -c '/jci/gui/addon-common/websocketd --port=9998 sh' ${STAGE_WIFI}) if [ $count -eq 0 ] then - #echo -e '\n\n\n### Video player' >> /jci/scripts/stage_wifi.sh - #echo -e '\n/jci/gui/addon-common/websocketd --port=9998 sh &' >> /jci/scripts/stage_wifi.sh - sed -i '/#!/ a\### Video player' /jci/scripts/stage_wifi.sh + #echo -e '\n\n\n### Video player' >> ${STAGE_WIFI} + #echo -e '\n/jci/gui/addon-common/websocketd --port=9998 sh &' >> ${STAGE_WIFI} + sed -i '/#!/ a\### Video player' ${STAGE_WIFI} sleep 1 - sed -i '/Video player/ i\ ' /jci/scripts/stage_wifi.sh - sed -i '/Video player/ a\/jci/gui/addon-common/websocketd --port=9998 sh &' /jci/scripts/stage_wifi.sh - chmod 755 /jci/scripts/stage_wifi.sh + sed -i '/Video player/ i\ ' ${STAGE_WIFI} + sed -i '/Video player/ a\/jci/gui/addon-common/websocketd --port=9998 sh &' ${STAGE_WIFI} + chmod 755 ${STAGE_WIFI} log_message "=== Modified Stage_wifi.sh ===" fi -cp -a ${MYDIR}/config/videoplayer/jci/gui/apps/* /jci/gui/apps/ -chmod 755 -R /jci/gui/apps/_videoplayer/ - +cp -a ${MYDIR}/config/videoplayer/jci/gui/apps/_videoplayer ${AIO_APP_DIR} +chmod 755 -R ${AIO_APP_DIR} log_message "=== Copy VideoPlayer Files ===" +# symlink to resources +if [ $APPS2RESOURCES -eq 1 ] +then + ln -sf /tmp/mnt/resources/aio/apps/_videoplayer /jci/gui/apps/_videoplayer + log_message "=== Created Symlink To Resources Partition ===" +fi + +sed -r -i "s/var Repeat = (.*)[0-2];/var Repeat = \1$VP_REPEAT;/g" /jci/gui/apps/_videoplayer/js/videoplayer-v3.js +sed -r -i "s/var FullScreen = (.*)[0-2];/var FullScreen = \1$VP_FULLSCRN;/g" /jci/gui/apps/_videoplayer/js/videoplayer-v3.js +sed -r -i "s/var Shuffle = (.*)(true|false);/var Shuffle = \1$VP_SHUFFLE;/g" /jci/gui/apps/_videoplayer/js/videoplayer-v3.js +log_message "=== Set Video Player Options ===" cp -a ${MYDIR}/config/videoplayer/usr/lib/gstreamer-0.10/* /usr/lib/gstreamer-0.10/ cp -a ${MYDIR}/config/videoplayer/usr/lib/libFLAC.so.8.3.0 /usr/lib/ chmod 755 -R /usr/lib/gstreamer-0.10/libgstautodetect.so chmod 755 -R /usr/lib/gstreamer-0.10/libgstflac.so chmod 755 -R /usr/lib/libFLAC.so.8.3.0 -ln -s /usr/lib/libFLAC.so.8.3.0 /usr/lib/libFLAC.so.8 +[ -L /usr/lib/libFLAC.so.8 ] || ln -s /usr/lib/libFLAC.so.8.3.0 /usr/lib/libFLAC.so.8 log_message "=== Copy libs to usr/lib/gstreamer-0.10 ===" count=$(grep -c '/imx-mm/video-codec' /etc/profile) if [ $count -eq 0 ] then + backup_org /etc/profile sed -i 's/\/imx-mm\/parser/\/imx-mm\/parser:\/usr\/lib\/imx-mm\/video-codec/g' /etc/profile log_message "=== Fix exports / codecs ===" fi @@ -102,7 +104,7 @@ fi export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/imx-mm/video-codec rm -f /tmp/root/.gstreamer-0.10/registry.arm.bin -/usr/bin/gst-inspect > ${MYDIR}/gst-inspect.log +/usr/bin/gst-inspect > ${MYDIR}/gst-inspect.log 2>&1 log_message "=== Updated gstreamer registry ===" log_message "========********** END INSTALLATION OF VIDEOPLAYER ***********===========" diff --git a/app/files/tweaks/17_videoplayer-u.txt b/app/files/tweaks/17_videoplayer-u.txt index 961c625..ec8d892 100644 --- a/app/files/tweaks/17_videoplayer-u.txt +++ b/app/files/tweaks/17_videoplayer-u.txt @@ -1,5 +1,5 @@ # Remove videoplayer v2 -show_message "REMOVE VIDEOPLAYER V2 ..." +show_message "REMOVE VIDEOPLAYER APP ..." log_message "===========************ UNINSTALL VIDEOPLAYER ... ************==========" ### kills all WebSocket daemons @@ -7,55 +7,55 @@ pkill websocketd if [ $TESTBKUPS -eq 1 ] then - cp /jci/scripts/stage_wifi.sh "${MYDIR}/bakups/test/stage_wifi_videoplayer-before.sh" - cp /jci/opera/opera_dir/userjs/additionalApps.json "${MYDIR}/bakups/test/additionalApps_videoplayer-1._before.json" + cp ${STAGE_WIFI} "${MYDIR}/bakups/test/stage_wifi_videoplayer-before.sh" + [ -f ${ADDITIONAL_APPS_JSON} ] && cp ${ADDITIONAL_APPS_JSON} "${MYDIR}/bakups/test/additionalApps_videoplayer-before.json" fi -sed -i '/Speedo-Compass-Video_Tweak/d' /jci/scripts/stage_wifi.sh -sed -i '/v3.2/d' /jci/scripts/stage_wifi.sh -sed -i '/Removed requirement/d' /jci/scripts/stage_wifi.sh -sed -i '/# mount /d' /jci/scripts/stage_wifi.sh -sed -i '/Added additional/d' /jci/scripts/stage_wifi.sh -sed -i '/get-vehicle-speed.sh/d' /jci/scripts/stage_wifi.sh -sed -i '/get-vehicle-data-other.sh/d' /jci/scripts/stage_wifi.sh -sed -i '/get-gps-data.sh/d' /jci/scripts/stage_wifi.sh -sed -i '/Need to set defaults/d' /jci/scripts/stage_wifi.sh -sed -i '/myVideoList /d' /jci/scripts/stage_wifi.sh -sed -i '/playbackAction /d' /jci/scripts/stage_wifi.sh -sed -i '/playbackOption /d' /jci/scripts/stage_wifi.sh -sed -i '/playbackStatus /d' /jci/scripts/stage_wifi.sh -sed -i '/playback/d' /jci/scripts/stage_wifi.sh -sed -i '/myVideoList/d' /jci/scripts/stage_wifi.sh -sed -i '/Video player action watch/d' /jci/scripts/stage_wifi.sh -sed -i '/playback-action.sh/d' /jci/scripts/stage_wifi.sh -sed -i '/Log data collection/d' /jci/scripts/stage_wifi.sh -sed -i '/get-log-data/d' /jci/scripts/stage_wifi.sh -sed -i '/### Video player/d' /jci/scripts/stage_wifi.sh -sed -i '/_videoplayer/d' /jci/scripts/stage_wifi.sh -sed -i '/addon-player.sh &/d' /jci/scripts/stage_wifi.sh +sed -i '/Speedo-Compass-Video_Tweak/d' ${STAGE_WIFI} +sed -i '/v3.2/d' ${STAGE_WIFI} +sed -i '/Removed requirement/d' ${STAGE_WIFI} +sed -i '/# mount /d' ${STAGE_WIFI} +sed -i '/Added additional/d' ${STAGE_WIFI} +sed -i '/get-vehicle-speed.sh/d' ${STAGE_WIFI} +sed -i '/get-vehicle-data-other.sh/d' ${STAGE_WIFI} +sed -i '/get-gps-data.sh/d' ${STAGE_WIFI} +sed -i '/Need to set defaults/d' ${STAGE_WIFI} +sed -i '/myVideoList /d' ${STAGE_WIFI} +sed -i '/playbackAction /d' ${STAGE_WIFI} +sed -i '/playbackOption /d' ${STAGE_WIFI} +sed -i '/playbackStatus /d' ${STAGE_WIFI} +sed -i '/playback/d' ${STAGE_WIFI} +sed -i '/myVideoList/d' ${STAGE_WIFI} +sed -i '/Video player action watch/d' ${STAGE_WIFI} +sed -i '/playback-action.sh/d' ${STAGE_WIFI} +sed -i '/Log data collection/d' ${STAGE_WIFI} +sed -i '/get-log-data/d' ${STAGE_WIFI} +sed -i '/### Video player/d' ${STAGE_WIFI} +sed -i '/_videoplayer/d' ${STAGE_WIFI} +sed -i '/addon-player.sh &/d' ${STAGE_WIFI} -sed -i '/Video/d' /jci/scripts/stage_wifi.sh -sed -i '/--port=9998/d' /jci/scripts/stage_wifi.sh +sed -i '/Video/d' ${STAGE_WIFI} +sed -i '/--port=9998/d' ${STAGE_WIFI} -# delete videoplayer entry from /jci/opera/opera_dir/userjs/additionalApps.json +# delete videoplayer entry from additionalApps.json ADDIT_APPS=0 if [ -e /jci/opera/opera_dir/userjs/CustomApplicationsProxy.js ] || [ -e /jci/opera/opera_dir/userjs/nativeApps.js ] then - log_message "=== Found CASDK ===" - ADDIT_APPS=1 -elif grep -Fq "_aiotweaks" /jci/opera/opera_dir/userjs/additionalApps.json + log_message "=== Found CASDK ===" + ADDIT_APPS=1 +elif grep -Fq "_aiotweaks" ${ADDITIONAL_APPS_JSON} then log_message "=== Found AIOTweaksApp entry in additionalApps.json ===" ADDIT_APPS=1 -elif grep -Fq "_androidauto" /jci/opera/opera_dir/userjs/additionalApps.json +elif grep -Fq "_androidauto" ${ADDITIONAL_APPS_JSON} then log_message "=== Found androidauto entry in additionalApps.json ===" ADDIT_APPS=1 -elif grep -Fq "_speedometer" /jci/opera/opera_dir/userjs/additionalApps.json +elif grep -Fq "_speedometer" ${ADDITIONAL_APPS_JSON} then log_message "=== Found speedometer entry in additionalApps.json ===" ADDIT_APPS=1 -elif grep -Fq "_mzdmeter" /jci/opera/opera_dir/userjs/additionalApps.json +elif grep -Fq "_mzdmeter" ${ADDITIONAL_APPS_JSON} then log_message "=== Found mzd meter entry in additionalApps.json ===" ADDIT_APPS=1 @@ -70,7 +70,7 @@ else fi ### cleanup old versions -if [ ! -e /jci/opera/opera_dir/userjs/additionalApps.json ]; then +if [ ! -e ${ADDITIONAL_APPS_JSON} ]; then rm -fr /jci/gui/addon-common log_message "=== Removed /jci/gui/addon-common because no more AIO apps ===" fi @@ -78,6 +78,7 @@ rm -fr /jci/gui/addon-player rm -fr /jci/gui/addon-speedometer rm -fr /jci/gui/speedometer rm -fr /jci/gui/apps/_videoplayer +rm -fr /tmp/mnt/resources/aio/apps/_videoplayer rm -f /jci/opera/opera_dir/userjs/addon-startup.js rm -f /jci/opera/opera_dir/userjs/mySpeedometer* rm -f /jci/scripts/get-gps-data* @@ -85,11 +86,11 @@ rm -f /jci/scripts/get-log-data* rm -f /jci/scripts/get-vehicle-data-other* rm -f /jci/scripts/get-vehicle-gear* rm -f /jci/scripts/get-vehicle-speed* -rm -f /jci/scripts/stage_wifi.sh.bak? +rm -f ${STAGE_WIFI}.bak? if [ $TESTBKUPS -eq 1 ] then - cp /jci/scripts/stage_wifi.sh "${MYDIR}/bakups/test/stage_wifi_videoplayer-after.sh" + cp ${STAGE_WIFI} "${MYDIR}/bakups/test/stage_wifi_videoplayer-after.sh" fi log_message "==========********* END UNINSTALLATION OF VIDEOPLAYER **********=========" diff --git a/app/files/tweaks/18_swapfile-i.txt b/app/files/tweaks/18_swapfile-i.txt index ee14f17..5b57bd0 100644 --- a/app/files/tweaks/18_swapfile-i.txt +++ b/app/files/tweaks/18_swapfile-i.txt @@ -3,72 +3,76 @@ show_message "ADD SWAP FILE TO USB DRIVE ..." log_message "=========************** INSTALL SWAP FILE ... *************===========" log_message "=== Adding Swap File To USB Drive ===" -cat /proc/meminfo >> "${MYDIR}/AIO_log.txt" +cat /proc/meminfo >> "${MYDIR}/bakups/info.log" mount -o rw,remount ${MYDIR} mv ${MYDIR}/config/swapfile/swapfile ${MYDIR} sleep 3 mkswap ${MYDIR}/swapfile swapon ${MYDIR}/swapfile log_message "=== Swapfile added to USB drive ===" -cat /proc/meminfo >> "${MYDIR}/AIO_log.txt" +cat /proc/meminfo >> "${MYDIR}/bakups/info.log" log_message "=== Add commands for speedometer and media player to stage_wifi.sh ===" # add commands for speedometer and media player to stage_wifi.sh -cp /jci/scripts/stage_wifi.sh ${MYDIR}/bakups/test/stage_wifi_swap-before.sh +cp ${STAGE_WIFI} ${MYDIR}/bakups/test/stage_wifi_swap-before.sh # first delete all -sed -i '/swap file/d' /jci/scripts/stage_wifi.sh -sed -i '/for USB in/d' /jci/scripts/stage_wifi.sh -sed -i '/USBPATH/d' /jci/scripts/stage_wifi.sh -sed -i '/USBDRV/d' /jci/scripts/stage_wifi.sh -sed -i '/SWAPFILE/d' /jci/scripts/stage_wifi.sh -sed -i '/rw,remount/d' /jci/scripts/stage_wifi.sh -sed -i '/ sleep 5/d' /jci/scripts/stage_wifi.sh -sed -i '/ do/d' /jci/scripts/stage_wifi.sh -sed -i '/ then/d' /jci/scripts/stage_wifi.sh -sed -i '/ break/d' /jci/scripts/stage_wifi.sh -sed -i '/ fi/d' /jci/scripts/stage_wifi.sh -sed -i '/ done/d' /jci/scripts/stage_wifi.sh -log_message "=== First deleted modifications from /jci/scripts/stage_wifi.sh ===" +sed -i '/swap file/d' ${STAGE_WIFI} +sed -i '/for USB in/d' ${STAGE_WIFI} +sed -i '/USBPATH/d' ${STAGE_WIFI} +sed -i '/USBDRV/d' ${STAGE_WIFI} +sed -i '/SWAPFILE/d' ${STAGE_WIFI} +sed -i '/rw,remount/d' ${STAGE_WIFI} +sed -i '/ sleep 5/d' ${STAGE_WIFI} +sed -i '/ do/d' ${STAGE_WIFI} +sed -i '/ then/d' ${STAGE_WIFI} +sed -i '/ break/d' ${STAGE_WIFI} +sed -i '/ fi/d' ${STAGE_WIFI} +sed -i '/ done/d' ${STAGE_WIFI} +log_message "=== First deleted modifications from ${STAGE_WIFI} ===" # add commands for swap file to stage_wifi.sh log_message "=== Add commands for swap file to stage_wifi.sh ===" -if grep -Fq 'for USB in' /jci/scripts/stage_wifi.sh +if grep -Fq 'for USB in' ${STAGE_WIFI} then - echo "exist" - log_message "=== Modifications for swapfile already in /jci/scripts/stage_wifi.sh ===" + log_message "=== Modifications for swapfile already in ${STAGE_WIFI} ===" else - echo '### find swap file' >> /jci/scripts/stage_wifi.sh - echo ' sleep 5' >> /jci/scripts/stage_wifi.sh - echo ' USBDRV=$(ls /tmp/mnt | grep sd)" resources"' >> /jci/scripts/stage_wifi.sh - echo ' for USB in $USBDRV' >> /jci/scripts/stage_wifi.sh - echo ' do' >> /jci/scripts/stage_wifi.sh - echo ' USBPATH=/tmp/mnt/${USB}' >> /jci/scripts/stage_wifi.sh - echo ' SWAPFILE="${USBPATH}"/swapfile' >> /jci/scripts/stage_wifi.sh - echo ' if [ -e "${SWAPFILE}" ]' >> /jci/scripts/stage_wifi.sh - echo ' then' >> /jci/scripts/stage_wifi.sh - echo ' mount -o rw,remount ${USBPATH}' >> /jci/scripts/stage_wifi.sh - echo ' mkswap ${SWAPFILE}' >> /jci/scripts/stage_wifi.sh - echo ' swapon ${SWAPFILE}' >> /jci/scripts/stage_wifi.sh - echo ' break' >> /jci/scripts/stage_wifi.sh - echo ' fi' >> /jci/scripts/stage_wifi.sh - echo ' done' >> /jci/scripts/stage_wifi.sh + echo '### find swap file' >> ${STAGE_WIFI} + echo ' sleep 5' >> ${STAGE_WIFI} + echo ' USBDRV=$(ls /tmp/mnt | grep sd)' >> ${STAGE_WIFI} + echo ' for USB in $USBDRV' >> ${STAGE_WIFI} + echo ' do' >> ${STAGE_WIFI} + echo ' USBPATH=/tmp/mnt/${USB}' >> ${STAGE_WIFI} + echo ' SWAPFILE="${USBPATH}"/swapfile' >> ${STAGE_WIFI} + echo ' if [ -e "${SWAPFILE}" ]' >> ${STAGE_WIFI} + echo ' then' >> ${STAGE_WIFI} + echo ' mount -o rw,remount ${USBPATH}' >> ${STAGE_WIFI} + echo ' mkswap ${SWAPFILE}' >> ${STAGE_WIFI} + echo ' swapon ${SWAPFILE}' >> ${STAGE_WIFI} + echo ' break' >> ${STAGE_WIFI} + echo ' fi' >> ${STAGE_WIFI} + echo ' done' >> ${STAGE_WIFI} sleep 1 - sed -i '/find swap file/ i\ ' /jci/scripts/stage_wifi.sh - log_message "=== Modifications for swapfile added to /jci/scripts/stage_wifi.sh ===" + sed -i '/find swap file/ i\ ' ${STAGE_WIFI} + log_message "=== Modifications for swapfile added to ${STAGE_WIFI} ===" fi -cp /jci/scripts/stage_wifi.sh ${MYDIR}/bakups/test/stage_wifi_swap-after.sh +cp ${STAGE_WIFI} ${MYDIR}/bakups/test/stage_wifi_swap-after.sh log_message "=== Swap File Added To USB Drive ===" log_message "=== Deleting Tweak Files ===" -rm -fr ${MYDIR}/config -rm -fr ${MYDIR}/config_org -rm -fr ${MYDIR}/bakups rm -fr ${MYDIR}/VehDataPull rm -f ${MYDIR}/cmu_dataretrieval.up rm -f ${MYDIR}/dataRetrieval_config.txt rm -f ${MYDIR}/jci-autoupdate rm -f ${MYDIR}/MZD_LOG.md rm -f ${MYDIR}/AIO_info.json -rm -f ${MYDIR}/*.log -rm -f ${MYDIR}/tweaks.sh +log_message "=== Copying Log Files ===" log_message "===========********** END INSTALLATION OF SWAP FILE **********===========" -log_message " " +# Changed this to save logs and backup files just in case something goes wrong +mv ${MYDIR}/*.log ${MYDIR}/bakups +mv ${MYDIR}/*.txt ${MYDIR}/bakups +mv ${MYDIR}/*.sh ${MYDIR}/bakups +[ -d ${MYDIR}/config ] && mv ${MYDIR}/config ${MYDIR}/bakups +[ -d ${MYDIR}/config_org ] && mv ${MYDIR}/config_org ${MYDIR}/bakups +[ -d ${MYDIR}/casdk ] && mv ${MYDIR}/casdk ${MYDIR}/bakups +[ -d ${MYDIR}/bakups ] && mv ${MYDIR}/bakups ${MYDIR}/logs + +swapoff ${MYDIR}/swapfile diff --git a/app/files/tweaks/18_swapfile-u.txt b/app/files/tweaks/18_swapfile-u.txt index 60759e4..8024a75 100644 --- a/app/files/tweaks/18_swapfile-u.txt +++ b/app/files/tweaks/18_swapfile-u.txt @@ -3,25 +3,25 @@ show_message "REMOVE SWAP FILE ..." log_message "==========*********** UNINSTALL SWAP FILE ... ***********==========" if [ $TESTBKUPS -eq 1 ] then - cp /jci/scripts/stage_wifi.sh "${MYDIR}/bakups/test/stage_wifi_swap-before.sh" + cp ${STAGE_WIFI} "${MYDIR}/bakups/test/stage_wifi_swap-before.sh" fi -sed -i '/swap file/d' /jci/scripts/stage_wifi.sh -sed -i '/for USB in/d' /jci/scripts/stage_wifi.sh -sed -i '/USBPATH/d' /jci/scripts/stage_wifi.sh -sed -i '/USBDRV/d' /jci/scripts/stage_wifi.sh -sed -i '/SWAPFILE/d' /jci/scripts/stage_wifi.sh -sed -i '/rw,remount/d' /jci/scripts/stage_wifi.sh -sed -i '/ sleep 5/d' /jci/scripts/stage_wifi.sh -sed -i '/ do/d' /jci/scripts/stage_wifi.sh -sed -i '/ then/d' /jci/scripts/stage_wifi.sh -sed -i '/ break/d' /jci/scripts/stage_wifi.sh -sed -i '/ fi/d' /jci/scripts/stage_wifi.sh -sed -i '/ done/d' /jci/scripts/stage_wifi.sh +sed -i '/swap file/d' ${STAGE_WIFI} +sed -i '/for USB in/d' ${STAGE_WIFI} +sed -i '/USBPATH/d' ${STAGE_WIFI} +sed -i '/USBDRV/d' ${STAGE_WIFI} +sed -i '/SWAPFILE/d' ${STAGE_WIFI} +sed -i '/rw,remount/d' ${STAGE_WIFI} +sed -i '/ sleep 5/d' ${STAGE_WIFI} +sed -i '/ do/d' ${STAGE_WIFI} +sed -i '/ then/d' ${STAGE_WIFI} +sed -i '/ break/d' ${STAGE_WIFI} +sed -i '/ fi/d' ${STAGE_WIFI} +sed -i '/ done/d' ${STAGE_WIFI} sleep 2 -log_message "=== Deleted modifications from /jci/scripts/stage_wifi.sh ===" +log_message "=== Deleted modifications from ${STAGE_WIFI} ===" if [ $TESTBKUPS -eq 1 ] then - cp /jci/scripts/stage_wifi.sh "${MYDIR}/bakups/test/stage_wifi_swap-after.sh" + cp ${STAGE_WIFI} "${MYDIR}/bakups/test/stage_wifi_swap-after.sh" fi if [ -e /tmp/mnt/resources/swapfile ] then diff --git a/app/files/tweaks/18_swapfile2-i.txt b/app/files/tweaks/18_swapfile2-i.txt index f42c57c..7d0b335 100644 --- a/app/files/tweaks/18_swapfile2-i.txt +++ b/app/files/tweaks/18_swapfile2-i.txt @@ -20,51 +20,51 @@ chmod 600 -v /tmp/mnt/resources/swapfile >> "${MYDIR}/AIO_log.txt" mkswap /tmp/mnt/resources/swapfile swapon /tmp/mnt/resources/swapfile log_message "=== Swapfile added to resources ===" -sed -i '/swap file/d' /jci/scripts/stage_wifi.sh -sed -i '/for USB in/d' /jci/scripts/stage_wifi.sh -sed -i '/USBPATH/d' /jci/scripts/stage_wifi.sh -sed -i '/USBDRV/d' /jci/scripts/stage_wifi.sh -sed -i '/SWAPFILE/d' /jci/scripts/stage_wifi.sh -sed -i '/rw,remount/d' /jci/scripts/stage_wifi.sh -sed -i '/ sleep 5/d' /jci/scripts/stage_wifi.sh -sed -i '/ do/d' /jci/scripts/stage_wifi.sh -sed -i '/ then/d' /jci/scripts/stage_wifi.sh -sed -i '/ break/d' /jci/scripts/stage_wifi.sh -sed -i '/ fi/d' /jci/scripts/stage_wifi.sh -sed -i '/ done/d' /jci/scripts/stage_wifi.sh -log_message "=== First deleted modifications from /jci/scripts/stage_wifi.sh ===" +sed -i '/swap file/d' ${STAGE_WIFI} +sed -i '/for USB in/d' ${STAGE_WIFI} +sed -i '/USBPATH/d' ${STAGE_WIFI} +sed -i '/USBDRV/d' ${STAGE_WIFI} +sed -i '/SWAPFILE/d' ${STAGE_WIFI} +sed -i '/rw,remount/d' ${STAGE_WIFI} +sed -i '/ sleep 5/d' ${STAGE_WIFI} +sed -i '/ do/d' ${STAGE_WIFI} +sed -i '/ then/d' ${STAGE_WIFI} +sed -i '/ break/d' ${STAGE_WIFI} +sed -i '/ fi/d' ${STAGE_WIFI} +sed -i '/ done/d' ${STAGE_WIFI} +log_message "=== First deleted modifications from ${STAGE_WIFI} ===" # add commands for swap file to stage_wifi.sh log_message "=== Add commands for swap file to stage_wifi.sh ===" -if grep -Fq 'swap file' /jci/scripts/stage_wifi.sh +if grep -Fq 'swap file' ${STAGE_WIFI} then echo "exist" - log_message "=== Modifications for swapfile already in /jci/scripts/stage_wifi.sh ===" + log_message "=== Modifications for swapfile already in ${STAGE_WIFI} ===" else - echo '### find swap file' >> /jci/scripts/stage_wifi.sh - echo ' sleep 5' >> /jci/scripts/stage_wifi.sh - echo ' USBDRV="resources $(ls /mnt | grep sd)"' >> /jci/scripts/stage_wifi.sh - echo ' for USB in $USBDRV' >> /jci/scripts/stage_wifi.sh - echo ' do' >> /jci/scripts/stage_wifi.sh - echo ' USBPATH=/tmp/mnt/${USBDRV}' >> /jci/scripts/stage_wifi.sh - echo ' SWAPFILE="${USBPATH}"/swapfile' >> /jci/scripts/stage_wifi.sh - echo ' if [ -e "${SWAPFILE}" ]' >> /jci/scripts/stage_wifi.sh - echo ' then' >> /jci/scripts/stage_wifi.sh - echo ' mount -o rw,remount ${USBPATH}' >> /jci/scripts/stage_wifi.sh - echo ' mkswap ${SWAPFILE}' >> /jci/scripts/stage_wifi.sh - echo ' swapon ${SWAPFILE}' >> /jci/scripts/stage_wifi.sh - echo ' break' >> /jci/scripts/stage_wifi.sh - echo ' fi' >> /jci/scripts/stage_wifi.sh - echo ' done' >> /jci/scripts/stage_wifi.sh + echo '### find swap file' >> ${STAGE_WIFI} + echo ' sleep 5' >> ${STAGE_WIFI} + echo ' USBDRV="resources $(ls /mnt | grep sd)"' >> ${STAGE_WIFI} + echo ' for USB in $USBDRV' >> ${STAGE_WIFI} + echo ' do' >> ${STAGE_WIFI} + echo ' USBPATH=/tmp/mnt/${USBDRV}' >> ${STAGE_WIFI} + echo ' SWAPFILE="${USBPATH}"/swapfile' >> ${STAGE_WIFI} + echo ' if [ -e "${SWAPFILE}" ]' >> ${STAGE_WIFI} + echo ' then' >> ${STAGE_WIFI} + echo ' mount -o rw,remount ${USBPATH}' >> ${STAGE_WIFI} + echo ' mkswap ${SWAPFILE}' >> ${STAGE_WIFI} + echo ' swapon ${SWAPFILE}' >> ${STAGE_WIFI} + echo ' break' >> ${STAGE_WIFI} + echo ' fi' >> ${STAGE_WIFI} + echo ' done' >> ${STAGE_WIFI} sleep 1 - sed -i '/find swap file/ i\ ' /jci/scripts/stage_wifi.sh - log_message "=== Modifications for swapfile added to /jci/scripts/stage_wifi.sh ===" + sed -i '/find swap file/ i\ ' ${STAGE_WIFI} + log_message "=== Modifications for swapfile added to ${STAGE_WIFI} ===" fi df -h >> "${MYDIR}/AIO_log.txt" cat /proc/meminfo >> "${MYDIR}/AIO_log.txt" cat /proc/swaps >> "${MYDIR}/AIO_log.txt" cat /etc/fstab >> "${MYDIR}/AIO_log.txt" -cp /jci/scripts/stage_wifi.sh ${MYDIR}/bakups/test/stage_wifi_swap-after.sh +cp ${STAGE_WIFI} ${MYDIR}/bakups/test/stage_wifi_swap-after.sh log_message "=== Swap File Added To USB Drive ===" log_message "===========********** END INSTALLATION OF SWAP FILE **********===========" diff --git a/app/files/tweaks/19_speedo-i1.txt b/app/files/tweaks/19_speedo-i1.txt index 611e41d..e85199e 100644 --- a/app/files/tweaks/19_speedo-i1.txt +++ b/app/files/tweaks/19_speedo-i1.txt @@ -5,8 +5,8 @@ log_message "==========**************** INSTALL SPEEDOMETER *****************=== log_message "=== Begin Installation of Speedometer ===" if [ $TESTBKUPS -eq 1 ] then - cp /jci/scripts/stage_wifi.sh "${MYDIR}/bakups/test/stage_wifi_speedometer-before.sh" - cp /jci/opera/opera_dir/userjs/additionalApps.json "${MYDIR}/bakups/test/additionalApps_speedometer-1._before.json" + cp ${STAGE_WIFI} "${MYDIR}/bakups/test/stage_wifi_speedometer-before.sh" + [ -f ${ADDITIONAL_APPS_JSON} ] && cp ${ADDITIONAL_APPS_JSON} "${MYDIR}/bakups/test/additionalApps_speedometer-before.json" fi ### kills all WebSocket daemons @@ -24,51 +24,61 @@ rm -fr /jci/gui/addon-player rm -fr /jci/gui/addon-speedometer rm -fr /jci/gui/speedometer rm -fr /jci/gui/apps/_speedometer - -sed -i '/Speedo-Compass-Video/d' /jci/scripts/stage_wifi.sh -sed -i '/v3.2/d' /jci/scripts/stage_wifi.sh -sed -i '/Removed requirement/d' /jci/scripts/stage_wifi.sh -sed -i '/# mount /d' /jci/scripts/stage_wifi.sh -sed -i '/Added additional/d' /jci/scripts/stage_wifi.sh -sed -i '/get-vehicle-speed/d' /jci/scripts/stage_wifi.sh -sed -i '/get-vehicle-data-other/d' /jci/scripts/stage_wifi.sh -sed -i '/get-gps-data/d' /jci/scripts/stage_wifi.sh -sed -i '/Need to set defaults/d' /jci/scripts/stage_wifi.sh -sed -i '/myVideoList /d' /jci/scripts/stage_wifi.sh -sed -i '/playbackAction /d' /jci/scripts/stage_wifi.sh -sed -i '/playbackOption /d' /jci/scripts/stage_wifi.sh -sed -i '/playbackStatus /d' /jci/scripts/stage_wifi.sh -sed -i '/playback/d' /jci/scripts/stage_wifi.sh -sed -i '/myVideoList/d' /jci/scripts/stage_wifi.sh -sed -i '/Video player action watch/d' /jci/scripts/stage_wifi.sh -sed -i '/playback-action.sh/d' /jci/scripts/stage_wifi.sh -sed -i '/Log data collection/d' /jci/scripts/stage_wifi.sh -sed -i '/get-log-data.sh/d' /jci/scripts/stage_wifi.sh -sed -i '/addon-speedometer.sh &/d' /jci/scripts/stage_wifi.sh -sed -i '/addon-player.sh &/d' /jci/scripts/stage_wifi.sh -sed -i '/stage_vehSpeed.sh/d' /jci/scripts/stage_wifi.sh -sed -i '/mount of SD card/d' /jci/scripts/stage_wifi.sh -sed -i '/sleep 40/d' /jci/scripts/stage_wifi.sh -sed -i '/sleep 55/d' /jci/scripts/stage_wifi.sh -sed -i '/sleep 50/d' /jci/scripts/stage_wifi.sh -sed -i '/umount -l/d' /jci/scripts/stage_wifi.sh -sed -i '/sleep 25/d' /jci/scripts/stage_wifi.sh -sed -i '/sleep 4/d' /jci/scripts/stage_wifi.sh -sed -i '/sleep 6/d' /jci/scripts/stage_wifi.sh -sed -i '/55554/d' /jci/scripts/stage_wifi.sh -sed -i '/9969/d' /jci/scripts/stage_wifi.sh -sed -i '/## Speedometer/d' /jci/scripts/stage_wifi.sh +rm -fr /tmp/mnt/resources/aio/apps/_speedometer + +sed -i '/Speedo-Compass-Video/d' ${STAGE_WIFI} +sed -i '/v3.2/d' ${STAGE_WIFI} +sed -i '/Removed requirement/d' ${STAGE_WIFI} +sed -i '/# mount /d' ${STAGE_WIFI} +sed -i '/Added additional/d' ${STAGE_WIFI} +sed -i '/get-vehicle-speed/d' ${STAGE_WIFI} +sed -i '/get-vehicle-data-other/d' ${STAGE_WIFI} +sed -i '/get-gps-data/d' ${STAGE_WIFI} +sed -i '/Need to set defaults/d' ${STAGE_WIFI} +sed -i '/myVideoList /d' ${STAGE_WIFI} +sed -i '/playbackAction /d' ${STAGE_WIFI} +sed -i '/playbackOption /d' ${STAGE_WIFI} +sed -i '/playbackStatus /d' ${STAGE_WIFI} +sed -i '/playback/d' ${STAGE_WIFI} +sed -i '/myVideoList/d' ${STAGE_WIFI} +sed -i '/Video player action watch/d' ${STAGE_WIFI} +sed -i '/playback-action.sh/d' ${STAGE_WIFI} +sed -i '/Log data collection/d' ${STAGE_WIFI} +sed -i '/get-log-data.sh/d' ${STAGE_WIFI} +sed -i '/addon-speedometer.sh &/d' ${STAGE_WIFI} +sed -i '/addon-player.sh &/d' ${STAGE_WIFI} +sed -i '/stage_vehSpeed.sh/d' ${STAGE_WIFI} +sed -i '/mount of SD card/d' ${STAGE_WIFI} +sed -i '/sleep 40/d' ${STAGE_WIFI} +sed -i '/sleep 55/d' ${STAGE_WIFI} +sed -i '/sleep 50/d' ${STAGE_WIFI} +sed -i '/umount -l/d' ${STAGE_WIFI} +sed -i '/sleep 25/d' ${STAGE_WIFI} +sed -i '/sleep 4/d' ${STAGE_WIFI} +sed -i '/sleep 6/d' ${STAGE_WIFI} +sed -i '/55554/d' ${STAGE_WIFI} +sed -i '/9969/d' ${STAGE_WIFI} +sed -i '/## Speedometer/d' ${STAGE_WIFI} # delete empty lines -sed -i '/^ *$/ d' /jci/scripts/stage_wifi.sh -sed -i '/#!/ a\ ' /jci/scripts/stage_wifi.sh +sed -i '/^ *$/ d' ${STAGE_WIFI} +sed -i '/#!/ a\ ' ${STAGE_WIFI} # Remove startup file from userjs rm -f /jci/opera/opera_dir/userjs/speedometer-startup.js rm -f /jci/opera/opera_dir/userjs/speedometer.js +log_message "=== Remover Old Speedometer Files ===" + +cp -a ${MYDIR}/config/speedometer/jci/gui/apps/_speedometer ${AIO_APP_DIR} +log_message "=== Copied Speedometer Files ===" + +# symlink to resources +if [ $APPS2RESOURCES -eq 1 ] +then + ln -sf /tmp/mnt/resources/aio/apps/_speedometer /jci/gui/apps/_speedometer + log_message "=== Created Symlink To Resources Partition ===" +fi -cp -a ${MYDIR}/config/speedometer/jci/gui/apps/* /jci/gui/apps/ -log_message "=== Copied folder /jci/gui/apps/_speedometer ===" find /jci/gui/apps/_*/ -type f -name '*.js' -exec chmod 755 {} \; find /jci/gui/apps/_*/ -type f -name '*.sh' -exec chmod 755 {} \; @@ -101,27 +111,27 @@ else fi # check for 1st line of stage_wifi.sh -if grep -Fq "#!/bin/sh" /jci/scripts/stage_wifi.sh +if grep -Fq "#!/bin/sh" ${STAGE_WIFI} then log_message "=== 1st line of stage_wifi.sh is OK ===" else - echo "#!/bin/sh" > /jci/scripts/stage_wifi.sh + echo "#!/bin/sh" > ${STAGE_WIFI} log_message "=== Missing 1st line of stage_wifi.sh, copied new one ===" fi # add commands for speedometer to stage_wifi.sh -if [ -e /jci/scripts/stage_wifi.sh ] +if [ -e ${STAGE_WIFI} ] then - if grep -Fq "speedometer.sh &" /jci/scripts/stage_wifi.sh + if grep -Fq "speedometer.sh &" ${STAGE_WIFI} then - log_message "=== Speedometer entry already exists in /jci/scripts/stage_wifi.sh ===" + log_message "=== Speedometer entry already exists in ${STAGE_WIFI} ===" else - sed -i '/#!/ a\### Speedometer' /jci/scripts/stage_wifi.sh + sed -i '/#!/ a\### Speedometer' ${STAGE_WIFI} sleep 1 - sed -i '/Speedometer/ i\ ' /jci/scripts/stage_wifi.sh - sed -i '/### Speedometer/ a\/jci/gui/addon-common/websocketd --port=9969 /jci/gui/apps/_speedometer/sh/speedometer.sh &' /jci/scripts/stage_wifi.sh - log_message "=== Added speedometer entry to /jci/scripts/stage_wifi.sh ===" - cp /jci/scripts/stage_wifi.sh "${MYDIR}/bakups/test/stage_wifi_speedometer-after.sh" + sed -i '/Speedometer/ i\ ' ${STAGE_WIFI} + sed -i '/### Speedometer/ a\/jci/gui/addon-common/websocketd --port=9969 /jci/gui/apps/_speedometer/sh/speedometer.sh &' ${STAGE_WIFI} + log_message "=== Added speedometer entry to ${STAGE_WIFI} ===" + cp ${STAGE_WIFI} "${MYDIR}/bakups/test/stage_wifi_speedometer-after.sh" fi fi @@ -133,19 +143,12 @@ then find /jci/opera/opera_dir/userjs/ -type f -name '*.js' -exec chmod 755 {} \; fi -# create additionalApps.json file from scratch if the file does not exist -if [ ! -e /jci/opera/opera_dir/userjs/additionalApps.json ] -then - echo "[" > /jci/opera/opera_dir/userjs/additionalApps.json - echo "]" >> /jci/opera/opera_dir/userjs/additionalApps.json - chmod 755 /jci/opera/opera_dir/userjs/additionalApps.json - log_message "=== Created additionalApps.json ===" -fi - sed -i 's/var speedMod = false;/var speedMod = true;/g' /jci/gui/apps/_speedometer/js/speedometer-startup.js +create_app_json + # Remove old json entries -if ! grep -q "speedometer-startup.js" /jci/opera/opera_dir/userjs/additionalApps.json +if grep -q "_speedometer" ${ADDITIONAL_APPS_JSON} && ! grep -q "speedometer-startup.js" ${ADDITIONAL_APPS_JSON} then remove_app_json "_speedometer" fi diff --git a/app/files/tweaks/19_speedo-i2.txt b/app/files/tweaks/19_speedo-i2.txt index dbfc4fe..55e9b98 100644 --- a/app/files/tweaks/19_speedo-i2.txt +++ b/app/files/tweaks/19_speedo-i2.txt @@ -50,8 +50,8 @@ then fi if [ $TESTBKUPS -eq 1 ] then - cp -a /jci/gui/apps/_speedometer/js/speedometer-startup.js ${MYDIR}/bakups/test/ - cp -a /jci/scripts/stage_wifi.sh ${MYDIR}/bakups/test/stage_wifi-after_speedo.sh + cp /jci/gui/apps/_speedometer/js/speedometer-startup.js ${MYDIR}/bakups/test/ + cp ${STAGE_WIFI} ${MYDIR}/bakups/test/stage_wifi-after_speedo.sh fi log_message "=======********** END INSTALLATION OF SPEEDOMETER **********=======" diff --git a/app/files/tweaks/19_speedo-u.txt b/app/files/tweaks/19_speedo-u.txt index 8fe76e1..e43a39e 100644 --- a/app/files/tweaks/19_speedo-u.txt +++ b/app/files/tweaks/19_speedo-u.txt @@ -6,95 +6,79 @@ log_message "=== kill all WebSocket daemons pkill websocketd if [ $TESTBKUPS -eq 1 ] then - cp /jci/scripts/stage_wifi.sh "${MYDIR}/bakups/test/stage_wifi_speedometer-before.sh" - cp /jci/opera/opera_dir/userjs/additionalApps.json "${MYDIR}/bakups/test/additionalApps_speedometer-1._before.json" -fi -log_message "=== check for 1st line of stage_wifi.sh ===" -if grep -Fq "#!/bin/sh" /jci/scripts/stage_wifi.sh -then - echo "OK" - log_message "=== 1st line of stage_wifi.sh is OK ===" -else - cp -a "${MYDIR}/config_org/speedometer/stage_wifi.sh" /jci/scripts/ - log_message "=== Missing 1st line of stage_wifi.sh, copied new one ===" + cp ${STAGE_WIFI} "${MYDIR}/bakups/test/stage_wifi_speedometer-before.sh" + [ -f ${ADDITIONAL_APPS_JSON} ] && cp ${ADDITIONAL_APPS_JSON} "${MYDIR}/bakups/test/additionalApps_speedometer-before.json" fi -sed -i '/Speedo-Compass-Video_Tweak/d' /jci/scripts/stage_wifi.sh -sed -i '/v3.2/d' /jci/scripts/stage_wifi.sh -sed -i '/Removed requirement/d' /jci/scripts/stage_wifi.sh -sed -i '/# mount /d' /jci/scripts/stage_wifi.sh -sed -i '/Added additional/d' /jci/scripts/stage_wifi.sh -sed -i '/get-vehicle-speed.sh/d' /jci/scripts/stage_wifi.sh -sed -i '/get-vehicle-data-other.sh/d' /jci/scripts/stage_wifi.sh -sed -i '/get-gps-data.sh/d' /jci/scripts/stage_wifi.sh -sed -i '/Need to set defaults/d' /jci/scripts/stage_wifi.sh -sed -i '/myVideoList /d' /jci/scripts/stage_wifi.sh -sed -i '/playbackAction /d' /jci/scripts/stage_wifi.sh -sed -i '/playbackOption /d' /jci/scripts/stage_wifi.sh -sed -i '/playbackStatus /d' /jci/scripts/stage_wifi.sh -sed -i '/playback/d' /jci/scripts/stage_wifi.sh -sed -i '/myVideoList/d' /jci/scripts/stage_wifi.sh -sed -i '/Video player action watch/d' /jci/scripts/stage_wifi.sh -sed -i '/playback-action.sh/d' /jci/scripts/stage_wifi.sh -sed -i '/Log data collection/d' /jci/scripts/stage_wifi.sh -sed -i '/get-log-data/d' /jci/scripts/stage_wifi.sh -sed -i '/### Speedometer/d' /jci/scripts/stage_wifi.sh -sed -i '/addon-speedometer.sh &/d' /jci/scripts/stage_wifi.sh -sed -i '/speedometer.sh &/d' /jci/scripts/stage_wifi.sh -sed -i '/addon-player.sh &/d' /jci/scripts/stage_wifi.sh -sed -i '/mount of SD card/d' /jci/scripts/stage_wifi.sh -sed -i '/umount -l/d' /jci/scripts/stage_wifi.sh -sed -i '/sleep 40/d' /jci/scripts/stage_wifi.sh -sed -i '/sleep 55/d' /jci/scripts/stage_wifi.sh -sed -i '/sleep 50/d' /jci/scripts/stage_wifi.sh -sed -i '/sleep 25/d' /jci/scripts/stage_wifi.sh -sed -i '/sleep 4/d' /jci/scripts/stage_wifi.sh -sed -i '/sleep 6/d' /jci/scripts/stage_wifi.sh -sed -i '/9969/d' /jci/scripts/stage_wifi.sh -sed -i '/55554/d' /jci/scripts/stage_wifi.sh +sed -i '/Speedo-Compass-Video_Tweak/d' ${STAGE_WIFI} +sed -i '/v3.2/d' ${STAGE_WIFI} +sed -i '/Removed requirement/d' ${STAGE_WIFI} +sed -i '/# mount /d' ${STAGE_WIFI} +sed -i '/Added additional/d' ${STAGE_WIFI} +sed -i '/get-vehicle-speed.sh/d' ${STAGE_WIFI} +sed -i '/get-vehicle-data-other.sh/d' ${STAGE_WIFI} +sed -i '/get-gps-data.sh/d' ${STAGE_WIFI} +sed -i '/Need to set defaults/d' ${STAGE_WIFI} +sed -i '/myVideoList /d' ${STAGE_WIFI} +sed -i '/playbackAction /d' ${STAGE_WIFI} +sed -i '/playbackOption /d' ${STAGE_WIFI} +sed -i '/playbackStatus /d' ${STAGE_WIFI} +sed -i '/playback/d' ${STAGE_WIFI} +sed -i '/myVideoList/d' ${STAGE_WIFI} +sed -i '/Video player action watch/d' ${STAGE_WIFI} +sed -i '/playback-action.sh/d' ${STAGE_WIFI} +sed -i '/Log data collection/d' ${STAGE_WIFI} +sed -i '/get-log-data/d' ${STAGE_WIFI} +sed -i '/### Speedometer/d' ${STAGE_WIFI} +sed -i '/addon-speedometer.sh &/d' ${STAGE_WIFI} +sed -i '/speedometer.sh &/d' ${STAGE_WIFI} +sed -i '/addon-player.sh &/d' ${STAGE_WIFI} +sed -i '/mount of SD card/d' ${STAGE_WIFI} +sed -i '/umount -l/d' ${STAGE_WIFI} +sed -i '/sleep 40/d' ${STAGE_WIFI} +sed -i '/sleep 55/d' ${STAGE_WIFI} +sed -i '/sleep 50/d' ${STAGE_WIFI} +sed -i '/sleep 25/d' ${STAGE_WIFI} +sed -i '/sleep 4/d' ${STAGE_WIFI} +sed -i '/sleep 6/d' ${STAGE_WIFI} +sed -i '/9969/d' ${STAGE_WIFI} +sed -i '/55554/d' ${STAGE_WIFI} ADDIT_APPS=0 -if [ -e /jci/opera/opera_dir/userjs/CustomApplicationsProxy.js ] || [ -e /jci/opera/opera_dir/userjs/nativeApps.js ] -then - log_message "=== Found CASDK ===" - ADDIT_APPS=1 -elif grep -Fq "_aiotweaks" /jci/opera/opera_dir/userjs/additionalApps.json -then - log_message "=== Found AIOTweaksApp entry in additionalApps.json ===" - ADDIT_APPS=1 -elif grep -Fq "_androidauto" /jci/opera/opera_dir/userjs/additionalApps.json -then - log_message "=== Found androidauto entry in additionalApps.json ===" - ADDIT_APPS=1 -elif grep -Fq "_videoplayer" /jci/opera/opera_dir/userjs/additionalApps.json -then - log_message "=== Found videoplayer entry in additionalApps.json ===" - ADDIT_APPS=1 -elif grep -Fq "_mzdmeter" /jci/opera/opera_dir/userjs/additionalApps.json -then - log_message "=== Found mzd meter entry in additionalApps.json ===" - ADDIT_APPS=1 -fi -if [ $ADDIT_APPS -eq 0 ] -then - log_message "=== No more entrys in additionalApps.json, files will be deleted ===" - rm -f /jci/opera/opera_dir/userjs/additionalApps.* - rm -f /jci/opera/opera_dir/userjs/app.js -else - log_message "=== delete speedometer entry from additionalApps.json ===" - remove_app_json "_speedometer" -fi -### Check for mzdmeter -if [ -e /jci/gui/apps/_mzdmeter/js/mzdmeter.js ] +if [ -e ${ADDITIONAL_APPS_JSON} ] then - sed -i "/.. Remove Speed ../,/.. End Speed ../d" /jci/gui/apps/_speedometer/js/speedometer-startup.js - sed -i 's/var enableSmallSbSpeedo = true;/var enableSmallSbSpeedo = false;/g' /jci/gui/apps/_speedometer/js/speedometer-startup.js - log_message "=== mzdmeter App found remove speedometer startup ===" -else - rm -f /jci/opera/opera_dir/userjs/speedometer-startup.js - log_message "=== Removed Speedometer startup ===" + if [ -e /jci/opera/opera_dir/userjs/CustomApplicationsProxy.js ] || [ -e /jci/opera/opera_dir/userjs/nativeApps.js ] + then + log_message "=== Found CASDK ===" + ADDIT_APPS=1 + elif grep -Fq "_aiotweaks" ${ADDITIONAL_APPS_JSON} + then + log_message "=== Found AIOTweaksApp entry in additionalApps.json ===" + ADDIT_APPS=1 + elif grep -Fq "_androidauto" ${ADDITIONAL_APPS_JSON} + then + log_message "=== Found androidauto entry in additionalApps.json ===" + ADDIT_APPS=1 + elif grep -Fq "_videoplayer" ${ADDITIONAL_APPS_JSON} + then + log_message "=== Found videoplayer entry in additionalApps.json ===" + ADDIT_APPS=1 + elif grep -Fq "_mzdmeter" ${ADDITIONAL_APPS_JSON} + then + log_message "=== Found mzd meter entry in additionalApps.json ===" + ADDIT_APPS=1 + fi + if [ $ADDIT_APPS -eq 0 ] + then + log_message "=== No more entrys in additionalApps.json, files will be deleted ===" + rm -f /jci/opera/opera_dir/userjs/additionalApps.* + rm -f /jci/opera/opera_dir/userjs/app.js + else + log_message "=== delete speedometer entry from additionalApps.json ===" + remove_app_json "_speedometer" + fi fi -if [ ! -e /jci/opera/opera_dir/userjs/additionalApps.json ] +if [ ! -e ${ADDITIONAL_APPS_JSON} ] then rm -fr /jci/gui/addon-common log_message "=== Removed /jci/gui/addon-common because no more AIO apps ===" @@ -104,8 +88,10 @@ rm -fr /jci/gui/addon-player rm -fr /jci/gui/addon-speedometer rm -fr /jci/gui/apps/_speedometer rm -fr /jci/gui/speedometer +rm -fr /tmp/mnt/resources/aio/apps/_speedometer rm -f /jci/opera/opera_dir/userjs/addon-startup.js -rm -f /jci/scripts/stage_wifi.sh.bak? +rm -f /jci/opera/opera_dir/userjs/speedometer-startup.js +rm -f ${STAGE_WIFI}.bak? rm -f /jci/scripts/get-vehicle-speed.sh rm -f /jci/scripts/stage_vehSpeed.sh rm -f /jci/scripts/get-vehicle-fuel.sh @@ -116,7 +102,7 @@ rm -f /jci/scripts/get-temp.sh if [ $TESTBKUPS -eq 1 ] then - cp /jci/scripts/stage_wifi.sh "${MYDIR}/bakups/test/stage_wifi_speedometer-after.sh" + cp ${STAGE_WIFI} "${MYDIR}/bakups/test/stage_wifi_speedometer-after.sh" fi log_message "=======************ END UNISTALLATION OF SPEEDOMETER *************=======" diff --git a/app/files/tweaks/20_date-iv3.3.txt b/app/files/tweaks/20_date-iv3.3.txt index b4c3a7a..63310e5 100644 --- a/app/files/tweaks/20_date-iv3.3.txt +++ b/app/files/tweaks/20_date-iv3.3.txt @@ -119,15 +119,12 @@ else # if [ $DATE_FORMAT -eq 0 ] fi # StatusBarCtrl.js is the file that needs to be compatability checked because of minor changes in FW v59+ -# Compatibility has been fixed now compatible with all FW v55 - v70.00.000 +# Compatibility has been fixed now compatible with all FW v55 - v70.00.021 # if [ $STATUSBAR_COPY -eq 1 ] if [ $COMPAT_GROUP -le 6 ] then cp -a "${MYDIR}/config/date-to-statusbar_mod/jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js" /jci/gui/common/controls/StatusBar/js log_message "=== Copied StatusBarCtrl.js ===" -# elif [ $STATUSBAR_COPY -eq 2 ] -# then -# cp -a "${MYDIR}/config/date-to-statusbar_mod/jci/gui/common/controls/StatusBar/js/StatusBarCtrl.v2.2.v59.js" /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js else # only v70.00.100+ will fail because compatibility is unknown log_message "***** date_to_statusbar_mod v3.3 not compatible to your FW, no installation made! ******" log_message "*********** Please email your FW version:${CMU_SW_VER} to aio@mazdatweaks.com **********" diff --git a/app/files/tweaks/20_date-u.txt b/app/files/tweaks/20_date-u.txt index 1752889..c88a515 100644 --- a/app/files/tweaks/20_date-u.txt +++ b/app/files/tweaks/20_date-u.txt @@ -2,53 +2,31 @@ show_message "REMOVE STATUSBAR TWEAKS ..." log_message "=======********* UNINSTALL STATUSBAR TWEAKS ... **********========" -if [ -e /jci/gui/common/controls/Sbn/css/SbnCtrl.css.org ] - then - cp -a /jci/gui/common/controls/Sbn/css/SbnCtrl.css.org /jci/gui/common/controls/Sbn/css/SbnCtrl.css - log_message "=== Restored backup from SbnCtrl.css.org ===" - else - # "cp -a ${MYDIR}/config_org/date-to-statusbar_mod/jci/gui/common/controls/Sbn/css/SbnCtrl.css" /jci/gui/common/controls/Sbn/css/SbnCtrl.css - # log_message "=== No backup found, copied original SbnCtrl.css from SD card ===" - log_message "=== No backup found for SbnCtrl.css ===" +if ! (restore_org /jci/gui/common/controls/Sbn/css/SbnCtrl.css) +then + log_message "=== No backup found for SbnCtrl.css ===" fi -if [ -e /jci/gui/common/controls/StatusBar/css/StatusBarCtrl.css.org ] - then - cp -a /jci/gui/common/controls/StatusBar/css/StatusBarCtrl.css.org /jci/gui/common/controls/StatusBar/css/StatusBarCtrl.css - log_message "=== Restored backup from StatusBarCtrl.css.org ===" - else - # cp -a "${MYDIR}/config_org/date-to-statusbar_mod/jci/gui/common/controls/StatusBar/css/StatusBarCtrl.css" /jci/gui/common/controls/StatusBar/css/StatusBarCtrl.css - # log_message "=== No backup found, copied original StatusBarCtrl.css from SD card ==" - log_message "=== No backup found for StatusBarCtrl.css ===" +if ! (restore_org /jci/gui/common/controls/StatusBar/css/StatusBarCtrl.css) +then + log_message "=== No backup found for StatusBarCtrl.css ===" fi -if [ -e /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js.org ] - then - cp -a /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js.org /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js - log_message "=== Restored backup from StatusBarCtrl.js.org ===" - else - log_message "=== No backup found, No changes were made to StatusBarCtrl.js ===" +if ! (restore_org /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js) +then + log_message "=== No backup found, No changes were made to StatusBarCtrl.js ===" fi -if [ -e /jci/gui/common/controls/StatusBar/images/StatusBarBg.png.org ] +if ! (restore_org /jci/gui/common/controls/StatusBar/images/StatusBarBg.png) then - cp -a /jci/gui/common/controls/StatusBar/images/StatusBarBg.png.org /jci/gui/common/controls/StatusBar/images/StatusBarBg.png - log_message "=== Restored backup from StatusBarBg.png.org ===" -else - cp -a "${MYDIR}/config_org/date-to-statusbar_mod/jci/gui/common/controls/StatusBar/images/StatusBarBg.png" /jci/gui/common/controls/StatusBar/images/ - log_message "=== Copied original StatusBarBg.png from SD card ===" + cp -a "${MYDIR}/config_org/date-to-statusbar_mod/jci/gui/common/controls/StatusBar/images/StatusBarBg.png" /jci/gui/common/controls/StatusBar/images/ + log_message "=== Copied original StatusBarBg.png from USB Drive ===" fi -if [ -e /jci/gui/common/images/icons/IcnSbRoaming.png.org ] - then - cp -a /jci/gui/common/images/icons/IcnSbRoaming.png.org /jci/gui/common/images/icons/IcnSbRoaming.png - log_message "=== Restored backup from IcnSbRoaming.png.org ===" - else - cp -a "${MYDIR}/config_org/date-to-statusbar_mod/jci/gui/common/images/icons/IcnSbRoaming.png" /jci/gui/common/images/icons/ - log_message "=== Copied original IcnSbRoaming.png from SD card ===" +if ! (restore_org /jci/gui/common/images/icons/IcnSbRoaming.png) +then + cp -a "${MYDIR}/config_org/date-to-statusbar_mod/jci/gui/common/images/icons/IcnSbRoaming.png" /jci/gui/common/images/icons/ + log_message "=== Copied original IcnSbRoaming.png from USB Drive ===" fi -if [ -e /jci/gui/framework/js/Utility.js.org ] - then - cp -a /jci/gui/framework/js/Utility.js.org /jci/gui/framework/js/Utility.js - log_message "=== Restored backup from Utility.js.org ===" - else - log_message "=== No backup found, no changes were made to Utility.js ===" +if ! (restore_org /jci/gui/framework/js/Utility.js) +then + log_message "=== No backup found, no changes were made to Utility.js ===" fi rm -f /jci/gui/common/controls/Sbn/css/SbnCtrl.all.css diff --git a/app/files/tweaks/20_date2status-u.txt b/app/files/tweaks/20_date2status-u.txt index 252f3bc..8b32f68 100644 --- a/app/files/tweaks/20_date2status-u.txt +++ b/app/files/tweaks/20_date2status-u.txt @@ -3,82 +3,30 @@ show_message "REMOVE DATE_TO_STATUSBAR_MOD ..." log_message "====*********** UNINSTALL DATE_TO_STATUSBAR_MOD ... ***********====" # Restore Utility.js From .org Backup -if [ -e /jci/gui/framework/js/Utility.js.org ] +if ! (restore_org /jci/gui/framework/js/Utility.js) then - cp -a /jci/gui/framework/js/Utility.js.org /jci/gui/framework/js/Utility.js - log_message "=== Restored Utility.js From Backup Utility.js.org ===" + log_message "=== No backup found for Utility.js, no changes were made ===" fi # Remove AIO CSS From StatusBarCtrl & SbnCtrl remove_aio_css /jci/gui/common/controls/Sbn/css/SbnCtrl.css D2SB remove_aio_css /jci/gui/common/controls/StatusBar/css/StatusBarCtrl.css D2SB # StatusBarCtrl.js restore from .org backup -if [ -e /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js.org ] +if ! (restore_org /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js) then - cp -a /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js.org /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js - log_message "=== Restored backup from StatusBarCtrl.js.org ===" -else - # cp -a ${MYDIR}/config_org/date-to-statusbar_mod/jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js /jci/gui/common/controls/StatusBar/js/StatusBarCtrl.js - # log_message "=== No backup found, copied original StatusBarCtrl.js from SD card ===" log_message "=== No backup found for StatusBarCtrl.js, no changes were made ===" fi ## Restore Image Files -if [ -e /jci/gui/common/images/icons/IcnSbRoaming.png.org ] +if ! (restore_org /jci/gui/common/images/icons/IcnSbRoaming.png) then - cp -a /jci/gui/common/images/icons/IcnSbRoaming.png.org /jci/gui/common/images/icons/IcnSbRoaming.png - log_message "=== Restored backup from IcnSbRoaming.png.org ===" -else cp -a ${MYDIR}/config_org/date-to-statusbar_mod/jci/gui/common/images/icons/IcnSbRoaming.png /jci/gui/common/images/icons/ - log_message "=== No backup found, copied original IcnSbRoaming.png from SD card ===" + log_message "=== No backup found, copied original IcnSbRoaming.png from USB Drive ===" fi -if [ -e /jci/gui/common/controls/StatusBar/images/StatusBarBg.png.org ] +if ! (restore_org /jci/gui/common/controls/StatusBar/images/StatusBarBg.png) then - cp -a /jci/gui/common/controls/StatusBar/images/StatusBarBg.png.org /jci/gui/common/controls/StatusBar/images/StatusBarBg.png - log_message "=== Restored backup from StatusBarBg.png.org ===" -else cp -a ${MYDIR}/config_org/date-to-statusbar_mod/jci/gui/common/controls/StatusBar/images/StatusBarBg.png /jci/gui/common/controls/StatusBar/images/ - log_message "=== No backup found, copied original StatusBarBg.png from SD card ===" -fi - -##### Remove Old Installs - Check Each File For Remaining Code -##### The folowing search for code snippets not found in original files -if grep -Fq "Utility.prototype.formatDateCustom" /jci/gui/framework/js/Utility.js -then - log_message "=== Previous D2SB Install Found in Utility.js ===" - if [ -e /jci/gui/framework/js/Utility.js.org ] - then - cp -a /jci/gui/framework/js/Utility.js.org /jci/gui/framework/js/Utility.js - log_message "=== Restored backup from Utility.js.org ===" - else - # cp -a ${MYDIR}/config_org/date-to-statusbar_mod/jci/gui/framework/js/Utility.js /jci/gui/framework/js/ - # log_message "=== No backup found, copied original Utility.js from SD card ===" - log_message "=== No backup found for Utility.js, no changes were made ===" - fi -fi -if grep -Fq "/* background-image: url(../images/StatusNotificationBg.png); */" /jci/gui/common/controls/Sbn/css/SbnCtrl.css -then - log_message "=== Previous D2SB Install Found in SbnCtrl.css ===" - if [ -e /jci/gui/common/controls/Sbn/css/SbnCtrl.css.org ] - then - cp -a /jci/gui/common/controls/Sbn/css/SbnCtrl.css.org /jci/gui/common/controls/Sbn/css/SbnCtrl.css - log_message "=== Restored backup from SbnCtrl.css.org ===" - else - cp -a ${MYDIR}/config_org/date-to-statusbar_mod/jci/gui/common/controls/Sbn/css/SbnCtrl.${statusbar_copy_file}.css /jci/gui/common/controls/Sbn/css/ - log_message "=== No backup found, copied original SbnCtrl.css from SD card ===" - fi -fi -if grep -Fq "StatusBarCtrlDate" /jci/gui/common/controls/StatusBar/css/StatusBarCtrl.css -then - log_message "=== Previous D2SB Install Found in StatusBarCtrl.css ===" - if [ -e /jci/gui/common/controls/StatusBar/css/StatusBarCtrl.css.org ] - then - cp -a /jci/gui/common/controls/StatusBar/css/StatusBarCtrl.css.org /jci/gui/common/controls/StatusBar/css/StatusBarCtrl.css - log_message "=== Restored backup from StatusBarCtrl.css.org ===" - else - cp -a ${MYDIR}/config_org/date-to-statusbar_mod/jci/gui/common/controls/StatusBar/css/StatusBarCtrl.${statusbar_copy_file}.css /jci/gui/common/controls/StatusBar/css/StatusBarCtrl.css - log_message "=== No backup found, copied original StatusBarCtrl.css from SD card ===" - fi + log_message "=== No backup found, copied original StatusBarBg.png from USB Drive ===" fi log_message "========******* END UNINSTALLATION OF DATE_TO_STATUSBAR_MOD ******=======" diff --git a/app/files/tweaks/20_mainmenu-i.txt b/app/files/tweaks/20_mainmenu-i.txt index fe6b135..8fae6c3 100644 --- a/app/files/tweaks/20_mainmenu-i.txt +++ b/app/files/tweaks/20_mainmenu-i.txt @@ -139,7 +139,7 @@ log_message "=== Modified MainMenuCtrl.css if [ $TESTBKUPS -eq 1 ] then - cp -a /jci/gui/apps/system/controls/MainMenu/css/MainMenuCtrl.css "${MYDIR}/bakups/test/MainMenuCtrl_after.css" + cp /jci/gui/apps/system/controls/MainMenu/css/MainMenuCtrl.css "${MYDIR}/bakups/test/MainMenuCtrl_after.css" fi log_message "=====********** END INSTALLATION OF MAIN MENU TWEAKS **********=====" diff --git a/app/files/tweaks/20_uistyle-i.txt b/app/files/tweaks/20_uistyle-i.txt index 4452f0b..ba93ee8 100644 --- a/app/files/tweaks/20_uistyle-i.txt +++ b/app/files/tweaks/20_uistyle-i.txt @@ -74,8 +74,8 @@ then fi if [ $TESTBKUPS -eq 1 ] then - cp -a /jci/gui/common/controls/List2/css/List2Ctrl.css "${MYDIR}/bakups/test/List2Ctrl_after.css" - cp -a /jci/gui/common/controls/NowPlaying4/css/NowPlaying4Ctrl.css "${MYDIR}/bakups/test/NowPlaying4Ctrl_after.css" + cp /jci/gui/common/controls/List2/css/List2Ctrl.css "${MYDIR}/bakups/test/List2Ctrl_after.css" + cp /jci/gui/common/controls/NowPlaying4/css/NowPlaying4Ctrl.css "${MYDIR}/bakups/test/NowPlaying4Ctrl_after.css" fi log_message "=== Modified NowPlaying4Ctrl.css ===" log_message "=== Added CSS For UI Style Tweaks ===" diff --git a/app/files/tweaks/21_colors-i.txt b/app/files/tweaks/21_colors-i.txt new file mode 100644 index 0000000..88196b5 --- /dev/null +++ b/app/files/tweaks/21_colors-i.txt @@ -0,0 +1,16 @@ +show_message "INSTALL ${COLORTHEME} CUSTOM INFOTAINMENT COLOR THEME ..." +log_message "=====****** INSTALL ${COLORTHEME} CUSTOM INFOTAINMENT COLOR THEME ... *******=====" + +cp -a ${MYDIR}/config/color-schemes/${COLORTHEME}/jci / && log_message "=== COLORTHEME = ${COLORTHEME} ===" + +rm -f /jci/gui/common/images/*.aio + +# Change NAV App color scheme if Blue is chosen +if [ ${COLORTHEME} = "Blue" ] && [ -e ${MYDIR}/config/color-schemes/Blue/_skin_jci_bluedemo.zip ] +then + cp -a ${MYDIR}/config/color-schemes/Blue/_skin_jci_bluedemo.zip /jci/nng/ux/ + log_message "=== Change NAV App color scheme to Blue too ===" +fi + +log_message "=====******** END INSTALLATION OF ${COLORTHEME} CUSTOM COLOR THEME *********======" +log_message " " diff --git a/app/files/tweaks/21_colors-u.txt b/app/files/tweaks/21_colors-u.txt index 979c11f..33348e2 100644 --- a/app/files/tweaks/21_colors-u.txt +++ b/app/files/tweaks/21_colors-u.txt @@ -1,27 +1,15 @@ # remove custom infotainment colors - back to original red scheme, speedometer too -show_message "REMOVE CUSTOM INFOTAINMENT COLORS (BACK TO RED) ..." +show_message "REMOVE CUSTOM INFOTAINMENT COLORS\n(BACK TO RED) ..." log_message "===*** UNINSTALL CUSTOM INFOTAINMENT COLOR SCHEME (BACK TO RED)... ***===" -cp -a ${MYDIR}/config/color-schemes/Red/jci / -if [ -d /jci/gui/apps/_speedometer ] -then - cp -a ${MYDIR}/config/color-schemes/speedometer/Red/* /jci/gui/apps/_speedometer/templates/SpeedoMeter/images/ - log_message "=== Speedometer to red again ===" -fi +cp -a ${MYDIR}/config/color-schemes/Red/jci / && log_message "=== Original Red Color Scheme Restored ===" + if [ -e /jci/nng/ux/_skin_jci_bluedemo.zip ] then rm -f /jci/nng/ux/_skin_jci_bluedemo.zip log_message "=== Deleted blue scheme for NAV App too, should be red again ===" fi -rm -f /jci/gui/common/images/blue.aio -rm -f /jci/gui/common/images/green.aio -rm -f /jci/gui/common/images/orange.aio -rm -f /jci/gui/common/images/pink.aio -rm -f /jci/gui/common/images/purple.aio -rm -f /jci/gui/common/images/silver.aio -rm -f /jci/gui/common/images/yellow.aio -log_message "=== Set theme colors-back to original red scheme, speedometer too ===" +rm -f /jci/gui/common/images/*.aio -log_message "=== End Restoring Original Red Color Scheme ===" log_message "===***** END UNINSTALLATION OF CUSTOM INFOTAINMENT COLOR SCHEME ******===" log_message " " diff --git a/app/files/tweaks/22_fuel-u.txt b/app/files/tweaks/22_fuel-u.txt index 4266d61..938ea85 100644 --- a/app/files/tweaks/22_fuel-u.txt +++ b/app/files/tweaks/22_fuel-u.txt @@ -2,38 +2,18 @@ show_message "REMOVE FUEL CONSUMPTION TWEAK ..." log_message "===========****** UNINSTALL FUEL CONSUMPTION TWEAK ... *******==========" -if [ $TESTBKUPS -eq 1 ] -then - cp /jci/gui/apps/ecoenergy/controls/FuelConsumption/css/FuelConsumptionCtrl.css "${MYDIR}/bakups/test/FuelConsumptionCtrl-before.css" - cp /jci/gui/apps/ecoenergy/controls/FuelConsumption/js/FuelConsumptionCtrl.js "${MYDIR}/bakups/test/FuelConsumptionCtrl-before.js" -fi -# If you for some reason need the fallback files, uncomment the commented lines below. -if [ -e /jci/gui/apps/ecoenergy/controls/FuelConsumption/css/FuelConsumptionCtrl.css.org ] +if ! (restore_org /jci/gui/apps/ecoenergy/controls/FuelConsumption/css/FuelConsumptionCtrl.css) then - cp /jci/gui/apps/ecoenergy/controls/FuelConsumption/css/FuelConsumptionCtrl.css.org /jci/gui/apps/ecoenergy/controls/FuelConsumption/css/FuelConsumptionCtrl.css - log_message "=== Restored original FuelConsumptionCtrl.css from backup ===" -else - # cp -a "${MYDIR}/config_org/FuelConsumptionTweak/jci/gui/apps/ecoenergy/controls/FuelConsumption/css/FuelConsumptionCtrl.css" /jci/gui/apps/ecoenergy/controls/FuelConsumption/css/ - # log_message "=== No backup found, copied original FuelConsumptionCtrl.css from SD card ==" log_message "=== No backup found, FuelConsumptionCtrl.css was not changed ===" fi -if [ -e /jci/gui/apps/ecoenergy/controls/FuelConsumption/images/FuelConsBG.png.org ] +if ! (restore_org /jci/gui/apps/ecoenergy/controls/FuelConsumption/js/FuelConsumptionCtrl.js) then - cp /jci/gui/apps/ecoenergy/controls/FuelConsumption/images/FuelConsBG.png.org /jci/gui/apps/ecoenergy/controls/FuelConsumption/images/FuelConsBG.png - log_message "=== Restored original FuelConsumptionCtrl.css from backup ===" -else - # cp -a "${MYDIR}/config_org/FuelConsumptionTweak/jci/gui/apps/ecoenergy/controls/FuelConsumption/images/FuelConsBG.png" /jci/gui/apps/ecoenergy/controls/FuelConsumption/images/ - # log_message "=== No backup found, copied original FuelConsBG.png from SD card ===" - log_message "=== No backup found, FuelConsBG.png was not changed ===" + log_message "=== No backup found, FuelConsumptionCtrl.js was not changed ===" fi -if [ -e /jci/gui/apps/ecoenergy/controls/FuelConsumption/js/FuelConsumptionCtrl.js.org ] +if ! (restore_org /jci/gui/apps/ecoenergy/controls/FuelConsumption/images/FuelConsBG.png) then - cp /jci/gui/apps/ecoenergy/controls/FuelConsumption/js/FuelConsumptionCtrl.js.org /jci/gui/apps/ecoenergy/controls/FuelConsumption/js/FuelConsumptionCtrl.js - log_message "=== Restored original FuelConsBG.png from backup ===" -else - # cp -a "${MYDIR}/config_org/FuelConsumptionTweak/jci/gui/apps/ecoenergy/controls/FuelConsumption/js/FuelConsumptionCtrl.js" /jci/gui/apps/ecoenergy/controls/FuelConsumption/js/ - # log_message "=== No backup found, copied original FuelConsumptionCtrl.js from SD card ===" - log_message "=== No backup found, FuelConsumptionCtrl.js was not changed ===" + cp -a "${MYDIR}/config_org/FuelConsumptionTweak/jci/gui/apps/ecoenergy/controls/FuelConsumption/images/FuelConsBG.png" /jci/gui/apps/ecoenergy/controls/FuelConsumption/images/ + log_message "=== No backup found, FuelConsBG.png copied from USB ===" fi if [ $TESTBKUPS -eq 1 ] then diff --git a/app/files/tweaks/24_castscreen-i.txt b/app/files/tweaks/24_castscreen-i.txt index 1c80f85..bfed5b8 100644 --- a/app/files/tweaks/24_castscreen-i.txt +++ b/app/files/tweaks/24_castscreen-i.txt @@ -16,26 +16,26 @@ chmod 755 /jci/scripts/adb chmod 755 /usr/bin/adb if [ $TESTBKUPS -eq 1 ] then - cp /jci/scripts/stage_wifi.sh ${MYDIR}/bakups/test/stage_wifi_castscreen-before.sh + cp ${STAGE_WIFI} ${MYDIR}/bakups/test/stage_wifi_castscreen-before.sh fi #add castscreen-receiver to stage_wifi -if [ -e /jci/scripts/stage_wifi.sh ] +if [ -e ${STAGE_WIFI} ] then - if grep -Fq "watch /jci/scripts/mirroring.sh &" /jci/scripts/stage_wifi.sh + if grep -Fq "watch /jci/scripts/mirroring.sh &" ${STAGE_WIFI} then log_message "=== Castscreen Receiver already in stage_wifi.sh ===" else - #echo "### Castscreen receiver watch" >> /jci/scripts/stage_wifi.sh - #echo "watch /jci/scripts/mirroring.sh &" >> /jci/scripts/stage_wifi.sh - sed -i '/#!/ a\#### Castscreen receiver' /jci/scripts/stage_wifi.sh + #echo "### Castscreen receiver watch" >> ${STAGE_WIFI} + #echo "watch /jci/scripts/mirroring.sh &" >> ${STAGE_WIFI} + sed -i '/#!/ a\#### Castscreen receiver' ${STAGE_WIFI} sleep 1 - sed -i '/Castscreen receiver/ i\ ' /jci/scripts/stage_wifi.sh - sed -i '/Castscreen receiver/ a\watch /jci/scripts/mirroring.sh &' /jci/scripts/stage_wifi.sh + sed -i '/Castscreen receiver/ i\ ' ${STAGE_WIFI} + sed -i '/Castscreen receiver/ a\watch /jci/scripts/mirroring.sh &' ${STAGE_WIFI} log_message "=== Castscreen Receiver added to stage_wifi.sh ===" if [ $TESTBKUPS -eq 1 ] then - cp /jci/scripts/stage_wifi.sh ${MYDIR}/bakups/test/stage_wifi_castscreen-after.sh + cp ${STAGE_WIFI} ${MYDIR}/bakups/test/stage_wifi_castscreen-after.sh fi fi fi diff --git a/app/files/tweaks/24_castscreen-u.txt b/app/files/tweaks/24_castscreen-u.txt index 2fe3940..476237e 100644 --- a/app/files/tweaks/24_castscreen-u.txt +++ b/app/files/tweaks/24_castscreen-u.txt @@ -4,7 +4,7 @@ log_message "=====************* UNINSTALL CASTSCREEN-RECEIVER ... *********** if [ $TESTBKUPS -eq 1 ] then - cp /jci/scripts/stage_wifi.sh "${MYDIR}/bakups/test/stage_wifi_castscreen-before.sh" + cp ${STAGE_WIFI} "${MYDIR}/bakups/test/stage_wifi_castscreen-before.sh" fi rm -f /jci/scripts/wait_adb_arm.sh @@ -12,13 +12,13 @@ rm -f /jci/scripts/adb rm -f /jci/scripts/cs_receiver_arm rm -f /jci/scripts/cs_receiver_conn_arm rm -f /jci/scripts/mirroring.sh -rm -f /jci/scripts/stage_wifi.sh.org2 -sed -i '/Castscreen/d' /jci/scripts/stage_wifi.sh -sed -i '/mirroring.sh/d' /jci/scripts/stage_wifi.sh +rm -f ${STAGE_WIFI}.org2 +sed -i '/Castscreen/d' ${STAGE_WIFI} +sed -i '/mirroring.sh/d' ${STAGE_WIFI} if [ $TESTBKUPS -eq 1 ] then - cp /jci/scripts/stage_wifi.sh "${MYDIR}/bakups/test/stage_wifi_castscreen-after.sh" + cp ${STAGE_WIFI} "${MYDIR}/bakups/test/stage_wifi_castscreen-after.sh" fi log_message "=== Castscreen-Receiver Removed ===" diff --git a/app/files/tweaks/25_androidauto-i.txt b/app/files/tweaks/25_androidauto-i.txt index 9873200..e1110fb 100644 --- a/app/files/tweaks/25_androidauto-i.txt +++ b/app/files/tweaks/25_androidauto-i.txt @@ -4,9 +4,9 @@ log_message "====************ INSTALL ANDROID AUTO HEADUNIT APP v${AA_VER}...** TESTBKUPS=1 if [ $TESTBKUPS -eq 1 ] then - cp /jci/scripts/stage_wifi.sh "${MYDIR}/bakups/test/stage_wifi_androidauto-before.sh" - cp /jci/opera/opera_dir/userjs/additionalApps.json "${MYDIR}/bakups/test/additionalApps_androidauto-1_before.json" - cp /jci/sm/sm.conf "${MYDIR}/bakups/test/sm_androidauto-before.conf" + cp ${STAGE_WIFI} "${MYDIR}/bakups/test/stage_wifi_androidauto-before.sh" + cp /jci/sm/sm.conf "${MYDIR}/bakups/test/sm_androidauto-before.conf" + [ -f ${ADDITIONAL_APPS_JSON} ] && cp ${ADDITIONAL_APPS_JSON} "${MYDIR}/bakups/test/additionalApps_androidauto-1_before.json" fi ### kills all WebSocket daemons @@ -14,67 +14,67 @@ killall -q -9 headunit pkill websocketd rm -fr /jci/gui/apps/_androidauto -rm -fr /tmp/mnt/data_persist/dev/bin/headunit* +rm -fr /tmp/mnt/resources/aio/apps/_androidauto rm -fr /tmp/mnt/data_persist/dev/androidauto +rm -fr /tmp/mnt/data_persist/dev/bin/headunit* rm -f /tmp/mnt/data_persist/dev/bin/aaserver +rm -f /tmp/mnt/data_persist/dev/bin/check-usb.sh +rm -f /tmp/mnt/data_persist/dev/bin/usb-allow.list rm -f /tmp/mnt/data_persist/dev/bin/input_filter rm -f /tmp/mnt/data/enable_input_filter rm -f /tmp/mnt/data/input_filter -sed -i '/9999/d' /jci/scripts/stage_wifi.sh -sed -i '/headunit/d' /jci/scripts/stage_wifi.sh -sed -i '/Android Auto/d' /jci/scripts/stage_wifi.sh +sed -i '/9999/d' ${STAGE_WIFI} +sed -i '/headunit/d' ${STAGE_WIFI} +sed -i '/Android Auto/d' ${STAGE_WIFI} +sed -i '/check-usb/d' ${STAGE_WIFI} log_message "=== Removed old Android Auto App ===" if grep -Fq "input_filter" /jci/sm/sm.conf then - sed -i '/input_filter/ d' /jci/sm/sm.conf - log_message "=== Clean obsolete input_filter to /jci/sm/sm.conf ===" + sed -i '/input_filter/ d' /jci/sm/sm.conf + log_message "=== Clean obsolete input_filter to /jci/sm/sm.conf ===" fi # delete empty lines -sed -i '/^ *$/ d' /jci/scripts/stage_wifi.sh -sed -i '/#!/ a\ ' /jci/scripts/stage_wifi.sh +sed -i '/^ *$/ d' ${STAGE_WIFI} +sed -i '/#!/ a\ ' ${STAGE_WIFI} # check for 1st line of stage_wifi.sh -if grep -Fq "#!/bin/sh" /jci/scripts/stage_wifi.sh +if ! grep -Fq "#!/bin/sh" ${STAGE_WIFI} then - #echo -e "\n\n### Android Auto start" >> /jci/scripts/stage_wifi.sh - #sleep 1 - #echo -e "headunit-wrapper &" >> /jci/scripts/stage_wifi.sh - sed -i '/#!/ a\#### Android Auto start' /jci/scripts/stage_wifi.sh - sleep 1 - sed -i '/Android Auto start/ i\ ' /jci/scripts/stage_wifi.sh - sed -i '/Android Auto start/ a\headunit-wrapper &' /jci/scripts/stage_wifi.sh - log_message "=== Added Android Auto entry to /jci/scripts/stage_wifi.sh ===" -else - cp -a "${MYDIR}/config/androidauto/stage_wifi.sh" /jci/scripts/ - log_message "=== Missing 1st line of stage_wifi.sh, copied new one ===" + log_message "=== Missing 1st line of stage_wifi.sh ===" + echo "#!/bin/sh" > ${STAGE_WIFI} fi +sed -i '/#!/ a\#### Android Auto start' ${STAGE_WIFI} +sleep 1 +sed -i '/Android Auto start/ i\ ' ${STAGE_WIFI} +sed -i '/Android Auto start/ a\headunit-wrapper &' ${STAGE_WIFI} +log_message "=== Added Android Auto entry to ${STAGE_WIFI} ===" +cp -a ${MYDIR}/config/androidauto/jci/gui/apps/_androidauto ${AIO_APP_DIR} cp -a ${MYDIR}/config/androidauto/data_persist/dev/* /tmp/mnt/data_persist/dev -cp -a ${MYDIR}/config/androidauto/jci/gui/apps/_androidauto /jci/gui/apps chmod -R 755 /tmp/mnt/data_persist/dev/bin/ log_message "=== Copied Android Auto Headunit App files ===" -# copy additionalApps.js, if not already present -if [ $CASDK_MODE -eq 0 ] +# symlink to resources +if [ $APPS2RESOURCES -eq 1 ] then - log_message "=== No additionalApps.js available, will copy one ===" - cp -a ${MYDIR}/config/jci/opera/opera_dir/userjs/*.js /jci/opera/opera_dir/userjs/ && CASDK_MODE=1 - find /jci/opera/opera_dir/userjs/ -type f -name '*.js' -exec chmod 755 {} \; + ln -sf /tmp/mnt/resources/aio/apps/_androidauto /jci/gui/apps/_androidauto + log_message "=== Created Symlink To Resources Partition ===" fi -# create additionalApps.json file from scratch if the file does not exist -if [ ! -e /jci/opera/opera_dir/userjs/additionalApps.json ] +# copy additionalApps.js, if not already present +if [ $CASDK_MODE -eq 0 ] then - echo "[" > /jci/opera/opera_dir/userjs/additionalApps.json - echo "]" >> /jci/opera/opera_dir/userjs/additionalApps.json - chmod 755 /jci/opera/opera_dir/userjs/additionalApps.json - log_message "=== Created additionalApps.json ===" + log_message "=== No additionalApps.js available, will copy one ===" + cp -a ${MYDIR}/config/jci/opera/opera_dir/userjs/*.js /jci/opera/opera_dir/userjs/ && CASDK_MODE=1 + find /jci/opera/opera_dir/userjs/ -type f -name '*.js' -exec chmod 755 {} \; fi + +create_app_json # add preload to the AA json entry if needed -if ! grep -q "preload.js" /jci/opera/opera_dir/userjs/additionalApps.json +if grep -q "_androidauto" ${ADDITIONAL_APPS_JSON} && ! grep -q "preload.js" ${ADDITIONAL_APPS_JSON} then - remove_app_json "_androidauto" + remove_app_json "_androidauto" fi # call function add_app_json to modify additionalApps.json add_app_json "_androidauto" "Android Auto" "preload.js" @@ -92,13 +92,13 @@ fi if [ $TESTBKUPS -eq 1 ] then - cp -a /jci/scripts/stage_wifi.sh ${MYDIR}/bakups/test/stage_wifi_androidauto-after.sh - cp -a /jci/opera/opera_dir/userjs/additionalApps.json "${MYDIR}/bakups/test/additionalApps_after-AA.json" + cp ${STAGE_WIFI} "${MYDIR}/bakups/test/stage_wifi_androidauto-after.sh" + [ -f ${ADDITIONAL_APPS_JSON} ] && cp ${ADDITIONAL_APPS_JSON} "${MYDIR}/bakups/test/additionalApps_after-AA.json" fi # Move headunit log file to USB Drive if exists if [ -e /tmp/mnt/data/headunit.log ] then - mv /tmp/mnt/data/headunit.log ${MYDIR} - log_message "=== Moved headunit.log To USB Drive ===" + mv /tmp/mnt/data/headunit.log ${MYDIR} + log_message "=== Moved headunit.log To USB Drive ===" fi diff --git a/app/files/tweaks/25_androidauto-u.txt b/app/files/tweaks/25_androidauto-u.txt index f9af0a5..34bcb3f 100644 --- a/app/files/tweaks/25_androidauto-u.txt +++ b/app/files/tweaks/25_androidauto-u.txt @@ -8,55 +8,43 @@ pkill websocketd if [ $TESTBKUPS -eq 1 ] then - cp /jci/scripts/stage_wifi.sh "${MYDIR}/bakups/test/stage_wifi_androidauto-before.sh" - cp /jci/opera/opera_dir/userjs/additionalApps.json "${MYDIR}/bakups/test/additionalApps_androidauto-1._before.json" + cp ${STAGE_WIFI} "${MYDIR}/bakups/test/stage_wifi_androidauto-before.sh" cp /jci/sm/sm.conf "${MYDIR}/bakups/test/sm_androidauto-before.conf" + [ -f ${ADDITIONAL_APPS_JSON} ] && cp ${ADDITIONAL_APPS_JSON} "${MYDIR}/bakups/test/additionalApps_androidauto-before.json" fi +rm -fr /jci/gui/apps/_androidauto rm -fr /tmp/mnt/data_persist/dev/androidauto -rm -f /tmp/mnt/data_persist/dev/bin/headunit -rm -f /tmp/mnt/data_persist/dev/bin/headunit-wireless +rm -fr /tmp/mnt/data_persist/dev/bin/headunit* +rm -fr /tmp/mnt/resources/aio/apps/_androidauto rm -f /tmp/mnt/data_persist/dev/bin/aaserver -rm -f /tmp/mnt/data_persist/dev/bin/headunit-wrapper +rm -f /tmp/mnt/data_persist/dev/bin/check-usb.sh +rm -f /tmp/mnt/data_persist/dev/bin/usb-allow.list rm -f /tmp/mnt/data_persist/dev/bin/input_filter -rm -fr /tmp/mnt/data_persist/dev/bin/headunit_libs -rm -fr /jci/gui/apps/_androidauto rm -f /tmp/mnt/data/enable_input_filter rm -f /tmp/mnt/data/input_filter -#rm -f /usr/lib/gstreamer-0.10/libgsth264parse.so -log_message "=== Removed files for Android Auto Headunit App ===" -#if [ -e /usr/lib/gstreamer-0.10/libgstalsa.so.org ] -#then - #rm -f /usr/lib/gstreamer-0.10/libgstalsa.so - #log_message "=== Original libgstalsa.so is available as backup ===" - #mv /usr/lib/gstreamer-0.10/libgstalsa.so.org /usr/lib/gstreamer-0.10/libgstalsa.so - #/bin/fsync /usr/lib/gstreamer-0.10/libgstalsa.so -#else - #log_message "=== No backup found. Copying fallback of libgstalsa.so ===" - # cp -a ${MYDIR}/config_org/androidauto/usr/lib/gstreamer-0.10/libgstalsa.so /usr/lib/gstreamer-0.10/ - # chmod 755 /usr/lib/gstreamer-0.10/libgstalsa.so -#fi +log_message "=== Removed files for Android Auto Headunit App ===" -# delete Android Auto entry from /jci/opera/opera_dir/userjs/additionalApps.json +# delete Android Auto entry from additionalApps.json ADDIT_APPS=0 if [ -e /jci/opera/opera_dir/userjs/CustomApplicationsProxy.js ] || [ -e /jci/opera/opera_dir/userjs/nativeApps.js ] then log_message "=== Found CASDK ===" ADDIT_APPS=1 -elif grep -Fq "_aiotweaks" /jci/opera/opera_dir/userjs/additionalApps.json +elif grep -Fq "_aiotweaks" ${ADDITIONAL_APPS_JSON} then log_message "=== Found AIOTweaksApp entry in additionalApps.json ===" ADDIT_APPS=1 -elif grep -Fq "_speedometer" /jci/opera/opera_dir/userjs/additionalApps.json +elif grep -Fq "_speedometer" ${ADDITIONAL_APPS_JSON} then log_message "=== Found speedometer entry in additionalApps.json ===" ADDIT_APPS=1 -elif grep -Fq "_videoplayer" /jci/opera/opera_dir/userjs/additionalApps.json +elif grep -Fq "_videoplayer" ${ADDITIONAL_APPS_JSON} then log_message "=== Found videoplayer entry in additionalApps.json ===" ADDIT_APPS=1 -elif grep -Fq "_mzdmeter" /jci/opera/opera_dir/userjs/additionalApps.json +elif grep -Fq "_mzdmeter" ${ADDITIONAL_APPS_JSON} then log_message "=== Found mzd meter entry in additionalApps.json ===" ADDIT_APPS=1 @@ -70,11 +58,12 @@ else remove_app_json "_androidauto" fi -sed -i '/Android Auto start/d' /jci/scripts/stage_wifi.sh -sed -i '/hwclock --hctosys/d' /jci/scripts/stage_wifi.sh -sed -i '/websocketd --port=9999 sh &/d' /jci/scripts/stage_wifi.sh -sed -i '/headunit-wrapper &/d' /jci/scripts/stage_wifi.sh -log_message "=== Deleted modifications from /jci/scripts/stage_wifi.sh ===" +sed -i '/Android Auto start/d' ${STAGE_WIFI} +sed -i '/hwclock --hctosys/d' ${STAGE_WIFI} +sed -i '/websocketd --port=9999 sh &/d' ${STAGE_WIFI} +sed -i '/headunit-wrapper &/d' ${STAGE_WIFI} +sed -i '/check-usb.sh &/d' ${STAGE_WIFI} +log_message "=== Deleted modifications from ${STAGE_WIFI} ===" if [ -e /etc/asound.conf.org ] then @@ -92,12 +81,12 @@ then sed -i '/input_filter/d' /jci/sm/sm.conf log_message "=== Clean obsolete input_filter to /jci/sm/sm.conf ===" fi -rm -f /jci/scripts/stage_wifi.sh.org3 -rm -f /jci/scripts/stage_wifi.sh.AA +rm -f ${STAGE_WIFI}.org3 +rm -f ${STAGE_WIFI}.AA if [ $TESTBKUPS -eq 1 ] then - cp /jci/scripts/stage_wifi.sh "${MYDIR}/bakups/test/stage_wifi_androidauto-after.sh" + cp ${STAGE_WIFI} "${MYDIR}/bakups/test/stage_wifi_androidauto-after.sh" cp /jci/sm/sm.conf "${MYDIR}/bakups/test/sm_androidauto-after.conf" fi diff --git a/app/files/tweaks/25_androidautob-i.txt b/app/files/tweaks/25_androidautob-i.txt index 64fc38d..56f78f3 100644 --- a/app/files/tweaks/25_androidautob-i.txt +++ b/app/files/tweaks/25_androidautob-i.txt @@ -2,6 +2,6 @@ if [ -e ${MYDIR}/config/androidautob/data_persist/dev/bin/headunit ] then cp -a ${MYDIR}/config/androidautob/data_persist/dev/bin /tmp/mnt/data_persist/dev else - sed -i 's."carGPS": true."carGPS": false.g' /tmp/mnt/data_persist/dev/bin/headunit-wrapper + sed -i 's."carGPS": true."carGPS": false.g' /tmp/mnt/data_persist/dev/bin/headunit.json fi log_message "=== Android Auto Reverse Heading ===" diff --git a/app/files/tweaks/25_androidautowifi-i.txt b/app/files/tweaks/25_androidautowifi-i.txt index 98914fd..a2224bc 100644 --- a/app/files/tweaks/25_androidautowifi-i.txt +++ b/app/files/tweaks/25_androidautowifi-i.txt @@ -2,6 +2,8 @@ if [ -e ${MYDIR}/config/androidautowifi ] then cp -a ${MYDIR}/config/androidautowifi/* /tmp/mnt/data_persist/dev/bin + sed -i '/headunit-wrapper &/ a\check-usb.sh &' ${STAGE_WIFI} + log_message "=== Android Auto WiFi Support ===" fi log_message "====******** END INSTALLATION OF ANDROID AUTO HEADUNIT APP *********=====" diff --git a/app/files/tweaks/26_usbaudiomod-i.txt b/app/files/tweaks/26_usbaudiomod-i.txt index ce8e180..a24284b 100644 --- a/app/files/tweaks/26_usbaudiomod-i.txt +++ b/app/files/tweaks/26_usbaudiomod-i.txt @@ -1,28 +1,27 @@ -backup_org /jci/gui/common/controls/NowPlaying4/js/NowPlaying4Ctrl.js -backup_org /jci/gui/common/controls/NowPlaying4/css/NowPlaying4Ctrl.css -backup_org /jci/gui/apps/usbaudio/js/usbaudioApp.js -# USB Audio Mod -show_message "INSTALL USB AUDIO MOD ..." -log_message "======************* INSTALL USB AUDIO MOD ... ***********=======" - if [ $COMPAT_GROUP -lt 5 ] then - cp -a ${MYDIR}/config/USBAudioMod/NowPlaying4Ctrl.js /jci/gui/common/controls/NowPlaying4/js/ - log_message "=== Copied NowPlaying4Ctrl.js ===" - cp -a ${MYDIR}/config/USBAudioMod/usbaudioApp.js /jci/gui/apps/usbaudio/js/ - log_message "=== Copied usbaudioApp.js ===" - cp -a ${MYDIR}/config/USBAudioMod/*.png /jci/gui/common/images/icons/ - log_message "=== Copied images ===" + backup_org /jci/gui/common/controls/NowPlaying4/js/NowPlaying4Ctrl.js + backup_org /jci/gui/common/controls/NowPlaying4/css/NowPlaying4Ctrl.css + backup_org /jci/gui/apps/usbaudio/js/usbaudioApp.js + # USB Audio Mod + show_message "INSTALL USB AUDIO MOD ..." + log_message "======************* INSTALL USB AUDIO MOD ... ***********=======" + cp -a ${MYDIR}/config/USBAudioMod/NowPlaying4Ctrl.js /jci/gui/common/controls/NowPlaying4/js/ + log_message "=== Copied NowPlaying4Ctrl.js ===" + cp -a ${MYDIR}/config/USBAudioMod/usbaudioApp.js /jci/gui/apps/usbaudio/js/ + log_message "=== Copied usbaudioApp.js ===" + cp -a ${MYDIR}/config/USBAudioMod/*.png /jci/gui/common/images/icons/ + log_message "=== Copied images ===" sed -i "s/GRACENOTETEXT/${GRACENOTE}/g" /jci/gui/apps/usbaudio/js/usbaudioApp.js log_message "=== Changed Gracenote Text ===" - # Remove Existing CSS - remove_aio_css /jci/gui/common/controls/NowPlaying4/css/NowPlaying4Ctrl.css USBAUDIOMOD - # Add CSS - cat ${MYDIR}/config/USBAudioMod/USBAudioMod.css >> /jci/gui/common/controls/NowPlaying4/css/NowPlaying4Ctrl.css - log_message "=== CSS Added for USB Audio Mod ===" + # Remove Existing CSS + remove_aio_css /jci/gui/common/controls/NowPlaying4/css/NowPlaying4Ctrl.css USBAUDIOMOD + # Add CSS + cat ${MYDIR}/config/USBAudioMod/USBAudioMod.css >> /jci/gui/common/controls/NowPlaying4/css/NowPlaying4Ctrl.css + log_message "=== CSS Added for USB Audio Mod ===" + log_message "======************* END INSTALLATION OF USB AUDIO MOD **************====" else - log_message "=== v59.00.500+ is not compatible with USB Audio Mod ===" + show_message "USB AUDIO MOD IS NOT COMPATIBLE WITH FW v59.00.502+ ...\nTHIS TWEAK WILL NOT BE INSTALLED!" + log_message "===***USBAudioMod Not Compatible With v59.00.500+... Install Skipped**===" fi - -log_message "======************* END INSTALLATION OF USB AUDIO MOD **************====" log_message " " diff --git a/app/files/tweaks/26_usbaudiomod-u.txt b/app/files/tweaks/26_usbaudiomod-u.txt index 1476ac9..e32998c 100644 --- a/app/files/tweaks/26_usbaudiomod-u.txt +++ b/app/files/tweaks/26_usbaudiomod-u.txt @@ -3,15 +3,13 @@ show_message "UNINSTALL USB AUDIO MOD ..." log_message "==========************* UNINSTALL USB AUDIO MOD ... ************==========" # Backups -if [ -e /jci/gui/common/controls/NowPlaying4/js/NowPlaying4Ctrl.js.org ] +if ! (restore_org /jci/gui/common/controls/NowPlaying4/js/NowPlaying4Ctrl.js) then - cp -a /jci/gui/common/controls/NowPlaying4/js/NowPlaying4Ctrl.js.org /jci/gui/common/controls/NowPlaying4/js/NowPlaying4Ctrl.js - log_message "=== NowPlaying4Ctrl.js Restored from backup ===" + log_message "=== No Backup found for NowPlaying4Ctrl.js No Files Were Changed ===" fi -if [ -e /jci/gui/apps/usbaudio/js/usbaudioApp.js.org ] +if ! (restore_org /jci/gui/apps/usbaudio/js/usbaudioApp.js) then - cp -a /jci/gui/apps/usbaudio/js/usbaudioApp.js.org /jci/gui/apps/usbaudio/js/usbaudioApp.js - log_message "=== /jci/gui/apps/usbaudio/js/usbaudioApp.js Restored from backup ===" + log_message "=== No Backup found for usbaudioApp.js, No Files Were Changed ===" fi # Remove CSS diff --git a/app/files/tweaks/27_aioapp-i.txt b/app/files/tweaks/27_aioapp-i.txt index f9b197a..e7734c2 100644 --- a/app/files/tweaks/27_aioapp-i.txt +++ b/app/files/tweaks/27_aioapp-i.txt @@ -7,43 +7,36 @@ log_message "=========************ INSTALL AIO TWEAKS APP *************===== if [ $TESTBKUPS -eq 1 ] then - cp /jci/scripts/stage_wifi.sh "${MYDIR}/bakups/test/stage_wifi_aio-before.sh" - cp /jci/opera/opera_dir/userjs/additionalApps.json "${MYDIR}/bakups/test/additionalApps_aio_before.json" + cp ${STAGE_WIFI} "${MYDIR}/bakups/test/stage_wifi_aio-before.sh" + [ -f ${ADDITIONAL_APPS_JSON} ] && cp ${ADDITIONAL_APPS_JSON} "${MYDIR}/bakups/test/additionalApps_aio-before.json" fi ### Kills all WebSocket daemons pkill websocketd # Remove previous files -rm -fr /jci/gui/apps/_aiotweaks/ +rm -fr /jci/gui/apps/_aiotweaks +rm -fr /tmp/mnt/resources/aio/apps/_aiotweaks +rm -fr /tmp/mnt/data_persist/dev/system_restore # Remove old aio-startup rm -f /jci/opera/opera_dir/userjs/aio-startup.js +log_message "=== Removed Old AIO Tweaks App Files ===" # Copies the additionalApps.js if [ $CASDK_MODE -eq 0 ] then cp -a ${MYDIR}/config/jci/opera/opera_dir/userjs/additionalApps.js /jci/opera/opera_dir/userjs/ && CASDK_MODE=1 chmod 755 /jci/opera/opera_dir/userjs/additionalApps.js - chown 1018:3015 /jci/opera/opera_dir/userjs/additionalApps.js log_message "=== Copied additionalApps.js ===" fi cp -a ${MYDIR}/config/jci/opera/opera_dir/userjs/aio.js /jci/opera/opera_dir/userjs/ chmod 755 /jci/opera/opera_dir/userjs/aio.js -chown 1018:3015 /jci/opera/opera_dir/userjs/aio.js log_message "=== Copied aio.js ===" -# create additionalApps.json file from scratch if the file does not exist -if [ ! -e /jci/opera/opera_dir/userjs/additionalApps.json ] -then - echo "[" > /jci/opera/opera_dir/userjs/additionalApps.json - echo "]" >> /jci/opera/opera_dir/userjs/additionalApps.json - chmod 755 /jci/opera/opera_dir/userjs/additionalApps.json - log_message "=== Created additionalApps.json ===" -fi - +create_app_json # Remove old json entries -if ! grep -q "AIO-startup.js" /jci/opera/opera_dir/userjs/additionalApps.json +if grep -q "_aiotweaks" ${ADDITIONAL_APPS_JSON} && ! grep -q "AIO-startup.js" ${ADDITIONAL_APPS_JSON} then remove_app_json "_aiotweaks" fi @@ -58,27 +51,33 @@ if [ ! -e /jci/gui/addon-common/websocketd ] || [ ! -e /jci/gui/addon-common/jq log_message "=== Copied addon-common folder ===" fi -sed -i '/AIO/d' /jci/scripts/stage_wifi.sh -sed -i '/--port=9997/d' /jci/scripts/stage_wifi.sh -sed -i '/--passenv/d' /jci/scripts/stage_wifi.sh +sed -i '/AIO/d' ${STAGE_WIFI} +sed -i '/--port=9997/d' ${STAGE_WIFI} +sed -i '/--passenv/d' ${STAGE_WIFI} -#echo -e '\n\n\n### AIO Tweaks App' >> /jci/scripts/stage_wifi.sh -#echo -e '\n/jci/gui/addon-common/websocketd --passenv $(env | grep XDG_ | sed "s/=.*$//g" | tr "\\n" ",")PATH,SHELL --port=9997 sh &' >> /jci/scripts/stage_wifi.sh -sed -i '/#!/ a\### AIO Tweaks App' /jci/scripts/stage_wifi.sh +#echo -e '\n\n\n### AIO Tweaks App' >> ${STAGE_WIFI} +#echo -e '\n/jci/gui/addon-common/websocketd --passenv $(env | grep XDG_ | sed "s/=.*$//g" | tr "\\n" ",")PATH,SHELL --port=9997 sh &' >> ${STAGE_WIFI} +sed -i '/#!/ a\### AIO Tweaks App' ${STAGE_WIFI} sleep 1 -sed -i '/AIO Tweaks/ i\ ' /jci/scripts/stage_wifi.sh -sed -i '/AIO Tweaks/ a\/jci/gui/addon-common/websocketd --passenv $(env | grep XDG_ | sed "s/=.*$//g" | tr "\\n" ",")PATH,SHELL --port=9997 sh &' /jci/scripts/stage_wifi.sh +sed -i '/AIO Tweaks/ i\ ' ${STAGE_WIFI} +sed -i '/AIO Tweaks/ a\/jci/gui/addon-common/websocketd --passenv $(env | grep XDG_ | sed "s/=.*$//g" | tr "\\n" ",")PATH,SHELL --port=9997 sh &' ${STAGE_WIFI} # delete empty lines -sed -i '/^ *$/ d' /jci/scripts/stage_wifi.sh -sed -i '/#!/ a\ ' /jci/scripts/stage_wifi.sh -chmod 755 /jci/scripts/stage_wifi.sh +sed -i '/^ *$/ d' ${STAGE_WIFI} +sed -i '/#!/ a\ ' ${STAGE_WIFI} +chmod 755 ${STAGE_WIFI} log_message "=== Set Websocketd for AIO in Stage_wifi.sh ===" +cp -a ${MYDIR}/config/aio-app/jci/gui/apps/_aiotweaks ${AIO_APP_DIR} +cp -a ${MYDIR}/config/aio-app/data_persist/* /tmp/mnt/data_persist/ +# symlink to resources +if [ $APPS2RESOURCES -eq 1 ] +then + ln -sf /tmp/mnt/resources/aio/apps/_aiotweaks /jci/gui/apps/_aiotweaks + log_message "=== Created Symlink To Resources Partition ===" +fi -cp -a ${MYDIR}/config/aio-app/jci/gui/apps/* /jci/gui/apps/ -cp -a ${MYDIR}/config/aio-app/data_persist/* /tmp/mnt/data_persist/ -chmod 755 -R /jci/gui/apps/_aiotweaks/ +chmod 755 -R ${AIO_APP_DIR} chmod 755 -R /tmp/mnt/data_persist/dev/system_restore/ chmod 755 /jci/scripts/jci-fw.sh chmod 755 /jci/scripts/jci-wifiap.sh diff --git a/app/files/tweaks/27_aioapp-u.txt b/app/files/tweaks/27_aioapp-u.txt index a8aa8ad..9614295 100644 --- a/app/files/tweaks/27_aioapp-u.txt +++ b/app/files/tweaks/27_aioapp-u.txt @@ -6,36 +6,36 @@ pkill websocketd if [ $TESTBKUPS -eq 1 ] then - cp /jci/scripts/stage_wifi.sh "${MYDIR}/bakups/test/stage_wifi-aio_before.sh" - cp /jci/opera/opera_dir/userjs/additionalApps.json "${MYDIR}/bakups/test/additionalApps-aio_before.json" + cp ${STAGE_WIFI} "${MYDIR}/bakups/test/stage_wifi-aio_before.sh" + [ -f ${ADDITIONAL_APPS_JSON} ] && cp ${ADDITIONAL_APPS_JSON} "${MYDIR}/bakups/test/additionalApps-aio_before.json" fi if [ ! -e /jci/gui/apps/_videoplayer ] then - sed -i '/### AIO/d' /jci/scripts/stage_wifi.sh - sed -i '/--port=9997/d' /jci/scripts/stage_wifi.sh + sed -i '/### AIO/d' ${STAGE_WIFI} + sed -i '/--port=9997/d' ${STAGE_WIFI} log_message "=== Removed Entries in stage_wifi.sh ===" fi ADDIT_APPS=0 -# delete aiotweaks entry from /jci/opera/opera_dir/userjs/additionalApps.json +# delete aiotweaks entry from additionalApps.json if [ -e /jci/opera/opera_dir/userjs/CustomApplicationsProxy.js ] || [ -e /jci/opera/opera_dir/userjs/nativeApps.js ] then - log_message "=== Found CASDK ===" - ADDIT_APPS=1 -elif grep -Fq "_androidauto" /jci/opera/opera_dir/userjs/additionalApps.json + log_message "=== Found CASDK ===" + ADDIT_APPS=1 +elif grep -Fq "_androidauto" ${ADDITIONAL_APPS_JSON} then log_message "=== Found androidauto entry in additionalApps.json ===" ADDIT_APPS=1 -elif grep -Fq "_speedometer" /jci/opera/opera_dir/userjs/additionalApps.json +elif grep -Fq "_speedometer" ${ADDITIONAL_APPS_JSON} then log_message "=== Found speedometer entry in additionalApps.json ===" ADDIT_APPS=1 -elif grep -Fq "_videoplayer" /jci/opera/opera_dir/userjs/additionalApps.json +elif grep -Fq "_videoplayer" ${ADDITIONAL_APPS_JSON} then log_message "=== Found videoplayer entry in additionalApps.json ===" ADDIT_APPS=1 -elif grep -Fq "_mzdmeter" /jci/opera/opera_dir/userjs/additionalApps.json +elif grep -Fq "_mzdmeter" ${ADDITIONAL_APPS_JSON} then log_message "=== Found mzd meter entry in additionalApps.json ===" ADDIT_APPS=1 @@ -50,23 +50,21 @@ else fi ### cleanup old versions -if [ ! -e /jci/opera/opera_dir/userjs/additionalApps.json ]; then +if [ ! -e ${ADDITIONAL_APPS_JSON} ]; then rm -fr /jci/gui/addon-common log_message "=== Removed /jci/gui/addon-common: no speedometer or videoplayer ===" fi rm -fr /jci/gui/apps/_aiotweaks -rm -f /jci/opera/opera_dir/userjs/aio-startup.js +rm -fr /tmp/mnt/resources/aio/apps/_aiotweaks rm -fr /tmp/mnt/data_persist/dev/system_restore +rm -f /jci/opera/opera_dir/userjs/aio-startup.js log_message "=== Removed AIO Tweaks App files ===" if [ $TESTBKUPS -eq 1 ] then - cp /jci/scripts/stage_wifi.sh "${MYDIR}/bakups/test/stage_wifi-aio_after.sh" - if [ -e /jci/opera/opera_dir/userjs/additionalApps.json ] - then - cp /jci/opera/opera_dir/userjs/additionalApps.json "${MYDIR}/bakups/test/additionalApps-aio_after.json" - fi + cp ${STAGE_WIFI} "${MYDIR}/bakups/test/stage_wifi-aio_after.sh" + [ -f ${ADDITIONAL_APPS_JSON} ] && cp ${ADDITIONAL_APPS_JSON} "${MYDIR}/bakups/test/additionalApps-aio_after.json" fi log_message "======*********** END UNINSTALLATION OF AIO TWEAKS APP ***********=======" diff --git a/app/files/tweaks/28_mzdmeter-i.txt b/app/files/tweaks/28_mzdmeter-i.txt index 3cd8455..175c0f7 100644 --- a/app/files/tweaks/28_mzdmeter-i.txt +++ b/app/files/tweaks/28_mzdmeter-i.txt @@ -6,8 +6,8 @@ log_message "=========*************** INSTALL MZD METER ***************===== if [ $TESTBKUPS -eq 1 ] then - cp /jci/scripts/stage_wifi.sh "${MYDIR}/bakups/test/stage_wifi_mzd-before.sh" - cp /jci/opera/opera_dir/userjs/additionalApps.json "${MYDIR}/bakups/test/additionalApps_mzd_before.json" + cp ${STAGE_WIFI} "${MYDIR}/bakups/test/stage_wifi_mzd-before.sh" + [ -f ${ADDITIONAL_APPS_JSON} ] && cp ${ADDITIONAL_APPS_JSON} "${MYDIR}/bakups/test/additionalApps_mzd_before.json" fi ### Kills all WebSocket daemons @@ -21,19 +21,9 @@ if [ $CASDK_MODE -eq 0 ] then cp -a ${MYDIR}/config/jci/opera/opera_dir/userjs/*.js /jci/opera/opera_dir/userjs/ && CASDK_MODE=1 chmod 755 /jci/opera/opera_dir/userjs/additionalApps.js - chown 1018:3015 /jci/opera/opera_dir/userjs/additionalApps.js log_message "=== Copied additionalApps.js ===" fi -# create additionalApps.json file from scratch if the file does not exist -if [ ! -e /jci/opera/opera_dir/userjs/additionalApps.json ] -then - echo "[" > /jci/opera/opera_dir/userjs/additionalApps.json - echo "]" >> /jci/opera/opera_dir/userjs/additionalApps.json - chmod 755 /jci/opera/opera_dir/userjs/additionalApps.json - log_message "=== Created additionalApps.json ===" -fi - # Copies the content of the addon-common folder if [ ! -e /jci/gui/addon-common/websocketd ] || [ ! -e /jci/gui/addon-common/jquery.min.js ]; then cp -a ${MYDIR}/config/jci/gui/addon-common/ /jci/gui/ @@ -41,15 +31,16 @@ if [ ! -e /jci/gui/addon-common/websocketd ] || [ ! -e /jci/gui/addon-common/jq log_message "=== Copied addon-common folder ===" fi -count=$(grep -c 'mzdmonitor.sh' /jci/scripts/stage_wifi.sh) +count=$(grep -c 'mzdmonitor.sh' ${STAGE_WIFI}) if [ "$count" = "0" ] then - echo -e '\n\n\n### MZD Meter' >> /jci/scripts/stage_wifi.sh - echo -e '\nwatch /jci/gui/apps/_mzdmeter/sh/mzdmonitor.sh &' >> /jci/scripts/stage_wifi.sh - chmod 755 /jci/scripts/stage_wifi.sh + echo -e '\n\n\n### MZD Meter' >> ${STAGE_WIFI} + echo -e '\nwatch /jci/gui/apps/_mzdmeter/sh/mzdmonitor.sh &' >> ${STAGE_WIFI} + chmod 755 ${STAGE_WIFI} log_message "=== Modified Stage_wifi.sh ===" fi +create_app_json # Call to the function to populate the json add_app_json "_mzdmeter" "MZD Meter" diff --git a/app/files/tweaks/28_mzdmeter-u.txt b/app/files/tweaks/28_mzdmeter-u.txt index a6adf7c..0d208ae 100644 --- a/app/files/tweaks/28_mzdmeter-u.txt +++ b/app/files/tweaks/28_mzdmeter-u.txt @@ -6,31 +6,31 @@ pkill websocketd if [ $TESTBKUPS -eq 1 ] then - cp /jci/scripts/stage_wifi.sh "${MYDIR}/bakups/test/stage_wifi_mzd-before.sh" - cp /jci/opera/opera_dir/userjs/additionalApps.json "${MYDIR}/bakups/test/additionalApps_mzd_before.json" + cp ${STAGE_WIFI} "${MYDIR}/bakups/test/stage_wifi_mzd-before.sh" + [ -f ${ADDITIONAL_APPS_JSON} ] && cp ${ADDITIONAL_APPS_JSON} "${MYDIR}/bakups/test/additionalApps_mzd-before.json" fi -sed -i '/### MZD Meter/d' /jci/scripts/stage_wifi.sh -sed -i '/mzdmonitor.sh/d' /jci/scripts/stage_wifi.sh +sed -i '/### MZD Meter/d' ${STAGE_WIFI} +sed -i '/mzdmonitor.sh/d' ${STAGE_WIFI} ADDIT_APPS=0 if [ -e /jci/opera/opera_dir/userjs/CustomApplicationsProxy.js ] || [ -e /jci/opera/opera_dir/userjs/nativeApps.js ] then - log_message "=== Found CASDK ===" - ADDIT_APPS=1 -if grep -Fq "_androidauto" /jci/opera/opera_dir/userjs/additionalApps.json + log_message "=== Found CASDK ===" + ADDIT_APPS=1 +elif grep -Fq "_androidauto" ${ADDITIONAL_APPS_JSON} then log_message "=== Found androidauto entry in additionalApps.json ===" ADDIT_APPS=1 -elif grep -Fq "_speedometer" /jci/opera/opera_dir/userjs/additionalApps.json +elif grep -Fq "_speedometer" ${ADDITIONAL_APPS_JSON} then log_message "=== Found speedometer entry in additionalApps.json ===" ADDIT_APPS=1 -elif grep -Fq "_videoplayer" /jci/opera/opera_dir/userjs/additionalApps.json +elif grep -Fq "_videoplayer" ${ADDITIONAL_APPS_JSON} then log_message "=== Found videoplayer entry in additionalApps.json ===" ADDIT_APPS=1 -elif grep -Fq "_aiotweaks" /jci/opera/opera_dir/userjs/additionalApps.json +elif grep -Fq "_aiotweaks" ${ADDITIONAL_APPS_JSON} then log_message "=== Found aiotweaksapp entry in additionalApps.json ===" ADDIT_APPS=1 @@ -40,7 +40,7 @@ if [ $ADDIT_APPS -eq 0 ] then log_message "=== No more entrys in additionalApps.json, files will be deleted ===" rm -f /jci/opera/opera_dir/userjs/additionalApps.* - rm -f /jci/opera/opera_dir/userjs/app.js + rm -f /jci/opera/opera_dir/userjs/app.js fi rm -f /jci/opera/opera_dir/userjs/speedometer-startup.js @@ -51,9 +51,9 @@ rm -fr /paa if [ $TESTBKUPS -eq 1 ] then - cp /jci/scripts/stage_wifi.sh "${MYDIR}/bakups/test/stage_wifi_mzd-after.sh" - cp /jci/opera/opera_dir/userjs/additionalApps.json "${MYDIR}/bakups/test/additionalApps_mzd_after.json" + cp ${STAGE_WIFI} "${MYDIR}/bakups/test/stage_wifi_mzd-after.sh" + [ -f ${ADDITIONAL_APPS_JSON} ] && cp ${ADDITIONAL_APPS_JSON} "${MYDIR}/bakups/test/additionalApps_mzd-after.json" fi -log_message "====-==************* END UNINSTALLATION OF MZD METER *************=======" +log_message "=======************* END UNINSTALLATION OF MZD METER *************=======" log_message " " diff --git a/app/files/tweaks/casdk/apps/app.background/app.js b/app/files/tweaks/casdk/apps/app.background/app.js index edb96e3..9fa1e39 100644 --- a/app/files/tweaks/casdk/apps/app.background/app.js +++ b/app/files/tweaks/casdk/apps/app.background/app.js @@ -105,7 +105,7 @@ CustomApplicationsHandler.register("app.background", new CustomApplication({ }, ""); this.table = []; for (var i = 0; i <= backgroundlist.length; i++) { - var elem = $(""); + var elem = $(""); this.image_slider.append(elem); this.table.push({ elem: elem, link: i ? this.location + "background/" + backgroundlist[i - 1] : framework.common._defaultBgPath }); } diff --git a/app/files/tweaks/casdk/apps/app.simpledashboard/app.css b/app/files/tweaks/casdk/apps/app.simpledashboard/app.css index c4396b3..a403e0f 100644 --- a/app/files/tweaks/casdk/apps/app.simpledashboard/app.css +++ b/app/files/tweaks/casdk/apps/app.simpledashboard/app.css @@ -1,8 +1,8 @@ [app="app.simpledashboard"] { - background: #000; + background:rgba(0, 0, 0, 0.5); } [app="app.simpledashboard"] div { - background: rgba(255, 0, 0, 0.1); + background: rgba(255, 0, 0, 0.75); position: absolute; top: 45px; left: 50px; diff --git a/app/files/tweaks/casdk/patch/systemApp.js b/app/files/tweaks/casdk/patch/systemApp.js index 6b47558..2f3d112 100644 --- a/app/files/tweaks/casdk/patch/systemApp.js +++ b/app/files/tweaks/casdk/patch/systemApp.js @@ -755,7 +755,7 @@ systemApp.prototype._enableAppListItem = function(appName, isDisabled, dataList) var vehicleConfigurationType = framework.getSharedData("syssettings", "VehicleConfigData"); //Need to update _applicationsCtxtWiseAppNames (ApplicationStructure) if vehicle configuration has changed. if (vehicleConfigurationType !== this._vehicleConfigurationType) { - log.info("VehicleConfigurationType is changed to " + vehicleConfigurationType) + log.info("VehicleConfigurationType is changed to " + vehicleConfigurationType); this._vehicleConfigurationType = vehicleConfigurationType; this._updateApplicationStructure(vehicleConfigurationType); } diff --git a/app/files/tweaks/config/FuelConsumptionTweak/jci/gui/apps/ecoenergy/controls/FuelConsumption/css/FuelConsumptionCtrl.css b/app/files/tweaks/config/FuelConsumptionTweak/jci/gui/apps/ecoenergy/controls/FuelConsumption/css/FuelConsumptionCtrl.css index 1d2974a..5759bff 100644 --- a/app/files/tweaks/config/FuelConsumptionTweak/jci/gui/apps/ecoenergy/controls/FuelConsumption/css/FuelConsumptionCtrl.css +++ b/app/files/tweaks/config/FuelConsumptionTweak/jci/gui/apps/ecoenergy/controls/FuelConsumption/css/FuelConsumptionCtrl.css @@ -22,7 +22,7 @@ } .FuelConsumptionCtrlHiddenOpacity { - + opacity: 0; } @@ -31,7 +31,7 @@ position: inherit; top: 0px; left: 0px; - width: 800px; + width: 800px; height: 100px; background: none; z-index: 10; @@ -42,7 +42,7 @@ position: inherit; top: 0px; left: 0px; - width: 800px; + width: 800px; height: 100px; background: none; z-index: 10; @@ -73,15 +73,15 @@ h2.FuelConsumptionCtrlFuelEfficiencyTitle { line-height: 120%; font-family: Tipperary, Arial, Helvetica, sans-serif; font-size: 27px; - color: #ffffff; + color: #ffffff; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; - white-space:nowrap; + white-space:nowrap; } .FuelConsumptionCtrlFuelEfficiencyThisDrive { - + position: absolute; top: 95px; left:648px; @@ -91,11 +91,11 @@ h2.FuelConsumptionCtrlFuelEfficiencyTitle { line-height: 120%; font-family: Tipperary, Arial, Helvetica, sans-serif; font-size: 27px; - color: #ffffff; + color: #ffffff; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; - white-space:nowrap; + white-space:nowrap; } .FuelConsumptionCtrlFuelEfficiencyValue { @@ -107,12 +107,12 @@ h2.FuelConsumptionCtrlFuelEfficiencyTitle { text-align: center; font-family: "Tipperary Semibold", Arial, Helvetica, sans-serif; font-size: 30px; - color: #95BFEB; + color: #95BFEB; } .FuelConsumptionCtrlFuelEfficiencyUnit { position:absolute; - font-size: 30px; + font-size: 30px; width:140px; height: 210px; top:188px; @@ -122,7 +122,7 @@ h2.FuelConsumptionCtrlFuelEfficiencyTitle { text-overflow: ellipsis; -o-text-overflow: ellipsis; white-space: nowrap;} - + .FuelConsumptionCtrlSwitchView { position:absolute; @@ -154,13 +154,13 @@ h2.FuelConsumptionCtrlFuelEfficiencyTitle { height: 111px; background: url('../images/FuelConsBgBars1.png') center no-repeat; } - + .FuelConsumptionCtrlCDFEGraphRight { position: absolute; top: 58px; left: 76px; width: 473px; - height: 111px; + height: 111px; } /*.FuelConsumptionCtrlCDFEGraphClipMask {/* @@ -171,7 +171,7 @@ h2.FuelConsumptionCtrlFuelEfficiencyTitle { height: 109px; overflow: hidden; }*/ - + .FuelConsumptionCtrlCDFEGraphClipMask { position: absolute; top: 1px; @@ -180,14 +180,14 @@ h2.FuelConsumptionCtrlFuelEfficiencyTitle { height: 109px; overflow: hidden; } - + .FuelConsumptionCtrlCDFEGraphClipMaskRight { position: absolute; top: 1px; left: 1px; width: 240px; height: 109px; - overflow: hidden; + overflow: hidden; } .FuelConsumptionCtrlCDFEGraphArea { @@ -198,7 +198,7 @@ h2.FuelConsumptionCtrlFuelEfficiencyTitle { /* include 16th "hidden" bar & spacer for new values */ height: 109px; } - + .FuelConsumptionCtrlCDFEGraphAreaRight { position: absolute; top: 1px; @@ -223,7 +223,7 @@ h2.FuelConsumptionCtrlCDFEGraphTitle { overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; - white-space:nowrap; + white-space:nowrap; } .FuelConsumptionCtrlCDFEGraphXAxisLabel { @@ -232,10 +232,10 @@ h2.FuelConsumptionCtrlCDFEGraphTitle { left: -5px; width: 473px; text-align: center; - color: #fff; - font-size:21px; + color: #fff; + font-size:21px; font-family: Tipperary, Arial, Helvetica, sans-serif; - + } .FuelConsumptionCtrlCDFEGraphYAxisLabel span { @@ -243,10 +243,10 @@ h2.FuelConsumptionCtrlCDFEGraphTitle { top: -10px; left: 478px; width: 48px; - color: #fff; - font-size:21px; + color: #fff; + font-size:21px; font-family: Tipperary, Arial, Helvetica, sans-serif; - + } .FuelConsumptionCtrlCDFEBarGraphCore { @@ -257,7 +257,7 @@ h2.FuelConsumptionCtrlCDFEGraphTitle { background: url("../images/FuelConsBar_Narrow.png") center repeat-y; background-size: 21px 100%; } - + .FuelConsumptionCtrlCDFEBarGraphCoreRight { position: absolute; width: 44px; @@ -266,7 +266,7 @@ h2.FuelConsumptionCtrlCDFEGraphTitle { background:url("../images/FuelConsBar_wide.png") center repeat-y; background-size: 44px 100%; } - + .FuelConsumptionCtrlCDFEBarGraphCoreGreenRight { position: absolute; width: 44px; @@ -275,7 +275,7 @@ h2.FuelConsumptionCtrlCDFEGraphTitle { background:url("../images/FuelConsBar_wide_green.png") center repeat-y; background-size: 44px 100%; } - + .FuelConsumptionCtrlCDFEBarGraphCoreCurrent { position: absolute; width: 21px; @@ -309,7 +309,7 @@ h2.FuelConsumptionCtrlCDFEGraphTitle { width: 473px; height: 111px; background: url('../images/FuelConsBgBars2.png') no-repeat; - + } .FuelConsumptionCtrlCFERGraphClipMask { @@ -320,7 +320,7 @@ h2.FuelConsumptionCtrlCDFEGraphTitle { height: 109px; overflow: hidden; } - + .FuelConsumptionCtrlCFERGraphArea { position: absolute; @@ -340,11 +340,11 @@ h2.FuelConsumptionCtrlCFERGraphTitle { height:31px; font-family: "Tipperary Semibold", Arial, Helvetica, sans-serif; font-size: 28px; - color: #ffffff; + color: #ffffff; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; - white-space:nowrap; + white-space:nowrap; } .FuelConsumptionCtrlCFERGraphXAxisLabel { @@ -352,10 +352,10 @@ h2.FuelConsumptionCtrlCFERGraphTitle { top: 115px; left:0px; width: 473px; - font-size:21px; + font-size:21px; font-family: Tipperary, Arial, Helvetica, sans-serif; - color: #fff; - + color: #fff; + } .FuelConsumptionCtrlCFERGraphYAxisLabel span { @@ -363,7 +363,7 @@ h2.FuelConsumptionCtrlCFERGraphTitle { top: -10px; left: 478px; width: 48px; - font-size:21px; + font-size:21px; font-family: Tipperary, Arial, Helvetica, sans-serif; color: #fff; } @@ -409,7 +409,7 @@ h2.FuelConsumptionCtrlCFERGraphTitle { } .FuelConsumptionCtrlCFERCurrentBarValue { - + position: absolute; width:50px; height: 0px; @@ -418,10 +418,10 @@ h2.FuelConsumptionCtrlCFERGraphTitle { } .FuelConsumptionCtrlHevCDFEDisc_1 { - + width:22px; height:13px; - + } .FuelConsumptionCtrlHevCDFEDisc_2 { @@ -430,13 +430,13 @@ h2.FuelConsumptionCtrlCFERGraphTitle { } .FuelConsumptionCtrlHevCDFEDisc_3 { - + width:22px; height:39px; } .FuelConsumptionCtrlHevCDFEDisc_4 { - + width:22px; height:52px; } @@ -462,7 +462,7 @@ h2.FuelConsumptionCtrlCFERGraphTitle { } .FuelConsumptionCtrlHevCDFEDiscBg_Blue { - + position: relative; background: url('../images/GeneratedEnergy_NarrowPurple.png') center repeat-y; bottom: 0px; @@ -479,7 +479,7 @@ h2.FuelConsumptionCtrlCFERGraphTitle { } .FuelConsumptionCtrlHevCDFEDiscBg_Green { - + position: absolute; width: 21px; height: 0px; @@ -488,15 +488,15 @@ h2.FuelConsumptionCtrlCFERGraphTitle { } .FuelConsumptionCtrlHevCDFEDiscBg_White { - + background: url('../images/GeneratedEnergy_NarrowCurrent.png') center repeat-y; } .FuelConsumptionCtrlHevCDFEDiscWide_1 { - + width:44px; height:13px; - + } .FuelConsumptionCtrlHevCDFEDiscWide_2 { @@ -505,13 +505,13 @@ h2.FuelConsumptionCtrlCFERGraphTitle { } .FuelConsumptionCtrlHevCDFEDiscWide_3 { - + width:44px; height:39px; } .FuelConsumptionCtrlHevCDFEDiscWide_4 { - + width:44px; height:52px; } @@ -537,11 +537,11 @@ h2.FuelConsumptionCtrlCFERGraphTitle { } .FuelConsumptionCtrlHevAverageText { - + } .FuelConsumptionCtrlHevThisDriveText { - + } .FuelConsumptionCtrlFuelEfficiencyTitleHev{ @@ -554,11 +554,11 @@ h2.FuelConsumptionCtrlCFERGraphTitle { line-height: 120%; font-family: Tipperary, Arial, Helvetica, sans-serif; font-size: 27px; - color: #ffffff; + color: #ffffff; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; - white-space:nowrap; + white-space:nowrap; } @@ -572,11 +572,11 @@ h2.FuelConsumptionCtrlCFERGraphTitle { line-height: 120%; font-family: Tipperary, Arial, Helvetica, sans-serif; font-size: 27px; - color: #ffffff; + color: #ffffff; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; - white-space:nowrap; + white-space:nowrap; } .FuelConsumptionCtrlFuelEfficiencyValueHev{ position: absolute; @@ -587,9 +587,9 @@ h2.FuelConsumptionCtrlCFERGraphTitle { text-align: center; font-family: "Tipperary Semibold", Arial, Helvetica, sans-serif; font-size: 40px; - color: #ffffff; + color: #ffffff; } - + .FuelConsumptionCtrlFuelEfficiencyHevDivider{ position:absolute; top:205px; @@ -598,7 +598,7 @@ h2.FuelConsumptionCtrlCFERGraphTitle { width:146px; height:1px; } - + .FuelConsumptionCtrlHevOneDriveText { position: absolute; left:648px; @@ -609,11 +609,11 @@ h2.FuelConsumptionCtrlCFERGraphTitle { line-height: 120%; font-family: Tipperary, Arial, Helvetica, sans-serif; font-size: 27px; - color: #ffffff; + color: #ffffff; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; - white-space:nowrap; + white-space:nowrap; } .FuelConsumptionCtrlHevEVDistanceText { @@ -626,11 +626,11 @@ h2.FuelConsumptionCtrlCFERGraphTitle { line-height: 120%; font-family: Tipperary, Arial, Helvetica, sans-serif; font-size: 26px; - color: #ffffff; + color: #ffffff; overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; - white-space:nowrap; + white-space:nowrap; } .FuelConsumptionCtrlHevDistanceValue { @@ -643,7 +643,7 @@ h2.FuelConsumptionCtrlCFERGraphTitle { line-height: 120%; font-family: Tipperary, Arial, Helvetica, sans-serif; font-size: 40px; - color: #ffffff; + color: #ffffff; } .FuelConsumptionCtrlHevDistanceUnit { @@ -656,7 +656,7 @@ h2.FuelConsumptionCtrlCFERGraphTitle { line-height: 120%; font-family: Tipperary, Arial, Helvetica, sans-serif; font-size: 28px; - color: #ffffff; + color: #ffffff; } .FuelConsumptionCtrlHevPercentValue { @@ -730,7 +730,7 @@ h2.FuelConsumptionCtrlCFERGraphTitle { top: 58px; left: 76px; width: 473px; - height: 111px; + height: 111px; } .FuelConsumptionCtrlCDFEDiscGraphClipMaskRight { @@ -739,7 +739,7 @@ h2.FuelConsumptionCtrlCFERGraphTitle { left: 1px; width: 240px; height: 109px; - overflow: hidden; + overflow: hidden; } @@ -770,7 +770,7 @@ h2.FuelConsumptionCtrlCFERGraphTitle { } .FuelConsumptionCtrlCFERBarGraphCurrentMask { - + position: absolute; width:50px; height: 109px; @@ -781,7 +781,7 @@ h2.FuelConsumptionCtrlCFERGraphTitle { .FuelConsumptionCtrlFuelEfficiencyUnitHev{ position:absolute; - font-size: 28px; + font-size: 28px; width:80px; height: 31px; top:146px; @@ -790,11 +790,11 @@ h2.FuelConsumptionCtrlCFERGraphTitle { overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; - white-space:nowrap; - } - + white-space:nowrap; + } + .FuelConsumptionCtrlOneDiscValue { - + position:absolute; width: 95px; height: 31px; @@ -808,21 +808,21 @@ h2.FuelConsumptionCtrlCFERGraphTitle { overflow:hidden; text-overflow:ellipsis; -o-text-overflow:ellipsis; - white-space:nowrap; - } - + white-space:nowrap; + } + .FuelConsumptionCtrlOneDiscIndicator { - + position:absolute; width: 19px; height: 13px; background: url('../images/GeneratedEnergy_NarrowCurrent.png') center no-repeat; left:437px; - top:27px; + top:27px; } - + .FuelConsumptionCtrlHalfWayLabel1 { - + position:absolute; width: 24px; height: 24px; @@ -831,12 +831,12 @@ h2.FuelConsumptionCtrlCFERGraphTitle { text-align: left; font-family: Tipperary, Arial, Helvetica, sans-serif; font-size: 21px; - color: #ffffff; - - } - + color: #ffffff; + + } + .FuelConsumptionCtrlHalfWayLabel2 { - + position:absolute; width: 24px; height: 24px; @@ -846,8 +846,8 @@ h2.FuelConsumptionCtrlCFERGraphTitle { font-family: Tipperary, Arial, Helvetica, sans-serif; font-size: 21px; color: #ffffff; - } - + } + .FuelConsumptionCtrlCDFEBarGraphCoreCurrentGreenHighLighted { position: absolute; width: 21px; @@ -856,9 +856,9 @@ h2.FuelConsumptionCtrlCFERGraphTitle { background:url("../images/FuelConsBar_NarrowGreenCurrent.png") center repeat-y; background-size: 21px 100%; } - - - + + + .FuelConsumptionCtrlHevCDFEBarGraphCoreCurrentGreenHighLighted { position: absolute; width: 21px; @@ -866,4 +866,4 @@ h2.FuelConsumptionCtrlCFERGraphTitle { bottom: 0px/*-3px*/; background:url("../images/GeneratedEnergy_NarrowGreenCurrent.png")center bottom repeat-y; z-index: 9; -} \ No newline at end of file +} diff --git a/app/files/tweaks/config/FuelConsumptionTweak/jci/gui/apps/ecoenergy/controls/FuelConsumption/js/FuelConsumptionCtrl.MPG.js b/app/files/tweaks/config/FuelConsumptionTweak/jci/gui/apps/ecoenergy/controls/FuelConsumption/js/FuelConsumptionCtrl.MPG.js index d33fd64..c0afec8 100644 --- a/app/files/tweaks/config/FuelConsumptionTweak/jci/gui/apps/ecoenergy/controls/FuelConsumption/js/FuelConsumptionCtrl.MPG.js +++ b/app/files/tweaks/config/FuelConsumptionTweak/jci/gui/apps/ecoenergy/controls/FuelConsumption/js/FuelConsumptionCtrl.MPG.js @@ -12,8 +12,8 @@ __________________________________________________________________________ Description: IHU GUI FuelConsumptionCtrl) - - Revisions: + + Revisions: v0.1 (01-08-2013) Initial implementation (to 0.3.05 spec) (apeter9) v0.2 (02-20-2013) Changes in layout and bar images (atiwarc) v0.3 (03-14-2013) Implementation of UMP Control panel (atiwarc) @@ -29,7 +29,7 @@ log.addSrcFile("FuelConsumptionCtrl.js", "common"); //log.setLogLevel("FuelConsumptionCtrl", "debug"); function FuelConsumptionCtrl(uiaId, parentDiv, controlId, properties) -{ +{ // log.debug("FuelConsumptionCtrl constructor called..."); this.uiaId = uiaId; @@ -39,7 +39,7 @@ function FuelConsumptionCtrl(uiaId, parentDiv, controlId, properties) this._switchViewButtonCtrl = null; this._umpPanelStatus = false; this._cumulativeBarValue = null; - + this._initialEVMode = new Array(); /******************************************************/ /* Values required by _createStructure (before _init) */ @@ -54,11 +54,11 @@ function FuelConsumptionCtrl(uiaId, parentDiv, controlId, properties) // The index of the slot for new data in the CDFE graph this._newCDFEDataIdx = this._totalCDFEBars - 1; - + // The current bar of CDFE graph this._currentCDFEDataIdx = this._totalCDFEBars; /**********************New Initialization of CDFE Bars *************************************************/ - + this._totalCDFEBarsRight = 6; // The index of the youngest historical data in the CDFE graph @@ -66,29 +66,29 @@ function FuelConsumptionCtrl(uiaId, parentDiv, controlId, properties) // The index of the slot for new data in the CDFE graph this._newCDFEDataIdxRight = this._totalCDFEBarsRight - 1; - + /************************End of Initialization of CFER Bars ******************************************/ - + // Total # of bars (historical + current + new) available in Cumulative Fuel Economy by Reset (CFER) graph this._totalCFERBars = 6; - + // The index of the youngest historical data in the CFER graph this._youngestCFERDataIdx = this._totalCFERBars - 2; // The index of the slot for new data in the CFER graph this._newCFERDataIdx = this._totalCFERBars - 1; - + // The index of the current data in the CFER graph this._currentCFERDataIdx = this._totalCFERBars; // Has the current CFER data been initialized yet? this._currentCFERDataInitialized = false; - - // Table of numerical values used in setting CSS styles programmatically + + // Table of numerical values used in setting CSS styles programmatically // NOTE: Changing these values requires matching changes in SCSS source file! - this._CSSConstants = + this._CSSConstants = { // // CDFE Graph Constants @@ -96,7 +96,7 @@ function FuelConsumptionCtrl(uiaId, parentDiv, controlId, properties) // Width (in pixels) of a bar "CDFEGraphBarWidth" : 21, - + // Space between/around bars "CDFEGraphBarSpacing" : 2, "CDFEGraphBarMargin" : 3, @@ -146,7 +146,7 @@ function FuelConsumptionCtrl(uiaId, parentDiv, controlId, properties) // Width (in pixels) of a bar "CFERGraphBarWidth" :50, - + // Space between/around bars "CFERGraphBarSpacing" : 28, "CFERGraphBarMargin" : 17, @@ -179,9 +179,9 @@ function FuelConsumptionCtrl(uiaId, parentDiv, controlId, properties) this._CDFEGraphBarValues = null; this._CDFEGraphLineValues = null; this._CFERGraphBarValues = null; - + /**************************************Initialization of functions********************************************/ - + this._cbCDFELineFadeAnimationEndRight = null; this._cbCDFELeftAnimationEndRight = null; this._cbCFERLeftAnimationEndRight = null; @@ -194,9 +194,9 @@ function FuelConsumptionCtrl(uiaId, parentDiv, controlId, properties) this._CFERGraphBarValuesRight = null; this._CDFEDiscBarValuesRight = null; this._CDFEEvModeRight = new Array(); - + /**************************************End ofInitialization of functions********************************************/ - + //@formatter:off this.properties = @@ -229,10 +229,10 @@ function FuelConsumptionCtrl(uiaId, parentDiv, controlId, properties) this.properties[key] = properties[key]; } - //preload images + //preload images this.imagesCount = 0; this._preload('FuelConsBar_Narrow.png','FuelConsBar_NarrowCurrent.png','FuelConsBar_NarrowGreen.png', 'FuelConsBar_NarrowGreenCurrent.png', 'FuelConsBar_wide.png', 'FuelConsBar_wide_green.png','FuelConsBar_WideCurrent.png','FuelConsBarCap_Narrow.png','FuelConsBarCap_wide.png','GeneratedEnergy_NarrowCurrent.png','GeneratedEnergy_NarrowGreen.png','GeneratedEnergy_NarrowGreenCurrent.png','GeneratedEnergy_NarrowPurple.png','GeneratedEnergy_Wide_Green.png','GeneratedEnergy_WidePurple.png'); - + // Create DOM elements this._createStructure(); } @@ -250,10 +250,10 @@ FuelConsumptionCtrl.prototype._init = function() this._CDFEGraphLineValues = new Array(); this._CDFEDiscValues = new Array(); /************************************Historical data displayed by CDFE graph Right***********************************/ - + this._CDFEGraphBarValuesRight = new Array(); this._CDFEDiscBarValuesRight = new Array(); - + /************************************End of Historical data displayed by CDFE graph Right ***********************************/ // Historical/current data displayed by CFER graph this._CFERGraphBarValues = new Array(); @@ -263,12 +263,12 @@ FuelConsumptionCtrl.prototype._init = function() // The callback function used to reset the CDFE graph after left animation (insertion) completes this._cbCDFELeftAnimationEnd = this._onCDFELeftAnimationEnd.bind(this); - + /**********************************New function Added ****************************************/ - + // The callback function used to reset the CDFE graph after left animation (insertion) completes this._cbCDFELeftAnimationEndRight = this._onCDFELeftAnimationEndRight.bind(this); - + /***********************************End of New function ****************************************/ // The callback function used to reset the CFER graph after left animation (insertion) completes @@ -284,15 +284,15 @@ FuelConsumptionCtrl.prototype._init = function() // Now that the DOM structure is established, // set the horizontal positions of the graph bars this._setCDFEGraphBarPositions(); - + /**********************************New Function Added*****************************************/ - - + + this._setCDFEGraphBarPositionsRight(); - - + + /********************************End of New Function Added*****************************************/ - + this._setCFERGraphBarPositions(); // Set the CDFE graph title text @@ -302,7 +302,7 @@ FuelConsumptionCtrl.prototype._init = function() this.CDFEGraphTitle.innerHTML = this._stringToHTML(this.properties.currentFuelConfig.titleText); - + // Set the CFER graph title text this.properties.cumulativeFuelConfig.titleText = this._translateString(this.properties.cumulativeFuelConfig.titleId, this.properties.cumulativeFuelConfig.titleText, @@ -355,7 +355,7 @@ FuelConsumptionCtrl.prototype._createStructure = function() // Create the div for control this.divElt = document.createElement('div'); this.divElt.className = "FuelConsumptionCtrl FuelConsumptionCtrlHiddenOpacity"; - // Create the div for ump panel + // Create the div for ump panel this.umpPanelDiv = document.createElement('div'); //(this.properties.umpPanelStatus) ? this.umpPanelDiv.className = "UmpPanelDivEnable" : this.umpPanelDiv.className = "UmpPanelDivDisable"; this.umpPanelDiv.className = "UmpPanelDivDisable"; @@ -371,13 +371,13 @@ FuelConsumptionCtrl.prototype._createStructure = function() // CDFE graph top-level DIV this.CDFEGraph = document.createElement('div'); this.CDFEGraph.className = 'FuelConsumptionCtrlCDFEGraph'; - + /******************************Created New graph Div *****************************************/ - + // CDFE graph top-level DIV 2 this.CDFEGraphRight = document.createElement('div'); this.CDFEGraphRight.className = 'FuelConsumptionCtrlCDFEGraphRight'; - + /******************************End of Created New graph Div **********************************/ // CDFE graph X-axis label @@ -402,13 +402,13 @@ FuelConsumptionCtrl.prototype._createStructure = function() // Clipping mask for active CDFE graph area this.CDFEGraphClipMask = document.createElement('div'); this.CDFEGraphClipMask.className = 'FuelConsumptionCtrlCDFEGraphClipMask'; - + /*****************************************New Mask for CDFE graph*********************************/ - + // Clipping mask for active CDFE graph Right area this.CDFEGraphClipMaskRight = document.createElement('div'); this.CDFEGraphClipMaskRight.className = 'FuelConsumptionCtrlCDFEGraphClipMaskRight'; - + /*****************************************End of New Mask for CDFE graph*********************************/ // Active graphing area for CDFE graph @@ -416,43 +416,43 @@ FuelConsumptionCtrl.prototype._createStructure = function() this.CDFEGraphArea.className = 'FuelConsumptionCtrlCDFEGraphArea'; /***************************************New Active Graphing Area for CDFE graph right***************/ - + // Active graphing area for CDFE graph Right this.CDFEGraphAreaRight = document.createElement('div'); this.CDFEGraphAreaRight.className = 'FuelConsumptionCtrlCDFEGraphAreaRight'; - + /***************************************End of Active Graphing Area for CDFE graph right***************/ // Create CDFE graph bars for (var i = 1; i <= this._totalCDFEBars; i++) { var curCDFEBar = document.createElement('div'); curCDFEBar.id = 'CDFEBar' + i; - + var CDFEBarCap = document.createElement('div'); CDFEBarCap.className = 'FuelConsumptionCtrlCDFEBarGraphCap'; - + switch (i) { case this._newCDFEDataIdx: curCDFEBar.className = 'FuelConsumptionCtrlCDFEBarGraphCoreCurrent'; this.CDFECurrentBar = curCDFEBar; - + break; case this._currentCDFEDataIdx: curCDFEBar.className = 'FuelConsumptionCtrlCDFEBarGraphCoreCurrent'; - + break; default: curCDFEBar.className = 'FuelConsumptionCtrlCDFEBarGraphCore'; break; } - + curCDFEBar.appendChild(CDFEBarCap); this.CDFEGraphArea.appendChild(curCDFEBar); } /*************************************New CDFE Graph Bars**********************************/ - + // Create CDFE graph Right bars for (var i = 1; i <= this._totalCDFEBarsRight; i++) { @@ -464,7 +464,7 @@ FuelConsumptionCtrl.prototype._createStructure = function() curCDFEBarRight.appendChild(CDFEBarCapRight); this.CDFEGraphAreaRight.appendChild(curCDFEBarRight); } - + /*************************************End of New CDFE Graph Bars**********************************/ // Create canvas for drawing line graphs this.CDFELineGraphCanvas = document.createElement('canvas'); @@ -476,92 +476,92 @@ FuelConsumptionCtrl.prototype._createStructure = function() this.CDFEGraphClipMask.appendChild(this.CDFEGraphArea); /**************************New CDFE Clip Mask Attach*******************************************/ - + // Attach the active graphing area to the CDEF graph clip mask this.CDFEGraphClipMaskRight.appendChild(this.CDFEGraphAreaRight); - + /**************************End of New CDFE Clip Mask Attach*******************************************/ - + // Attach the clip mask to the CDFE graph this.CDFEGraph.appendChild(this.CDFEGraphClipMask); - + /**************************New clip mask to the CDFE graph*******************************************/ - + // Attach the clip mask to the CDFE graph Right this.CDFEGraphRight.appendChild(this.CDFEGraphClipMaskRight); - + /**************************End of New clip mask to the CDFE graph*******************************************/ - + // Attach the CDFE graph to its parent this.graphsArea.appendChild(this.CDFEGraph); - + /**************************New CDFE graph to its parent*******************************************/ - + // Start stand alone graph for the hev disc graph if(this.properties.ctrlStyle === "hevstyle") { // CDFE Disc graph top-level DIV this.CDFEDiscGraph = document.createElement('div'); this.CDFEDiscGraph.className = 'FuelConsumptionCtrlCDFEDiscGraph'; - + // Clipping Disc mask for active CDFE graph area this.CDFEDiscGraphClipMask = document.createElement('div'); - this.CDFEDiscGraphClipMask.className = 'FuelConsumptionCtrlCDFEDiscGraphClipMask'; - + this.CDFEDiscGraphClipMask.className = 'FuelConsumptionCtrlCDFEDiscGraphClipMask'; + // Active graphing area for CDFE Disc graph this.CDFEDiscGraphArea = document.createElement('div'); - this.CDFEDiscGraphArea.className = 'FuelConsumptionCtrlCDFEDiscGraphArea'; - + this.CDFEDiscGraphArea.className = 'FuelConsumptionCtrlCDFEDiscGraphArea'; + // Create Disc CDFE graph bars for (var i = 1; i <= this._totalCDFEBars; i++) { var curCDFEDiscBar = document.createElement('div'); curCDFEDiscBar.id = 'CDFEDiscBar' + i; - + switch (i) { case this._newCDFEDataIdx: curCDFEDiscBar.className = 'FuelConsumptionCtrlHevCDFEBarGraphCoreCurrent'; this.CDFECurrentDiscBar = curCDFEDiscBar; - + break; case this._currentCDFEDataIdx: curCDFEDiscBar.className = 'FuelConsumptionCtrlHevCDFEBarGraphCoreCurrent'; - + break; default: curCDFEDiscBar.className = 'FuelConsumptionCtrlHevCDFEBarGraphCore'; break; } - - - + + + this.CDFEDiscGraphArea.appendChild(curCDFEDiscBar); } - + // Attach the active graphing area to the CDEF Disc graph clip mask this.CDFEDiscGraphClipMask.appendChild(this.CDFEDiscGraphArea); - + // Attach the clip mask to the CDFE Disc graph this.CDFEDiscGraph.appendChild(this.CDFEDiscGraphClipMask); - + // Attach the CDFE Disc graph to its parent this.graphsArea.appendChild(this.CDFEDiscGraph); - - + + /************* For the 10 Min bar graph data with Discs *************/ // CDFE Disc graph top-level DIV this.CDFEDiscGraphRight = document.createElement('div'); this.CDFEDiscGraphRight.className = 'FuelConsumptionCtrlCDFEDiscGraphRight'; - + // Clipping Disc mask for active CDFE graph area this.CDFEDiscGraphClipMaskRight = document.createElement('div'); - this.CDFEDiscGraphClipMaskRight.className = 'FuelConsumptionCtrlCDFEDiscGraphClipMaskRight'; - + this.CDFEDiscGraphClipMaskRight.className = 'FuelConsumptionCtrlCDFEDiscGraphClipMaskRight'; + // Active graphing area for CDFE Disc graph this.CDFEDiscGraphAreaRight = document.createElement('div'); - this.CDFEDiscGraphAreaRight.className = 'FuelConsumptionCtrlCDFEDiscGraphAreaRight'; - + this.CDFEDiscGraphAreaRight.className = 'FuelConsumptionCtrlCDFEDiscGraphAreaRight'; + // Create Disc CDFE graph bars for (var k = 1; k <= this._totalCDFEBarsRight; k++) { @@ -570,16 +570,16 @@ FuelConsumptionCtrl.prototype._createStructure = function() curCDFEDiscBarRight.className = 'FuelConsumptionCtrlHevCDFEDiscGraphCoreRight'; this.CDFEDiscGraphAreaRight.appendChild(curCDFEDiscBarRight); } - + // Attach the active graphing area to the CDEF Disc graph clip mask this.CDFEDiscGraphClipMaskRight.appendChild(this.CDFEDiscGraphAreaRight); - + // Attach the clip mask to the CDFE Disc graph this.CDFEDiscGraphRight.appendChild(this.CDFEDiscGraphClipMaskRight); - + // Attach the CDFE Disc graph to its parent this.graphsArea.appendChild(this.CDFEDiscGraphRight); - + } // Attach the CDFE graph to its parent Right this.graphsArea.appendChild(this.CDFEGraphRight); @@ -636,7 +636,7 @@ FuelConsumptionCtrl.prototype._createStructure = function() break; case this._currentCFERDataIdx: curCFERBar.className = 'FuelConsumptionCtrlCFERBarGraphCore'; - + //this.CFERCurrentBar = curCFERBar; break; default: @@ -647,32 +647,32 @@ FuelConsumptionCtrl.prototype._createStructure = function() curCFERBar.appendChild(CFERBarCap); this.CFERGraphArea.appendChild(curCFERBar); } - + this.CFERCurrenBarMask = document.createElement('div'); this.CFERCurrenBarMask.className = 'FuelConsumptionCtrlCFERBarGraphCurrentMask'; - + var CurrentCFERBarCap = document.createElement('div'); CurrentCFERBarCap.className = 'FuelConsumptionCtrlCFERBarGraphCap'; CurrentCFERBarCap.style.marginTop = '-3px'; - + this.CFERCurrentBar = document.createElement('div'); this.CFERCurrentBar.id = 'CFERBar10'; this.CFERCurrentBar.className = 'FuelConsumptionCtrlCFERBarGraphCoreCurrent'; - + this.CFERCurrentBar.appendChild(CurrentCFERBarCap); - + this.CFERCurrenBarMask.appendChild(this.CFERCurrentBar); - + // Create a div for the current Graph value and attach to the parent div this.CFERCurrentBarValue = document.createElement('div'); this.CFERCurrentBarValue.className = 'FuelConsumptionCtrlCFERCurrentBarValue'; - + // Create a div for text of bar value and attach to CFERCurrentBarValueCFERCurrentBarValue this.CFERCurrentBarValueText = document.createElement('div'); this.CFERCurrentBarValueText.className = 'FuelConsumptionCtrlCFERBarValueCurrent'; this.CFERCurrentBarValueText.id = 'CFERBarValueCurrent'; this.CFERCurrentBarValue.appendChild(this.CFERCurrentBarValueText); - + // Attach the active graphing area to the CFER graph clip mask this.CFERGraphClipMask.appendChild(this.CFERGraphArea); @@ -689,14 +689,14 @@ FuelConsumptionCtrl.prototype._createStructure = function() // Fuel efficiency top-level DIV this.fuelEfficiencyArea = document.createElement('div'); this.fuelEfficiencyArea.className = 'FuelConsumptionCtrlFuelEfficiencyArea'; - + // Fuel efficiency title this.fuelEfficiencyTitle = document.createElement('h2'); // Fuel efficiency value display this.fuelEfficiencyValue = document.createElement('div'); this.fuelEfficiencyUnit = document.createElement('div'); this.fuelEfficiencyThisDrive = document.createElement('div'); - + //TODO::Fuel Consumption HEV Style if(this.properties.ctrlStyle === "hevstyle"){ this.fuelEfficiencyTitle.className = 'FuelConsumptionCtrlFuelEfficiencyTitleHev'; @@ -707,7 +707,7 @@ FuelConsumptionCtrl.prototype._createStructure = function() this.fuelEfficiencyHevDivider = document.createElement("div"); this.fuelEfficiencyHevDivider.className = 'FuelConsumptionCtrlFuelEfficiencyHevDivider'; this.fuelEfficiencyArea.appendChild(this.fuelEfficiencyHevDivider); - + //Fuel Efficiency OneDrive Title this.fuelEfficiencyHevOneDriveTitle = document.createElement("div"); this.fuelEfficiencyHevOneDriveTitle.className = 'FuelConsumptionCtrlHevOneDriveText'; @@ -717,7 +717,7 @@ FuelConsumptionCtrl.prototype._createStructure = function() this.properties.oneDriveText, this.properties.subMap); this.fuelEfficiencyHevOneDriveTitle.innerHTML = this.properties.oneDriveText; - + //Fuel Efficiency EVDistance Title this.fuelEfficiencyHevEVDistanceTitle = document.createElement("div"); this.fuelEfficiencyHevEVDistanceTitle.className = 'FuelConsumptionCtrlHevEVDistanceText'; @@ -727,32 +727,32 @@ FuelConsumptionCtrl.prototype._createStructure = function() this.properties.evDistanceText, this.properties.subMap); this.fuelEfficiencyHevEVDistanceTitle.innerHTML = this.properties.evDistanceText; - + //Fuel Efficiency Distance Value this.fuelEfficiencyHevDistanceValue = document.createElement("div"); this.fuelEfficiencyHevDistanceValue.className = 'FuelConsumptionCtrlHevDistanceValue'; this.fuelEfficiencyArea.appendChild(this.fuelEfficiencyHevDistanceValue); - + //Fuel Efficiency Distance Unit this.fuelEfficiencyHevDistanceUnit = document.createElement("div"); this.fuelEfficiencyHevDistanceUnit.className = 'FuelConsumptionCtrlHevDistanceUnit'; this.fuelEfficiencyArea.appendChild(this.fuelEfficiencyHevDistanceUnit); - + //Fuel Efficiency Percent Value this.fuelEfficiencyHevPercentValue = document.createElement("div"); this.fuelEfficiencyHevPercentValue.className = 'FuelConsumptionCtrlHevPercentValue'; this.fuelEfficiencyArea.appendChild(this.fuelEfficiencyHevPercentValue); - + // 20 special case for HEV - + this.halfKmLabel1 = document.createElement('div'); this.halfKmLabel1.className = 'FuelConsumptionCtrlHalfWayLabel1'; this.halfKmLabel1.innerHTML = '20'; - + this.halfKmLabel2 = document.createElement('div'); this.halfKmLabel2.className = 'FuelConsumptionCtrlHalfWayLabel2'; this.halfKmLabel2.innerHTML = '20'; - + this.divElt.appendChild(this.halfKmLabel1); this.divElt.appendChild(this.halfKmLabel2); } @@ -766,13 +766,13 @@ FuelConsumptionCtrl.prototype._createStructure = function() this.fuelEfficiencyArea.appendChild(this.fuelEfficiencyTitle); this.fuelEfficiencyArea.appendChild(this.fuelEfficiencyThisDrive); this.fuelEfficiencyArea.appendChild(this.fuelEfficiencyValue); - + // create container for disc value indicator if(this.properties.ctrlStyle === 'hevstyle') { this.oneDiscValue = document.createElement('div'); this.oneDiscValue.className = 'FuelConsumptionCtrlOneDiscValue'; - + this.properties.whText = this._translateString(this.properties.whUnitId, this.properties.whText, @@ -780,13 +780,13 @@ FuelConsumptionCtrl.prototype._createStructure = function() this.oneDiscValue.innerHTML = '=30'+this.properties.whText; this.oneDiscImage = document.createElement('div'); this.oneDiscImage.className = 'FuelConsumptionCtrlOneDiscIndicator'; - + this.divElt.appendChild(this.oneDiscValue); this.divElt.appendChild(this.oneDiscImage); } - + this.fuelEfficiencyArea.appendChild(this.fuelEfficiencyUnit); - + // Add graphs area to control's top-level container this.divElt.appendChild(this.graphsArea); @@ -794,10 +794,10 @@ FuelConsumptionCtrl.prototype._createStructure = function() this.divElt.appendChild(this.fuelEfficiencyArea); this.divElt.appendChild(this.CFERCurrentBarValue); this.divElt.appendChild(this.CFERCurrenBarMask); - // Attach control to parent + // Attach control to parent this.parentDiv.appendChild(this.divElt); this.parentDiv.appendChild(this.umpPanelDiv); - + var umpConfig = { "buttonConfig" : this.properties['umpButtonConfig'], "defaultSelectCallback" : this.properties['defaultSelectCallback'], @@ -813,7 +813,7 @@ FuelConsumptionCtrl.prototype._createStructure = function() //@formatter:on log.debug("Instantiating umpCtrl..."); this.umpCtrl = framework.instantiateControl(this.uiaId, this.umpPanelDiv, "Ump3Ctrl", umpConfig); - + // "Switch View" button control //@formatter:off var btnInstanceProperties = @@ -838,7 +838,7 @@ FuelConsumptionCtrl.prototype._createStructure = function() btnInstanceProperties); } - + this._init(); } @@ -926,16 +926,16 @@ FuelConsumptionCtrl.prototype._addCDFEGraphAxisLabels = function(xDiv, yDiv) barLabel.style.width = this._CSSConstants["CDFEGraphBarWidthRight"] + 'px'; xDiv.appendChild(barLabel); - + this.yLimitValueLabelCDFE = document.createElement('span'); this.yLimitValueLabelCDFE.innerHTML = this.properties.currentFuelConfig.yAxisLimitValue; yDiv.appendChild(this.yLimitValueLabelCDFE); - + var yUnitLabel = document.createElement('span'); yUnitLabel.style.position = 'absolute'; yUnitLabel.style.width = '100px'; yUnitLabel.style.top = '90px'; - + var yZeroLabel = document.createElement('span'); this.properties.currentFuelConfig.yAxisLabelText = this._translateString(this.properties.currentFuelConfig.yAxisLabelId, @@ -944,7 +944,7 @@ FuelConsumptionCtrl.prototype._addCDFEGraphAxisLabels = function(xDiv, yDiv) yUnitLabel.innerHTML = this.properties.currentFuelConfig.yAxisLabelText; var xAxisLabelMinuteText = this._translateString(this.properties.xAxisLabelMinuteId, this.properties.xAxisLabelMinuteText, this.properties.subMap); - + yZeroLabel.innerHTML = '0'+xAxisLabelMinuteText; yZeroLabel.style.position = 'absolute'; yZeroLabel.style.width = '60px'; @@ -952,7 +952,7 @@ FuelConsumptionCtrl.prototype._addCDFEGraphAxisLabels = function(xDiv, yDiv) yZeroLabel.style.left = '466px'; this.yZeroLabelCDFE = yUnitLabel; yDiv.appendChild(yUnitLabel); - yDiv.appendChild(yZeroLabel); + yDiv.appendChild(yZeroLabel); } /* @@ -973,8 +973,8 @@ FuelConsumptionCtrl.prototype._setCDFEGraphBarPositions = function() { bar.style.left = currentLeft + 'px'; } - - + + // Adding new disc logic for hevstyle if(this.properties.ctrlStyle === 'hevstyle') { @@ -984,7 +984,7 @@ FuelConsumptionCtrl.prototype._setCDFEGraphBarPositions = function() disc.style.left = currentLeft + 'px'; } } - + currentLeft += leftInc; } } @@ -1005,7 +1005,7 @@ FuelConsumptionCtrl.prototype._setCDFEGraphBarPositionsRight = function() { barRight.style.left = currentLeftMarginRight + 'px'; } - + // Adding new disc logic for hevstyle if(this.properties.ctrlStyle === 'hevstyle') { @@ -1015,7 +1015,7 @@ FuelConsumptionCtrl.prototype._setCDFEGraphBarPositionsRight = function() disc.style.left = currentLeftMarginRight + 'px'; } } - + currentLeftMarginRight += leftIncRight; } } @@ -1109,7 +1109,7 @@ FuelConsumptionCtrl.prototype._setCDFEGraphBarHeightTransitionsRight = function( { bar.style.OTransition = transitionStr; } - + if(this.properties.ctrlStyle === 'hevstyle') { var disc = document.getElementById('CDFEDiscBarRight' + (i + 1)); @@ -1137,10 +1137,10 @@ FuelConsumptionCtrl.prototype._setCDFEGraphBarHeight = function(barIdx,HEVMode) this._CDFEGraphBarValues[barIdx], this.properties.currentFuelConfig.yAxisLimitValue, false) + 'px'; - - + + } - + if(this.properties.ctrlStyle === 'hevstyle') { var disc = document.getElementById('CDFEDiscBar' + (barIdx + 1)); @@ -1161,7 +1161,7 @@ FuelConsumptionCtrl.prototype._setCDFEGraphBarHeight = function(barIdx,HEVMode) disc.className = 'FuelConsumptionCtrlHevCDFEBarGraphCoreCurrent'; } disc.style.height = this._CDFEDiscValues[barIdx]+'px'; - + } } } @@ -1202,7 +1202,7 @@ FuelConsumptionCtrl.prototype._setCDFEGraphBarHeights = function() yLimit, false) + 'px'; } - + if(this.properties.ctrlStyle === 'hevstyle') { var disc = document.getElementById('CDFEDiscBar' + (i + 1)); @@ -1225,11 +1225,11 @@ FuelConsumptionCtrl.prototype._setCDFEGraphBarHeightsRight = function() // Cache reused values var graphHeight = this._CSSConstants["CDFEGraphVisibleHeightRight"]; var yLimit = this.properties.currentFuelConfig.yAxisLimitValue; - + for (var i = 0; i < this._totalCDFEBarsRight; i++) { var bar = document.getElementById('CDFEBarRight' + (i + 1)); - + if (bar) { bar.style.height = this._scaleDataToGraphY(graphHeight, @@ -1238,13 +1238,13 @@ FuelConsumptionCtrl.prototype._setCDFEGraphBarHeightsRight = function() false) + 'px'; } if(this.properties.ctrlStyle === 'hevstyle') - { + { var disc = document.getElementById('CDFEDiscBarRight' + (i + 1)); if (disc) { disc.style.height = this._CDFEDiscBarValuesRight[i]+ 'px'; } - } + } } } @@ -1362,12 +1362,12 @@ FuelConsumptionCtrl.prototype._resetCDFEGraph = function(animateBars) { this.CDFEDiscGraphArea.style.OTransition = 'none'; } - + // Enable/disable height transitions for the CDFE graph bars this._setCDFEGraphBarHeightTransitions(animateBars); if(this.properties.ctrlStyle === 'hevstyle') { - + for(var i = 0; i <= 10; i++) { var bar = document.getElementById('CDFEBar'+(i+1)); @@ -1382,7 +1382,7 @@ FuelConsumptionCtrl.prototype._resetCDFEGraph = function(animateBars) this.CDFECurrentBar.className = 'FuelConsumptionCtrlCDFEBarGraphCoreCurrentGreenHighLighted'; break; } - + } else { @@ -1414,7 +1414,7 @@ FuelConsumptionCtrl.prototype._resetCDFEGraph = function(animateBars) } this._setCDFEGraphBarHeights(); - + // Disable/enable height transitions for the CDFE graph bars this._setCDFEGraphBarHeightTransitions(!animateBars); } @@ -1425,7 +1425,7 @@ FuelConsumptionCtrl.prototype._resetCDFEGraphRight = function(animateBars) // Make sure left transitions are OFF for the CDFE graph active area while we redraw it this.CDFEGraphAreaRight.style.OTransition = 'none'; - + if(this.properties.ctrlStyle === 'hevstyle') { this.CDFEDiscGraphAreaRight.style.OTransition = 'none'; @@ -1433,7 +1433,7 @@ FuelConsumptionCtrl.prototype._resetCDFEGraphRight = function(animateBars) // Enable/disable height transitions for the CDFE graph bars this._setCDFEGraphBarHeightTransitionsRight(animateBars); - + if(this.properties.ctrlStyle === 'hevstyle') { for(var i = 0; i < 5; i++) @@ -1452,8 +1452,8 @@ FuelConsumptionCtrl.prototype._resetCDFEGraphRight = function(animateBars) } } } - - + + // Reposition the CDFE graph active area & reconstruct the bar/line graph // (should be no visible difference afterwards) this.CDFEGraphAreaRight.style.left = '0px'; @@ -1479,7 +1479,7 @@ FuelConsumptionCtrl.prototype._onCDFELineFadeAnimationEnd = function(e) // Stop propagating the event e.stopPropagation(); - + // Disable the line graph fade animation this._setCDFELineGraphFadeTransitions(false); } @@ -1548,7 +1548,7 @@ FuelConsumptionCtrl.prototype._addCFERGraphAxisLabels = function(xDiv, yDiv) span.style.left = currentLeft + 'px'; span.style.width = this._CSSConstants["CFERGraphBarWidth"] + 'px'; span.style.textAlign = 'center'; - + if (i === (this._currentCFERDataIdx - 1)) { this.properties.cumulativeFuelConfig.xAxisLabelText = @@ -1565,15 +1565,15 @@ FuelConsumptionCtrl.prototype._addCFERGraphAxisLabels = function(xDiv, yDiv) { span.innerHTML = (this._currentCFERDataIdx - i) + ''; } - + } - - + + currentLeft += leftInc; xDiv.appendChild(span); } - + this.yLimitValueLabelCFER = document.createElement('span'); this.yLimitValueLabelCFER.innerHTML = this.properties.cumulativeFuelConfig.yAxisLimitValue; yDiv.appendChild(this.yLimitValueLabelCFER); @@ -1630,7 +1630,7 @@ FuelConsumptionCtrl.prototype._setCFERGraphBarHeightTransitions = function(isEna // log.debug("FuelConsumptionCtrl: _setCFERGraphBarHeightTransitions() called: isEnabled = " + isEnabled); var transitionStr; - + // TODO: Figure out why this needs to be backwards to work! if (!isEnabled) { @@ -1661,32 +1661,32 @@ FuelConsumptionCtrl.prototype._setCFERGraphBarHeightTransitions = function(isEna FuelConsumptionCtrl.prototype._setCFERGraphBarHeight = function(barIdx) { // log.debug("FuelConsumptionCtrl: _setCFERGraphBarHeight() called: barIdx = " + barIdx); - + var bar = document.getElementById('CFERBar' + (barIdx + 1)); if (bar) { - + bar.style.height = this._scaleDataToGraphY(this._CSSConstants["CFERGraphVisibleHeight"], this._CFERGraphBarValues[barIdx], this.properties.cumulativeFuelConfig.yAxisLimitValue, false) + 'px'; - + } } FuelConsumptionCtrl.prototype._setCFERGraphBarHeightNew = function(barIdx) { // log.debug("FuelConsumptionCtrl: _setCFERGraphBarHeight() called: barIdx = " + barIdx); - + var bar = document.getElementById('CFERBar' + (barIdx + 1)); if (bar) { - + bar.style.height = this._scaleDataToGraphY(this._CSSConstants["CFERGraphVisibleHeight"], this._CFERGraphBarValues[barIdx + 1], this.properties.cumulativeFuelConfig.yAxisLimitValue, false) + 'px'; - + // Set the height of the current bar value to retain its display positioon on top of current bar this.CFERCurrentBarValue.style.height = this._scaleDataToGraphY(this._CSSConstants["CFERGraphVisibleHeight"], this._CFERGraphBarValues[barIdx + 1], @@ -1753,10 +1753,10 @@ FuelConsumptionCtrl.prototype._onCFERLeftAnimationEnd = function(e) // Remove the event listener that got us here this.CFERGraphArea.removeEventListener('oTransitionEnd', this._cbCFERLeftAnimationEnd, false); - + // Stop propagating the event e.stopPropagation(); - + // Reset the CFER graph without bar animations this._resetCFERGraph(false); } @@ -1781,7 +1781,7 @@ FuelConsumptionCtrl.prototype._scaleDataToGraphY = function(maxY, dataValue, max { yVal = maxY - yVal; } - + return yVal; } @@ -1836,7 +1836,7 @@ FuelConsumptionCtrl.prototype.initializeCurrentDriveFuelGraph = function(initial // Initialize the CDFE graph with bar animations this._resetCDFEGraph(true); - + } // to initialise the HEV fuel eco bar graph with the disc @@ -1909,13 +1909,13 @@ FuelConsumptionCtrl.prototype.initializeCurrentDriveFuelGraphRight = function(in { this._CDFEGraphBarValuesRight[this._youngestCDFEDataIdxRight - ibvIdx] = 0; } - + } // Initialize the "hidden" slot for new data this._CDFEGraphBarValuesRight[this._newCDFEDataIdxRight] = 0; } - + // Initialize the CDFE graph with bar animations this._resetCDFEGraphRight(true); @@ -1931,14 +1931,16 @@ FuelConsumptionCtrl.prototype.initializeHEVCurrentDriveFuelGraphRight = function // data to zero. for (var ibvIdx = 0; ibvIdx <= this._youngestCDFEDataIdxRight; ibvIdx++) { - if (initialBarValues[ibvIdx]) + //if (initialBarValues[ibvIdx]) + if (typeof(initialBarValues[ibvIdx]) === 'number') { this._CDFEGraphBarValuesRight[this._youngestCDFEDataIdxRight - ibvIdx] = initialBarValues[ibvIdx]; - if(initialHalfDiscs[ibvIdx]) + //if(initialHalfDiscs[ibvIdx]) + if(initialHalfDiscs[ibvIdx]=== true) { this._CDFEDiscBarValuesRight[this._youngestCDFEDataIdxRight - ibvIdx] = initialLDiscValues[ibvIdx] * 13 + 7; } - else + else if(initialHalfDiscs[ibvIdx]=== false) { this._CDFEDiscBarValuesRight[this._youngestCDFEDataIdxRight - ibvIdx] = initialLDiscValues[ibvIdx] * 13; } @@ -1949,14 +1951,14 @@ FuelConsumptionCtrl.prototype.initializeHEVCurrentDriveFuelGraphRight = function this._CDFEGraphBarValuesRight[this._youngestCDFEDataIdxRight - ibvIdx] = 0; this._CDFEDiscBarValuesRight[this._youngestCDFEDataIdxRight - ibvIdx] = 0; } - + } // Initialize the "hidden" slot for new data this._CDFEGraphBarValuesRight[this._newCDFEDataIdxRight] = 0; this._CDFEDiscBarValuesRight[this._newCDFEDataIdxRight] = 0; } - + // Initialize the CDFE graph with bar animations this._resetCDFEGraphRight(true); } @@ -1981,20 +1983,20 @@ FuelConsumptionCtrl.prototype.insertCurrentDriveFuelGraph = function(currentBarV // Update the new value's bar in the CDFE graph this._setCDFEGraphBarHeight(this._newCDFEDataIdx); - + this.CDFECurrentBar.className = 'FuelConsumptionCtrlCDFEBarGraphCore'; - + // Turn on left transitions for the CDFE graph (for the next animation) this.CDFEGraphArea.style.OTransition = 'left 0.6s ease 0s'; - + // Attach an event listener to the CDFE graph area so we can detect when // the slide animation ends (and reset the graph for the next animation) this.CDFEGraphArea.addEventListener('oTransitionEnd', this._cbCDFELeftAnimationEnd, false); // Set the graph's position, triggering the animation // ("normal" left - (width of one bar + bar spacing)) - this.CDFEGraphArea.style.left = '-' + (this._CSSConstants["CDFEGraphBarWidth"] + + this.CDFEGraphArea.style.left = '-' + (this._CSSConstants["CDFEGraphBarWidth"] + this._CSSConstants["CDFEGraphBarSpacing"]) + 'px'; this._CDFELineGraphInTransition = true; @@ -2015,15 +2017,16 @@ FuelConsumptionCtrl.prototype.insertHEVFuelGraph = function(currentBarValue, cur if (typeof(currentBarValue) === 'number') { this._CDFEGraphBarValues[this._newCDFEDataIdx] = currentBarValue; - if(currentHalfDisc) + //if(currentHalfDisc) + if(currentHalfDisc===true) { this._CDFEDiscValues[this._newCDFEDataIdx] = currentDiscs * 13 + 7; } - else + else if(currentHalfDisc===false) { this._CDFEDiscValues[this._newCDFEDataIdx] = currentDiscs * 13; } - this._initialEVMode[this._newCDFEDataIdx] = currentHEVMode; + this._initialEVMode[this._newCDFEDataIdx] = currentHEVMode; } else { @@ -2044,30 +2047,30 @@ FuelConsumptionCtrl.prototype.insertHEVFuelGraph = function(currentBarValue, cur } // Update the new value's bar in the CDFE graph this._setCDFEGraphBarHeight(this._newCDFEDataIdx,currentHEVMode); - + // Turn on left transitions for the CDFE graph (for the next animation) this.CDFEGraphArea.style.OTransition = 'left 0.6s ease 0s'; this.CDFEDiscGraphArea.style.OTransition = 'left 0.6s ease 0s'; - + // Attach an event listener to the CDFE graph area so we can detect when // the slide animation ends (and reset the graph for the next animation) this.CDFEGraphArea.addEventListener('oTransitionEnd', this._cbCDFELeftAnimationEnd, false); // Set the graph's position, triggering the animation // ("normal" left - (width of one bar + bar spacing)) - this.CDFEGraphArea.style.left = '-' + (this._CSSConstants["CDFEGraphBarWidth"] + + this.CDFEGraphArea.style.left = '-' + (this._CSSConstants["CDFEGraphBarWidth"] + this._CSSConstants["CDFEGraphBarSpacing"]) + 'px'; - - this.CDFEDiscGraphArea.style.left = '-' + (this._CSSConstants["CDFEGraphBarWidth"] + + + this.CDFEDiscGraphArea.style.left = '-' + (this._CSSConstants["CDFEGraphBarWidth"] + this._CSSConstants["CDFEGraphBarSpacing"]) + 'px'; - + this._CDFELineGraphInTransition = true; // Update the data sets to discard the oldest historical data for (var i = 0; i <= this._youngestCDFEDataIdx; i++) { this._CDFEGraphBarValues[i] = this._CDFEGraphBarValues[i + 1]; this._CDFEDiscValues[i] = this._CDFEDiscValues[i + 1]; - this._initialEVMode[i] = this._initialEVMode[i+1]; + this._initialEVMode[i] = this._initialEVMode[i+1]; } //if(currentHEVMode) @@ -2114,7 +2117,7 @@ FuelConsumptionCtrl.prototype.insertCurrentDriveFuelGraphRight = function(curren // Set the graph's position, triggering the animation // ("normal" left - (width of one bar + bar spacing)) - this.CDFEGraphAreaRight.style.left = '-' + (this._CSSConstants["CDFEGraphBarWidthRight"] + + this.CDFEGraphAreaRight.style.left = '-' + (this._CSSConstants["CDFEGraphBarWidthRight"] + this._CSSConstants["CDFEGraphBarSpacingRight"]) + 'px'; // Update the data sets to discard the oldest historical data @@ -2172,7 +2175,7 @@ FuelConsumptionCtrl.prototype.insertCurrentCumulativeFuelGraph = function(newRes { this._CFERGraphBarValues[this._newCFERDataIdx] = 0.0; } - + // Update the new value's bar in the CFER graph this._setCFERGraphBarHeight(this._newCFERDataIdx); @@ -2202,10 +2205,10 @@ FuelConsumptionCtrl.prototype.updateCurrentCumulativeFuelGraph = function(curren { log.debug("FuelConsumptionCtrl: updateCurrentCumulativeFuelGraph() called: currentBarValue = " + currentBarValue); - + // Save the current bar value var tempNumber = currentBarValue; - + if(currentBarValue == null) { currentBarValue = 0; @@ -2215,16 +2218,16 @@ FuelConsumptionCtrl.prototype.updateCurrentCumulativeFuelGraph = function(curren { tempNumber = '0.0'; } - + currentBarValue = parseFloat(currentBarValue); this._cumulativeBarValue = tempNumber; - - // Check if current bar value exceeds the unit range + + // Check if current bar value exceeds the unit range if(currentBarValue > unitRange) { currentBarValue = unitRange; } - + if (typeof(currentBarValue) === 'number') { this._CFERGraphBarValues[10] = currentBarValue; @@ -2234,12 +2237,12 @@ FuelConsumptionCtrl.prototype.updateCurrentCumulativeFuelGraph = function(curren this._CFERGraphBarValues[10] = 0.0; tempNumber = '0.0'; } - - + + var currentValueDiv = document.getElementById("CFERBarValueCurrent"); currentValueDiv.className = 'FuelConsumptionCtrlCFERBarValueCurrent'; - + currentValueDiv.innerHTML = this._stringToHTML(tempNumber); // Update the current bar var bar = document.getElementById('CFERBar' + 10); @@ -2281,24 +2284,24 @@ FuelConsumptionCtrl.prototype.setFuelEfficiency = function(fuelEfficiencyData) if (fuelEfficiencyUnitText == "L/100km") { // Prevent Divide-By-Zero Error - if (parseFloat(this.properties.fuelEfficiencyData.fuelEfficiency) > 0) + if (parseFloat(this.properties.fuelEfficiencyData.fuelEfficiency) > 0) { - this.fuelEfficiencyValue.innerHTML = this.properties.fuelEfficiencyData.fuelEfficiency + + this.fuelEfficiencyValue.innerHTML = this.properties.fuelEfficiencyData.fuelEfficiency + "
    " + "
    " + "
    " + ((235.214/parseFloat(this.properties.fuelEfficiencyData.fuelEfficiency)).toFixed(1)).toString(); } else - { + { this.fuelEfficiencyValue.innerHTML = this.properties.fuelEfficiencyData.fuelEfficiency + "
    " + "
    " + "
    " + "0.0"; } } // calculate km/L if the fuel efficiency unit is "mpg" else - { - this.fuelEfficiencyValue.innerHTML = this.properties.fuelEfficiencyData.fuelEfficiency + + { + this.fuelEfficiencyValue.innerHTML = this.properties.fuelEfficiencyData.fuelEfficiency + "
    " + "
    " + "
    " + ((parseFloat(this.properties.fuelEfficiencyData.fuelEfficiency)*0.4251).toFixed(1)).toString(); } this.fuelEfficiencyUnit.innerHTML = fuelEfficiencyUnitText + "
    " + "
    " + "
    " + "MPG"; - // **** End of the fuel efficiency "km/L" + // **** End of the fuel efficiency "km/L" } else { @@ -2311,23 +2314,23 @@ FuelConsumptionCtrl.prototype.setFuelEfficiency = function(fuelEfficiencyData) FuelConsumptionCtrl.prototype.setEvDrvDistance = function(evObj) { - + var driveDisUnit = this._translateString(evObj.unitId, evObj.unitId, this.properties.subMap); this.fuelEfficiencyHevDistanceUnit.innerHTML = this._stringToHTML(driveDisUnit); - + if(evObj.driveDistance !== null) - { + { this.fuelEfficiencyHevDistanceValue.innerHTML = evObj.driveDistance; } else { this.fuelEfficiencyHevDistanceValue.innerHTML = "--.-" ; } - + if(evObj.percentValue !== null) { this.fuelEfficiencyHevPercentValue.innerHTML = "("+evObj.percentValue+"%)"; - } + } else { this.fuelEfficiencyHevPercentValue.innerHTML = "(--)" ; @@ -2340,7 +2343,7 @@ FuelConsumptionCtrl.prototype.setUnitInformation = function(obj) this.properties.currentFuelConfig.yAxisLimitValue = obj.yAxisLimitValue; this.properties.cumulativeFuelConfig.yAxisLabelId = obj.yAxisLabelId; this.properties.currentFuelConfig.yAxisLabelId = obj.yAxisLabelId; - + this.properties.cumulativeFuelConfig.yAxisLabelText = this._translateString(this.properties.cumulativeFuelConfig.yAxisLabelId, this.properties.cumulativeFuelConfig.yAxisLabelText, @@ -2350,7 +2353,7 @@ FuelConsumptionCtrl.prototype.setUnitInformation = function(obj) this._translateString(this.properties.currentFuelConfig.yAxisLabelId, this.properties.currentFuelConfig.yAxisLabelText, this.properties.subMap); - + this.yZeroLabelCDFE.innerHTML = this.properties.currentFuelConfig.yAxisLabelText; this.yLimitValueLabelCDFE.innerHTML = this.properties.currentFuelConfig.yAxisLimitValue; this.yZeroLabelCFER.innerHTML = '
    ' + this.properties.cumulativeFuelConfig.yAxisLabelText; @@ -2421,7 +2424,7 @@ FuelConsumptionCtrl.prototype.restoreContext = function(controlContextCapture) FuelConsumptionCtrl.prototype.handleControllerEvent = function(eventId) { log.debug("FuelConsumptionCtrl: handleControllerEvent() called: " + eventId); - + // Pass-through if(this._umpPanelStatus && this.umpCtrl) { @@ -2448,4 +2451,4 @@ FuelConsumptionCtrl.prototype.cleanUp = function() } } -framework.registerCtrlLoaded("FuelConsumptionCtrl"); \ No newline at end of file +framework.registerCtrlLoaded("FuelConsumptionCtrl"); diff --git a/app/files/tweaks/config/FuelConsumptionTweak/jci/gui/apps/ecoenergy/controls/FuelConsumption/js/FuelConsumptionCtrl.js b/app/files/tweaks/config/FuelConsumptionTweak/jci/gui/apps/ecoenergy/controls/FuelConsumption/js/FuelConsumptionCtrl.js index dba34ca..d0009b2 100644 --- a/app/files/tweaks/config/FuelConsumptionTweak/jci/gui/apps/ecoenergy/controls/FuelConsumption/js/FuelConsumptionCtrl.js +++ b/app/files/tweaks/config/FuelConsumptionTweak/jci/gui/apps/ecoenergy/controls/FuelConsumption/js/FuelConsumptionCtrl.js @@ -12,8 +12,8 @@ __________________________________________________________________________ Description: IHU GUI FuelConsumptionCtrl) - - Revisions: + + Revisions: v0.1 (01-08-2013) Initial implementation (to 0.3.05 spec) (apeter9) v0.2 (02-20-2013) Changes in layout and bar images (atiwarc) v0.3 (03-14-2013) Implementation of UMP Control panel (atiwarc) @@ -29,7 +29,7 @@ log.addSrcFile("FuelConsumptionCtrl.js", "common"); //log.setLogLevel("FuelConsumptionCtrl", "debug"); function FuelConsumptionCtrl(uiaId, parentDiv, controlId, properties) -{ +{ // log.debug("FuelConsumptionCtrl constructor called..."); this.uiaId = uiaId; @@ -39,7 +39,7 @@ function FuelConsumptionCtrl(uiaId, parentDiv, controlId, properties) this._switchViewButtonCtrl = null; this._umpPanelStatus = false; this._cumulativeBarValue = null; - + this._initialEVMode = new Array(); /******************************************************/ /* Values required by _createStructure (before _init) */ @@ -54,11 +54,11 @@ function FuelConsumptionCtrl(uiaId, parentDiv, controlId, properties) // The index of the slot for new data in the CDFE graph this._newCDFEDataIdx = this._totalCDFEBars - 1; - + // The current bar of CDFE graph this._currentCDFEDataIdx = this._totalCDFEBars; /**********************New Initialization of CDFE Bars *************************************************/ - + this._totalCDFEBarsRight = 6; // The index of the youngest historical data in the CDFE graph @@ -66,29 +66,29 @@ function FuelConsumptionCtrl(uiaId, parentDiv, controlId, properties) // The index of the slot for new data in the CDFE graph this._newCDFEDataIdxRight = this._totalCDFEBarsRight - 1; - + /************************End of Initialization of CFER Bars ******************************************/ - + // Total # of bars (historical + current + new) available in Cumulative Fuel Economy by Reset (CFER) graph this._totalCFERBars = 6; - + // The index of the youngest historical data in the CFER graph this._youngestCFERDataIdx = this._totalCFERBars - 2; // The index of the slot for new data in the CFER graph this._newCFERDataIdx = this._totalCFERBars - 1; - + // The index of the current data in the CFER graph this._currentCFERDataIdx = this._totalCFERBars; // Has the current CFER data been initialized yet? this._currentCFERDataInitialized = false; - - // Table of numerical values used in setting CSS styles programmatically + + // Table of numerical values used in setting CSS styles programmatically // NOTE: Changing these values requires matching changes in SCSS source file! - this._CSSConstants = + this._CSSConstants = { // // CDFE Graph Constants @@ -96,7 +96,7 @@ function FuelConsumptionCtrl(uiaId, parentDiv, controlId, properties) // Width (in pixels) of a bar "CDFEGraphBarWidth" : 21, - + // Space between/around bars "CDFEGraphBarSpacing" : 2, "CDFEGraphBarMargin" : 3, @@ -146,7 +146,7 @@ function FuelConsumptionCtrl(uiaId, parentDiv, controlId, properties) // Width (in pixels) of a bar "CFERGraphBarWidth" :50, - + // Space between/around bars "CFERGraphBarSpacing" : 28, "CFERGraphBarMargin" : 17, @@ -179,9 +179,9 @@ function FuelConsumptionCtrl(uiaId, parentDiv, controlId, properties) this._CDFEGraphBarValues = null; this._CDFEGraphLineValues = null; this._CFERGraphBarValues = null; - + /**************************************Initialization of functions********************************************/ - + this._cbCDFELineFadeAnimationEndRight = null; this._cbCDFELeftAnimationEndRight = null; this._cbCFERLeftAnimationEndRight = null; @@ -194,9 +194,9 @@ function FuelConsumptionCtrl(uiaId, parentDiv, controlId, properties) this._CFERGraphBarValuesRight = null; this._CDFEDiscBarValuesRight = null; this._CDFEEvModeRight = new Array(); - + /**************************************End ofInitialization of functions********************************************/ - + //@formatter:off this.properties = @@ -229,10 +229,10 @@ function FuelConsumptionCtrl(uiaId, parentDiv, controlId, properties) this.properties[key] = properties[key]; } - //preload images + //preload images this.imagesCount = 0; this._preload('FuelConsBar_Narrow.png','FuelConsBar_NarrowCurrent.png','FuelConsBar_NarrowGreen.png', 'FuelConsBar_NarrowGreenCurrent.png', 'FuelConsBar_wide.png', 'FuelConsBar_wide_green.png','FuelConsBar_WideCurrent.png','FuelConsBarCap_Narrow.png','FuelConsBarCap_wide.png','GeneratedEnergy_NarrowCurrent.png','GeneratedEnergy_NarrowGreen.png','GeneratedEnergy_NarrowGreenCurrent.png','GeneratedEnergy_NarrowPurple.png','GeneratedEnergy_Wide_Green.png','GeneratedEnergy_WidePurple.png'); - + // Create DOM elements this._createStructure(); } @@ -250,10 +250,10 @@ FuelConsumptionCtrl.prototype._init = function() this._CDFEGraphLineValues = new Array(); this._CDFEDiscValues = new Array(); /************************************Historical data displayed by CDFE graph Right***********************************/ - + this._CDFEGraphBarValuesRight = new Array(); this._CDFEDiscBarValuesRight = new Array(); - + /************************************End of Historical data displayed by CDFE graph Right ***********************************/ // Historical/current data displayed by CFER graph this._CFERGraphBarValues = new Array(); @@ -263,12 +263,12 @@ FuelConsumptionCtrl.prototype._init = function() // The callback function used to reset the CDFE graph after left animation (insertion) completes this._cbCDFELeftAnimationEnd = this._onCDFELeftAnimationEnd.bind(this); - + /**********************************New function Added ****************************************/ - + // The callback function used to reset the CDFE graph after left animation (insertion) completes this._cbCDFELeftAnimationEndRight = this._onCDFELeftAnimationEndRight.bind(this); - + /***********************************End of New function ****************************************/ // The callback function used to reset the CFER graph after left animation (insertion) completes @@ -284,15 +284,15 @@ FuelConsumptionCtrl.prototype._init = function() // Now that the DOM structure is established, // set the horizontal positions of the graph bars this._setCDFEGraphBarPositions(); - + /**********************************New Function Added*****************************************/ - - + + this._setCDFEGraphBarPositionsRight(); - - + + /********************************End of New Function Added*****************************************/ - + this._setCFERGraphBarPositions(); // Set the CDFE graph title text @@ -302,7 +302,7 @@ FuelConsumptionCtrl.prototype._init = function() this.CDFEGraphTitle.innerHTML = this._stringToHTML(this.properties.currentFuelConfig.titleText); - + // Set the CFER graph title text this.properties.cumulativeFuelConfig.titleText = this._translateString(this.properties.cumulativeFuelConfig.titleId, this.properties.cumulativeFuelConfig.titleText, @@ -355,7 +355,7 @@ FuelConsumptionCtrl.prototype._createStructure = function() // Create the div for control this.divElt = document.createElement('div'); this.divElt.className = "FuelConsumptionCtrl FuelConsumptionCtrlHiddenOpacity"; - // Create the div for ump panel + // Create the div for ump panel this.umpPanelDiv = document.createElement('div'); //(this.properties.umpPanelStatus) ? this.umpPanelDiv.className = "UmpPanelDivEnable" : this.umpPanelDiv.className = "UmpPanelDivDisable"; this.umpPanelDiv.className = "UmpPanelDivDisable"; @@ -371,13 +371,13 @@ FuelConsumptionCtrl.prototype._createStructure = function() // CDFE graph top-level DIV this.CDFEGraph = document.createElement('div'); this.CDFEGraph.className = 'FuelConsumptionCtrlCDFEGraph'; - + /******************************Created New graph Div *****************************************/ - + // CDFE graph top-level DIV 2 this.CDFEGraphRight = document.createElement('div'); this.CDFEGraphRight.className = 'FuelConsumptionCtrlCDFEGraphRight'; - + /******************************End of Created New graph Div **********************************/ // CDFE graph X-axis label @@ -402,13 +402,13 @@ FuelConsumptionCtrl.prototype._createStructure = function() // Clipping mask for active CDFE graph area this.CDFEGraphClipMask = document.createElement('div'); this.CDFEGraphClipMask.className = 'FuelConsumptionCtrlCDFEGraphClipMask'; - + /*****************************************New Mask for CDFE graph*********************************/ - + // Clipping mask for active CDFE graph Right area this.CDFEGraphClipMaskRight = document.createElement('div'); this.CDFEGraphClipMaskRight.className = 'FuelConsumptionCtrlCDFEGraphClipMaskRight'; - + /*****************************************End of New Mask for CDFE graph*********************************/ // Active graphing area for CDFE graph @@ -416,43 +416,43 @@ FuelConsumptionCtrl.prototype._createStructure = function() this.CDFEGraphArea.className = 'FuelConsumptionCtrlCDFEGraphArea'; /***************************************New Active Graphing Area for CDFE graph right***************/ - + // Active graphing area for CDFE graph Right this.CDFEGraphAreaRight = document.createElement('div'); this.CDFEGraphAreaRight.className = 'FuelConsumptionCtrlCDFEGraphAreaRight'; - + /***************************************End of Active Graphing Area for CDFE graph right***************/ // Create CDFE graph bars for (var i = 1; i <= this._totalCDFEBars; i++) { var curCDFEBar = document.createElement('div'); curCDFEBar.id = 'CDFEBar' + i; - + var CDFEBarCap = document.createElement('div'); CDFEBarCap.className = 'FuelConsumptionCtrlCDFEBarGraphCap'; - + switch (i) { case this._newCDFEDataIdx: curCDFEBar.className = 'FuelConsumptionCtrlCDFEBarGraphCoreCurrent'; this.CDFECurrentBar = curCDFEBar; - + break; case this._currentCDFEDataIdx: curCDFEBar.className = 'FuelConsumptionCtrlCDFEBarGraphCoreCurrent'; - + break; default: curCDFEBar.className = 'FuelConsumptionCtrlCDFEBarGraphCore'; break; } - + curCDFEBar.appendChild(CDFEBarCap); this.CDFEGraphArea.appendChild(curCDFEBar); } /*************************************New CDFE Graph Bars**********************************/ - + // Create CDFE graph Right bars for (var i = 1; i <= this._totalCDFEBarsRight; i++) { @@ -464,7 +464,7 @@ FuelConsumptionCtrl.prototype._createStructure = function() curCDFEBarRight.appendChild(CDFEBarCapRight); this.CDFEGraphAreaRight.appendChild(curCDFEBarRight); } - + /*************************************End of New CDFE Graph Bars**********************************/ // Create canvas for drawing line graphs this.CDFELineGraphCanvas = document.createElement('canvas'); @@ -476,92 +476,92 @@ FuelConsumptionCtrl.prototype._createStructure = function() this.CDFEGraphClipMask.appendChild(this.CDFEGraphArea); /**************************New CDFE Clip Mask Attach*******************************************/ - + // Attach the active graphing area to the CDEF graph clip mask this.CDFEGraphClipMaskRight.appendChild(this.CDFEGraphAreaRight); - + /**************************End of New CDFE Clip Mask Attach*******************************************/ - + // Attach the clip mask to the CDFE graph this.CDFEGraph.appendChild(this.CDFEGraphClipMask); - + /**************************New clip mask to the CDFE graph*******************************************/ - + // Attach the clip mask to the CDFE graph Right this.CDFEGraphRight.appendChild(this.CDFEGraphClipMaskRight); - + /**************************End of New clip mask to the CDFE graph*******************************************/ - + // Attach the CDFE graph to its parent this.graphsArea.appendChild(this.CDFEGraph); - + /**************************New CDFE graph to its parent*******************************************/ - + // Start stand alone graph for the hev disc graph if(this.properties.ctrlStyle === "hevstyle") { // CDFE Disc graph top-level DIV this.CDFEDiscGraph = document.createElement('div'); this.CDFEDiscGraph.className = 'FuelConsumptionCtrlCDFEDiscGraph'; - + // Clipping Disc mask for active CDFE graph area this.CDFEDiscGraphClipMask = document.createElement('div'); - this.CDFEDiscGraphClipMask.className = 'FuelConsumptionCtrlCDFEDiscGraphClipMask'; - + this.CDFEDiscGraphClipMask.className = 'FuelConsumptionCtrlCDFEDiscGraphClipMask'; + // Active graphing area for CDFE Disc graph this.CDFEDiscGraphArea = document.createElement('div'); - this.CDFEDiscGraphArea.className = 'FuelConsumptionCtrlCDFEDiscGraphArea'; - + this.CDFEDiscGraphArea.className = 'FuelConsumptionCtrlCDFEDiscGraphArea'; + // Create Disc CDFE graph bars for (var i = 1; i <= this._totalCDFEBars; i++) { var curCDFEDiscBar = document.createElement('div'); curCDFEDiscBar.id = 'CDFEDiscBar' + i; - + switch (i) { case this._newCDFEDataIdx: curCDFEDiscBar.className = 'FuelConsumptionCtrlHevCDFEBarGraphCoreCurrent'; this.CDFECurrentDiscBar = curCDFEDiscBar; - + break; case this._currentCDFEDataIdx: curCDFEDiscBar.className = 'FuelConsumptionCtrlHevCDFEBarGraphCoreCurrent'; - + break; default: curCDFEDiscBar.className = 'FuelConsumptionCtrlHevCDFEBarGraphCore'; break; } - - - + + + this.CDFEDiscGraphArea.appendChild(curCDFEDiscBar); } - + // Attach the active graphing area to the CDEF Disc graph clip mask this.CDFEDiscGraphClipMask.appendChild(this.CDFEDiscGraphArea); - + // Attach the clip mask to the CDFE Disc graph this.CDFEDiscGraph.appendChild(this.CDFEDiscGraphClipMask); - + // Attach the CDFE Disc graph to its parent this.graphsArea.appendChild(this.CDFEDiscGraph); - - + + /************* For the 10 Min bar graph data with Discs *************/ // CDFE Disc graph top-level DIV this.CDFEDiscGraphRight = document.createElement('div'); this.CDFEDiscGraphRight.className = 'FuelConsumptionCtrlCDFEDiscGraphRight'; - + // Clipping Disc mask for active CDFE graph area this.CDFEDiscGraphClipMaskRight = document.createElement('div'); - this.CDFEDiscGraphClipMaskRight.className = 'FuelConsumptionCtrlCDFEDiscGraphClipMaskRight'; - + this.CDFEDiscGraphClipMaskRight.className = 'FuelConsumptionCtrlCDFEDiscGraphClipMaskRight'; + // Active graphing area for CDFE Disc graph this.CDFEDiscGraphAreaRight = document.createElement('div'); - this.CDFEDiscGraphAreaRight.className = 'FuelConsumptionCtrlCDFEDiscGraphAreaRight'; - + this.CDFEDiscGraphAreaRight.className = 'FuelConsumptionCtrlCDFEDiscGraphAreaRight'; + // Create Disc CDFE graph bars for (var k = 1; k <= this._totalCDFEBarsRight; k++) { @@ -570,16 +570,16 @@ FuelConsumptionCtrl.prototype._createStructure = function() curCDFEDiscBarRight.className = 'FuelConsumptionCtrlHevCDFEDiscGraphCoreRight'; this.CDFEDiscGraphAreaRight.appendChild(curCDFEDiscBarRight); } - + // Attach the active graphing area to the CDEF Disc graph clip mask this.CDFEDiscGraphClipMaskRight.appendChild(this.CDFEDiscGraphAreaRight); - + // Attach the clip mask to the CDFE Disc graph this.CDFEDiscGraphRight.appendChild(this.CDFEDiscGraphClipMaskRight); - + // Attach the CDFE Disc graph to its parent this.graphsArea.appendChild(this.CDFEDiscGraphRight); - + } // Attach the CDFE graph to its parent Right this.graphsArea.appendChild(this.CDFEGraphRight); @@ -636,7 +636,7 @@ FuelConsumptionCtrl.prototype._createStructure = function() break; case this._currentCFERDataIdx: curCFERBar.className = 'FuelConsumptionCtrlCFERBarGraphCore'; - + //this.CFERCurrentBar = curCFERBar; break; default: @@ -647,32 +647,32 @@ FuelConsumptionCtrl.prototype._createStructure = function() curCFERBar.appendChild(CFERBarCap); this.CFERGraphArea.appendChild(curCFERBar); } - + this.CFERCurrenBarMask = document.createElement('div'); this.CFERCurrenBarMask.className = 'FuelConsumptionCtrlCFERBarGraphCurrentMask'; - + var CurrentCFERBarCap = document.createElement('div'); CurrentCFERBarCap.className = 'FuelConsumptionCtrlCFERBarGraphCap'; CurrentCFERBarCap.style.marginTop = '-3px'; - + this.CFERCurrentBar = document.createElement('div'); this.CFERCurrentBar.id = 'CFERBar10'; this.CFERCurrentBar.className = 'FuelConsumptionCtrlCFERBarGraphCoreCurrent'; - + this.CFERCurrentBar.appendChild(CurrentCFERBarCap); - + this.CFERCurrenBarMask.appendChild(this.CFERCurrentBar); - + // Create a div for the current Graph value and attach to the parent div this.CFERCurrentBarValue = document.createElement('div'); this.CFERCurrentBarValue.className = 'FuelConsumptionCtrlCFERCurrentBarValue'; - + // Create a div for text of bar value and attach to CFERCurrentBarValueCFERCurrentBarValue this.CFERCurrentBarValueText = document.createElement('div'); this.CFERCurrentBarValueText.className = 'FuelConsumptionCtrlCFERBarValueCurrent'; this.CFERCurrentBarValueText.id = 'CFERBarValueCurrent'; this.CFERCurrentBarValue.appendChild(this.CFERCurrentBarValueText); - + // Attach the active graphing area to the CFER graph clip mask this.CFERGraphClipMask.appendChild(this.CFERGraphArea); @@ -689,14 +689,14 @@ FuelConsumptionCtrl.prototype._createStructure = function() // Fuel efficiency top-level DIV this.fuelEfficiencyArea = document.createElement('div'); this.fuelEfficiencyArea.className = 'FuelConsumptionCtrlFuelEfficiencyArea'; - + // Fuel efficiency title this.fuelEfficiencyTitle = document.createElement('h2'); // Fuel efficiency value display this.fuelEfficiencyValue = document.createElement('div'); this.fuelEfficiencyUnit = document.createElement('div'); this.fuelEfficiencyThisDrive = document.createElement('div'); - + //TODO::Fuel Consumption HEV Style if(this.properties.ctrlStyle === "hevstyle"){ this.fuelEfficiencyTitle.className = 'FuelConsumptionCtrlFuelEfficiencyTitleHev'; @@ -707,7 +707,7 @@ FuelConsumptionCtrl.prototype._createStructure = function() this.fuelEfficiencyHevDivider = document.createElement("div"); this.fuelEfficiencyHevDivider.className = 'FuelConsumptionCtrlFuelEfficiencyHevDivider'; this.fuelEfficiencyArea.appendChild(this.fuelEfficiencyHevDivider); - + //Fuel Efficiency OneDrive Title this.fuelEfficiencyHevOneDriveTitle = document.createElement("div"); this.fuelEfficiencyHevOneDriveTitle.className = 'FuelConsumptionCtrlHevOneDriveText'; @@ -717,7 +717,7 @@ FuelConsumptionCtrl.prototype._createStructure = function() this.properties.oneDriveText, this.properties.subMap); this.fuelEfficiencyHevOneDriveTitle.innerHTML = this.properties.oneDriveText; - + //Fuel Efficiency EVDistance Title this.fuelEfficiencyHevEVDistanceTitle = document.createElement("div"); this.fuelEfficiencyHevEVDistanceTitle.className = 'FuelConsumptionCtrlHevEVDistanceText'; @@ -727,32 +727,32 @@ FuelConsumptionCtrl.prototype._createStructure = function() this.properties.evDistanceText, this.properties.subMap); this.fuelEfficiencyHevEVDistanceTitle.innerHTML = this.properties.evDistanceText; - + //Fuel Efficiency Distance Value this.fuelEfficiencyHevDistanceValue = document.createElement("div"); this.fuelEfficiencyHevDistanceValue.className = 'FuelConsumptionCtrlHevDistanceValue'; this.fuelEfficiencyArea.appendChild(this.fuelEfficiencyHevDistanceValue); - + //Fuel Efficiency Distance Unit this.fuelEfficiencyHevDistanceUnit = document.createElement("div"); this.fuelEfficiencyHevDistanceUnit.className = 'FuelConsumptionCtrlHevDistanceUnit'; this.fuelEfficiencyArea.appendChild(this.fuelEfficiencyHevDistanceUnit); - + //Fuel Efficiency Percent Value this.fuelEfficiencyHevPercentValue = document.createElement("div"); this.fuelEfficiencyHevPercentValue.className = 'FuelConsumptionCtrlHevPercentValue'; this.fuelEfficiencyArea.appendChild(this.fuelEfficiencyHevPercentValue); - + // 20 special case for HEV - + this.halfKmLabel1 = document.createElement('div'); this.halfKmLabel1.className = 'FuelConsumptionCtrlHalfWayLabel1'; this.halfKmLabel1.innerHTML = '20'; - + this.halfKmLabel2 = document.createElement('div'); this.halfKmLabel2.className = 'FuelConsumptionCtrlHalfWayLabel2'; this.halfKmLabel2.innerHTML = '20'; - + this.divElt.appendChild(this.halfKmLabel1); this.divElt.appendChild(this.halfKmLabel2); } @@ -766,13 +766,13 @@ FuelConsumptionCtrl.prototype._createStructure = function() this.fuelEfficiencyArea.appendChild(this.fuelEfficiencyTitle); this.fuelEfficiencyArea.appendChild(this.fuelEfficiencyThisDrive); this.fuelEfficiencyArea.appendChild(this.fuelEfficiencyValue); - + // create container for disc value indicator if(this.properties.ctrlStyle === 'hevstyle') { this.oneDiscValue = document.createElement('div'); this.oneDiscValue.className = 'FuelConsumptionCtrlOneDiscValue'; - + this.properties.whText = this._translateString(this.properties.whUnitId, this.properties.whText, @@ -780,13 +780,13 @@ FuelConsumptionCtrl.prototype._createStructure = function() this.oneDiscValue.innerHTML = '=30'+this.properties.whText; this.oneDiscImage = document.createElement('div'); this.oneDiscImage.className = 'FuelConsumptionCtrlOneDiscIndicator'; - + this.divElt.appendChild(this.oneDiscValue); this.divElt.appendChild(this.oneDiscImage); } - + this.fuelEfficiencyArea.appendChild(this.fuelEfficiencyUnit); - + // Add graphs area to control's top-level container this.divElt.appendChild(this.graphsArea); @@ -794,10 +794,10 @@ FuelConsumptionCtrl.prototype._createStructure = function() this.divElt.appendChild(this.fuelEfficiencyArea); this.divElt.appendChild(this.CFERCurrentBarValue); this.divElt.appendChild(this.CFERCurrenBarMask); - // Attach control to parent + // Attach control to parent this.parentDiv.appendChild(this.divElt); this.parentDiv.appendChild(this.umpPanelDiv); - + var umpConfig = { "buttonConfig" : this.properties['umpButtonConfig'], "defaultSelectCallback" : this.properties['defaultSelectCallback'], @@ -813,7 +813,7 @@ FuelConsumptionCtrl.prototype._createStructure = function() //@formatter:on log.debug("Instantiating umpCtrl..."); this.umpCtrl = framework.instantiateControl(this.uiaId, this.umpPanelDiv, "Ump3Ctrl", umpConfig); - + // "Switch View" button control //@formatter:off var btnInstanceProperties = @@ -838,7 +838,7 @@ FuelConsumptionCtrl.prototype._createStructure = function() btnInstanceProperties); } - + this._init(); } @@ -926,16 +926,16 @@ FuelConsumptionCtrl.prototype._addCDFEGraphAxisLabels = function(xDiv, yDiv) barLabel.style.width = this._CSSConstants["CDFEGraphBarWidthRight"] + 'px'; xDiv.appendChild(barLabel); - + this.yLimitValueLabelCDFE = document.createElement('span'); this.yLimitValueLabelCDFE.innerHTML = this.properties.currentFuelConfig.yAxisLimitValue; yDiv.appendChild(this.yLimitValueLabelCDFE); - + var yUnitLabel = document.createElement('span'); yUnitLabel.style.position = 'absolute'; yUnitLabel.style.width = '100px'; yUnitLabel.style.top = '90px'; - + var yZeroLabel = document.createElement('span'); this.properties.currentFuelConfig.yAxisLabelText = this._translateString(this.properties.currentFuelConfig.yAxisLabelId, @@ -944,7 +944,7 @@ FuelConsumptionCtrl.prototype._addCDFEGraphAxisLabels = function(xDiv, yDiv) yUnitLabel.innerHTML = this.properties.currentFuelConfig.yAxisLabelText; var xAxisLabelMinuteText = this._translateString(this.properties.xAxisLabelMinuteId, this.properties.xAxisLabelMinuteText, this.properties.subMap); - + yZeroLabel.innerHTML = '0'+xAxisLabelMinuteText; yZeroLabel.style.position = 'absolute'; yZeroLabel.style.width = '60px'; @@ -952,7 +952,7 @@ FuelConsumptionCtrl.prototype._addCDFEGraphAxisLabels = function(xDiv, yDiv) yZeroLabel.style.left = '466px'; this.yZeroLabelCDFE = yUnitLabel; yDiv.appendChild(yUnitLabel); - yDiv.appendChild(yZeroLabel); + yDiv.appendChild(yZeroLabel); } /* @@ -973,8 +973,8 @@ FuelConsumptionCtrl.prototype._setCDFEGraphBarPositions = function() { bar.style.left = currentLeft + 'px'; } - - + + // Adding new disc logic for hevstyle if(this.properties.ctrlStyle === 'hevstyle') { @@ -984,7 +984,7 @@ FuelConsumptionCtrl.prototype._setCDFEGraphBarPositions = function() disc.style.left = currentLeft + 'px'; } } - + currentLeft += leftInc; } } @@ -1005,7 +1005,7 @@ FuelConsumptionCtrl.prototype._setCDFEGraphBarPositionsRight = function() { barRight.style.left = currentLeftMarginRight + 'px'; } - + // Adding new disc logic for hevstyle if(this.properties.ctrlStyle === 'hevstyle') { @@ -1015,7 +1015,7 @@ FuelConsumptionCtrl.prototype._setCDFEGraphBarPositionsRight = function() disc.style.left = currentLeftMarginRight + 'px'; } } - + currentLeftMarginRight += leftIncRight; } } @@ -1109,7 +1109,7 @@ FuelConsumptionCtrl.prototype._setCDFEGraphBarHeightTransitionsRight = function( { bar.style.OTransition = transitionStr; } - + if(this.properties.ctrlStyle === 'hevstyle') { var disc = document.getElementById('CDFEDiscBarRight' + (i + 1)); @@ -1137,10 +1137,10 @@ FuelConsumptionCtrl.prototype._setCDFEGraphBarHeight = function(barIdx,HEVMode) this._CDFEGraphBarValues[barIdx], this.properties.currentFuelConfig.yAxisLimitValue, false) + 'px'; - - + + } - + if(this.properties.ctrlStyle === 'hevstyle') { var disc = document.getElementById('CDFEDiscBar' + (barIdx + 1)); @@ -1161,7 +1161,7 @@ FuelConsumptionCtrl.prototype._setCDFEGraphBarHeight = function(barIdx,HEVMode) disc.className = 'FuelConsumptionCtrlHevCDFEBarGraphCoreCurrent'; } disc.style.height = this._CDFEDiscValues[barIdx]+'px'; - + } } } @@ -1202,7 +1202,7 @@ FuelConsumptionCtrl.prototype._setCDFEGraphBarHeights = function() yLimit, false) + 'px'; } - + if(this.properties.ctrlStyle === 'hevstyle') { var disc = document.getElementById('CDFEDiscBar' + (i + 1)); @@ -1225,11 +1225,11 @@ FuelConsumptionCtrl.prototype._setCDFEGraphBarHeightsRight = function() // Cache reused values var graphHeight = this._CSSConstants["CDFEGraphVisibleHeightRight"]; var yLimit = this.properties.currentFuelConfig.yAxisLimitValue; - + for (var i = 0; i < this._totalCDFEBarsRight; i++) { var bar = document.getElementById('CDFEBarRight' + (i + 1)); - + if (bar) { bar.style.height = this._scaleDataToGraphY(graphHeight, @@ -1238,13 +1238,13 @@ FuelConsumptionCtrl.prototype._setCDFEGraphBarHeightsRight = function() false) + 'px'; } if(this.properties.ctrlStyle === 'hevstyle') - { + { var disc = document.getElementById('CDFEDiscBarRight' + (i + 1)); if (disc) { disc.style.height = this._CDFEDiscBarValuesRight[i]+ 'px'; } - } + } } } @@ -1362,12 +1362,12 @@ FuelConsumptionCtrl.prototype._resetCDFEGraph = function(animateBars) { this.CDFEDiscGraphArea.style.OTransition = 'none'; } - + // Enable/disable height transitions for the CDFE graph bars this._setCDFEGraphBarHeightTransitions(animateBars); if(this.properties.ctrlStyle === 'hevstyle') { - + for(var i = 0; i <= 10; i++) { var bar = document.getElementById('CDFEBar'+(i+1)); @@ -1382,7 +1382,7 @@ FuelConsumptionCtrl.prototype._resetCDFEGraph = function(animateBars) this.CDFECurrentBar.className = 'FuelConsumptionCtrlCDFEBarGraphCoreCurrentGreenHighLighted'; break; } - + } else { @@ -1414,7 +1414,7 @@ FuelConsumptionCtrl.prototype._resetCDFEGraph = function(animateBars) } this._setCDFEGraphBarHeights(); - + // Disable/enable height transitions for the CDFE graph bars this._setCDFEGraphBarHeightTransitions(!animateBars); } @@ -1425,7 +1425,7 @@ FuelConsumptionCtrl.prototype._resetCDFEGraphRight = function(animateBars) // Make sure left transitions are OFF for the CDFE graph active area while we redraw it this.CDFEGraphAreaRight.style.OTransition = 'none'; - + if(this.properties.ctrlStyle === 'hevstyle') { this.CDFEDiscGraphAreaRight.style.OTransition = 'none'; @@ -1433,7 +1433,7 @@ FuelConsumptionCtrl.prototype._resetCDFEGraphRight = function(animateBars) // Enable/disable height transitions for the CDFE graph bars this._setCDFEGraphBarHeightTransitionsRight(animateBars); - + if(this.properties.ctrlStyle === 'hevstyle') { for(var i = 0; i < 5; i++) @@ -1452,8 +1452,8 @@ FuelConsumptionCtrl.prototype._resetCDFEGraphRight = function(animateBars) } } } - - + + // Reposition the CDFE graph active area & reconstruct the bar/line graph // (should be no visible difference afterwards) this.CDFEGraphAreaRight.style.left = '0px'; @@ -1479,7 +1479,7 @@ FuelConsumptionCtrl.prototype._onCDFELineFadeAnimationEnd = function(e) // Stop propagating the event e.stopPropagation(); - + // Disable the line graph fade animation this._setCDFELineGraphFadeTransitions(false); } @@ -1548,7 +1548,7 @@ FuelConsumptionCtrl.prototype._addCFERGraphAxisLabels = function(xDiv, yDiv) span.style.left = currentLeft + 'px'; span.style.width = this._CSSConstants["CFERGraphBarWidth"] + 'px'; span.style.textAlign = 'center'; - + if (i === (this._currentCFERDataIdx - 1)) { this.properties.cumulativeFuelConfig.xAxisLabelText = @@ -1565,15 +1565,15 @@ FuelConsumptionCtrl.prototype._addCFERGraphAxisLabels = function(xDiv, yDiv) { span.innerHTML = (this._currentCFERDataIdx - i) + ''; } - + } - - + + currentLeft += leftInc; xDiv.appendChild(span); } - + this.yLimitValueLabelCFER = document.createElement('span'); this.yLimitValueLabelCFER.innerHTML = this.properties.cumulativeFuelConfig.yAxisLimitValue; yDiv.appendChild(this.yLimitValueLabelCFER); @@ -1630,7 +1630,7 @@ FuelConsumptionCtrl.prototype._setCFERGraphBarHeightTransitions = function(isEna // log.debug("FuelConsumptionCtrl: _setCFERGraphBarHeightTransitions() called: isEnabled = " + isEnabled); var transitionStr; - + // TODO: Figure out why this needs to be backwards to work! if (!isEnabled) { @@ -1661,32 +1661,32 @@ FuelConsumptionCtrl.prototype._setCFERGraphBarHeightTransitions = function(isEna FuelConsumptionCtrl.prototype._setCFERGraphBarHeight = function(barIdx) { // log.debug("FuelConsumptionCtrl: _setCFERGraphBarHeight() called: barIdx = " + barIdx); - + var bar = document.getElementById('CFERBar' + (barIdx + 1)); if (bar) { - + bar.style.height = this._scaleDataToGraphY(this._CSSConstants["CFERGraphVisibleHeight"], this._CFERGraphBarValues[barIdx], this.properties.cumulativeFuelConfig.yAxisLimitValue, false) + 'px'; - + } } FuelConsumptionCtrl.prototype._setCFERGraphBarHeightNew = function(barIdx) { // log.debug("FuelConsumptionCtrl: _setCFERGraphBarHeight() called: barIdx = " + barIdx); - + var bar = document.getElementById('CFERBar' + (barIdx + 1)); if (bar) { - + bar.style.height = this._scaleDataToGraphY(this._CSSConstants["CFERGraphVisibleHeight"], this._CFERGraphBarValues[barIdx + 1], this.properties.cumulativeFuelConfig.yAxisLimitValue, false) + 'px'; - + // Set the height of the current bar value to retain its display positioon on top of current bar this.CFERCurrentBarValue.style.height = this._scaleDataToGraphY(this._CSSConstants["CFERGraphVisibleHeight"], this._CFERGraphBarValues[barIdx + 1], @@ -1753,10 +1753,10 @@ FuelConsumptionCtrl.prototype._onCFERLeftAnimationEnd = function(e) // Remove the event listener that got us here this.CFERGraphArea.removeEventListener('oTransitionEnd', this._cbCFERLeftAnimationEnd, false); - + // Stop propagating the event e.stopPropagation(); - + // Reset the CFER graph without bar animations this._resetCFERGraph(false); } @@ -1781,7 +1781,7 @@ FuelConsumptionCtrl.prototype._scaleDataToGraphY = function(maxY, dataValue, max { yVal = maxY - yVal; } - + return yVal; } @@ -1836,7 +1836,7 @@ FuelConsumptionCtrl.prototype.initializeCurrentDriveFuelGraph = function(initial // Initialize the CDFE graph with bar animations this._resetCDFEGraph(true); - + } // to initialise the HEV fuel eco bar graph with the disc @@ -1909,13 +1909,13 @@ FuelConsumptionCtrl.prototype.initializeCurrentDriveFuelGraphRight = function(in { this._CDFEGraphBarValuesRight[this._youngestCDFEDataIdxRight - ibvIdx] = 0; } - + } // Initialize the "hidden" slot for new data this._CDFEGraphBarValuesRight[this._newCDFEDataIdxRight] = 0; } - + // Initialize the CDFE graph with bar animations this._resetCDFEGraphRight(true); @@ -1931,14 +1931,16 @@ FuelConsumptionCtrl.prototype.initializeHEVCurrentDriveFuelGraphRight = function // data to zero. for (var ibvIdx = 0; ibvIdx <= this._youngestCDFEDataIdxRight; ibvIdx++) { - if (initialBarValues[ibvIdx]) + //if (initialBarValues[ibvIdx]) + if (typeof(initialBarValues[ibvIdx]) === 'number') { this._CDFEGraphBarValuesRight[this._youngestCDFEDataIdxRight - ibvIdx] = initialBarValues[ibvIdx]; - if(initialHalfDiscs[ibvIdx]) + //if(initialHalfDiscs[ibvIdx]) + if(initialHalfDiscs[ibvIdx]=== true) { this._CDFEDiscBarValuesRight[this._youngestCDFEDataIdxRight - ibvIdx] = initialLDiscValues[ibvIdx] * 13 + 7; } - else + else if(initialHalfDiscs[ibvIdx]=== false) { this._CDFEDiscBarValuesRight[this._youngestCDFEDataIdxRight - ibvIdx] = initialLDiscValues[ibvIdx] * 13; } @@ -1949,14 +1951,14 @@ FuelConsumptionCtrl.prototype.initializeHEVCurrentDriveFuelGraphRight = function this._CDFEGraphBarValuesRight[this._youngestCDFEDataIdxRight - ibvIdx] = 0; this._CDFEDiscBarValuesRight[this._youngestCDFEDataIdxRight - ibvIdx] = 0; } - + } // Initialize the "hidden" slot for new data this._CDFEGraphBarValuesRight[this._newCDFEDataIdxRight] = 0; this._CDFEDiscBarValuesRight[this._newCDFEDataIdxRight] = 0; } - + // Initialize the CDFE graph with bar animations this._resetCDFEGraphRight(true); } @@ -1981,20 +1983,20 @@ FuelConsumptionCtrl.prototype.insertCurrentDriveFuelGraph = function(currentBarV // Update the new value's bar in the CDFE graph this._setCDFEGraphBarHeight(this._newCDFEDataIdx); - + this.CDFECurrentBar.className = 'FuelConsumptionCtrlCDFEBarGraphCore'; - + // Turn on left transitions for the CDFE graph (for the next animation) this.CDFEGraphArea.style.OTransition = 'left 0.6s ease 0s'; - + // Attach an event listener to the CDFE graph area so we can detect when // the slide animation ends (and reset the graph for the next animation) this.CDFEGraphArea.addEventListener('oTransitionEnd', this._cbCDFELeftAnimationEnd, false); // Set the graph's position, triggering the animation // ("normal" left - (width of one bar + bar spacing)) - this.CDFEGraphArea.style.left = '-' + (this._CSSConstants["CDFEGraphBarWidth"] + + this.CDFEGraphArea.style.left = '-' + (this._CSSConstants["CDFEGraphBarWidth"] + this._CSSConstants["CDFEGraphBarSpacing"]) + 'px'; this._CDFELineGraphInTransition = true; @@ -2015,15 +2017,16 @@ FuelConsumptionCtrl.prototype.insertHEVFuelGraph = function(currentBarValue, cur if (typeof(currentBarValue) === 'number') { this._CDFEGraphBarValues[this._newCDFEDataIdx] = currentBarValue; - if(currentHalfDisc) + //if(currentHalfDisc) + if(currentHalfDisc===true) { this._CDFEDiscValues[this._newCDFEDataIdx] = currentDiscs * 13 + 7; } - else + else if(currentHalfDisc===false) { this._CDFEDiscValues[this._newCDFEDataIdx] = currentDiscs * 13; } - this._initialEVMode[this._newCDFEDataIdx] = currentHEVMode; + this._initialEVMode[this._newCDFEDataIdx] = currentHEVMode; } else { @@ -2044,30 +2047,30 @@ FuelConsumptionCtrl.prototype.insertHEVFuelGraph = function(currentBarValue, cur } // Update the new value's bar in the CDFE graph this._setCDFEGraphBarHeight(this._newCDFEDataIdx,currentHEVMode); - + // Turn on left transitions for the CDFE graph (for the next animation) this.CDFEGraphArea.style.OTransition = 'left 0.6s ease 0s'; this.CDFEDiscGraphArea.style.OTransition = 'left 0.6s ease 0s'; - + // Attach an event listener to the CDFE graph area so we can detect when // the slide animation ends (and reset the graph for the next animation) this.CDFEGraphArea.addEventListener('oTransitionEnd', this._cbCDFELeftAnimationEnd, false); // Set the graph's position, triggering the animation // ("normal" left - (width of one bar + bar spacing)) - this.CDFEGraphArea.style.left = '-' + (this._CSSConstants["CDFEGraphBarWidth"] + + this.CDFEGraphArea.style.left = '-' + (this._CSSConstants["CDFEGraphBarWidth"] + this._CSSConstants["CDFEGraphBarSpacing"]) + 'px'; - - this.CDFEDiscGraphArea.style.left = '-' + (this._CSSConstants["CDFEGraphBarWidth"] + + + this.CDFEDiscGraphArea.style.left = '-' + (this._CSSConstants["CDFEGraphBarWidth"] + this._CSSConstants["CDFEGraphBarSpacing"]) + 'px'; - + this._CDFELineGraphInTransition = true; // Update the data sets to discard the oldest historical data for (var i = 0; i <= this._youngestCDFEDataIdx; i++) { this._CDFEGraphBarValues[i] = this._CDFEGraphBarValues[i + 1]; this._CDFEDiscValues[i] = this._CDFEDiscValues[i + 1]; - this._initialEVMode[i] = this._initialEVMode[i+1]; + this._initialEVMode[i] = this._initialEVMode[i+1]; } //if(currentHEVMode) @@ -2114,7 +2117,7 @@ FuelConsumptionCtrl.prototype.insertCurrentDriveFuelGraphRight = function(curren // Set the graph's position, triggering the animation // ("normal" left - (width of one bar + bar spacing)) - this.CDFEGraphAreaRight.style.left = '-' + (this._CSSConstants["CDFEGraphBarWidthRight"] + + this.CDFEGraphAreaRight.style.left = '-' + (this._CSSConstants["CDFEGraphBarWidthRight"] + this._CSSConstants["CDFEGraphBarSpacingRight"]) + 'px'; // Update the data sets to discard the oldest historical data @@ -2172,7 +2175,7 @@ FuelConsumptionCtrl.prototype.insertCurrentCumulativeFuelGraph = function(newRes { this._CFERGraphBarValues[this._newCFERDataIdx] = 0.0; } - + // Update the new value's bar in the CFER graph this._setCFERGraphBarHeight(this._newCFERDataIdx); @@ -2202,10 +2205,10 @@ FuelConsumptionCtrl.prototype.updateCurrentCumulativeFuelGraph = function(curren { log.debug("FuelConsumptionCtrl: updateCurrentCumulativeFuelGraph() called: currentBarValue = " + currentBarValue); - + // Save the current bar value var tempNumber = currentBarValue; - + if(currentBarValue == null) { currentBarValue = 0; @@ -2215,16 +2218,16 @@ FuelConsumptionCtrl.prototype.updateCurrentCumulativeFuelGraph = function(curren { tempNumber = '0.0'; } - + currentBarValue = parseFloat(currentBarValue); this._cumulativeBarValue = tempNumber; - - // Check if current bar value exceeds the unit range + + // Check if current bar value exceeds the unit range if(currentBarValue > unitRange) { currentBarValue = unitRange; } - + if (typeof(currentBarValue) === 'number') { this._CFERGraphBarValues[10] = currentBarValue; @@ -2234,12 +2237,12 @@ FuelConsumptionCtrl.prototype.updateCurrentCumulativeFuelGraph = function(curren this._CFERGraphBarValues[10] = 0.0; tempNumber = '0.0'; } - - + + var currentValueDiv = document.getElementById("CFERBarValueCurrent"); currentValueDiv.className = 'FuelConsumptionCtrlCFERBarValueCurrent'; - + currentValueDiv.innerHTML = this._stringToHTML(tempNumber); // Update the current bar var bar = document.getElementById('CFERBar' + 10); @@ -2281,24 +2284,24 @@ FuelConsumptionCtrl.prototype.setFuelEfficiency = function(fuelEfficiencyData) if (fuelEfficiencyUnitText == "L/100km") { // Prevent Divide-By-Zero Error - if (parseFloat(this.properties.fuelEfficiencyData.fuelEfficiency) > 0) + if (parseFloat(this.properties.fuelEfficiencyData.fuelEfficiency) > 0) { - this.fuelEfficiencyValue.innerHTML = this.properties.fuelEfficiencyData.fuelEfficiency + + this.fuelEfficiencyValue.innerHTML = this.properties.fuelEfficiencyData.fuelEfficiency + "
    " + "
    " + "
    " + ((100/parseFloat(this.properties.fuelEfficiencyData.fuelEfficiency)).toFixed(1)).toString(); } else - { + { this.fuelEfficiencyValue.innerHTML = this.properties.fuelEfficiencyData.fuelEfficiency + "
    " + "
    " + "
    " + "0.0"; } } // calculate km/L if the fuel efficiency unit is "mpg" else - { - this.fuelEfficiencyValue.innerHTML = this.properties.fuelEfficiencyData.fuelEfficiency + + { + this.fuelEfficiencyValue.innerHTML = this.properties.fuelEfficiencyData.fuelEfficiency + "
    " + "
    " + "
    " + ((parseFloat(this.properties.fuelEfficiencyData.fuelEfficiency)*0.4251).toFixed(1)).toString(); } this.fuelEfficiencyUnit.innerHTML = fuelEfficiencyUnitText + "
    " + "
    " + "
    " + "km/L"; - // **** End of the fuel efficiency "km/L" + // **** End of the fuel efficiency "km/L" } else { @@ -2311,23 +2314,23 @@ FuelConsumptionCtrl.prototype.setFuelEfficiency = function(fuelEfficiencyData) FuelConsumptionCtrl.prototype.setEvDrvDistance = function(evObj) { - + var driveDisUnit = this._translateString(evObj.unitId, evObj.unitId, this.properties.subMap); this.fuelEfficiencyHevDistanceUnit.innerHTML = this._stringToHTML(driveDisUnit); - + if(evObj.driveDistance !== null) - { + { this.fuelEfficiencyHevDistanceValue.innerHTML = evObj.driveDistance; } else { this.fuelEfficiencyHevDistanceValue.innerHTML = "--.-" ; } - + if(evObj.percentValue !== null) { this.fuelEfficiencyHevPercentValue.innerHTML = "("+evObj.percentValue+"%)"; - } + } else { this.fuelEfficiencyHevPercentValue.innerHTML = "(--)" ; @@ -2340,7 +2343,7 @@ FuelConsumptionCtrl.prototype.setUnitInformation = function(obj) this.properties.currentFuelConfig.yAxisLimitValue = obj.yAxisLimitValue; this.properties.cumulativeFuelConfig.yAxisLabelId = obj.yAxisLabelId; this.properties.currentFuelConfig.yAxisLabelId = obj.yAxisLabelId; - + this.properties.cumulativeFuelConfig.yAxisLabelText = this._translateString(this.properties.cumulativeFuelConfig.yAxisLabelId, this.properties.cumulativeFuelConfig.yAxisLabelText, @@ -2350,7 +2353,7 @@ FuelConsumptionCtrl.prototype.setUnitInformation = function(obj) this._translateString(this.properties.currentFuelConfig.yAxisLabelId, this.properties.currentFuelConfig.yAxisLabelText, this.properties.subMap); - + this.yZeroLabelCDFE.innerHTML = this.properties.currentFuelConfig.yAxisLabelText; this.yLimitValueLabelCDFE.innerHTML = this.properties.currentFuelConfig.yAxisLimitValue; this.yZeroLabelCFER.innerHTML = '
    ' + this.properties.cumulativeFuelConfig.yAxisLabelText; @@ -2421,7 +2424,7 @@ FuelConsumptionCtrl.prototype.restoreContext = function(controlContextCapture) FuelConsumptionCtrl.prototype.handleControllerEvent = function(eventId) { log.debug("FuelConsumptionCtrl: handleControllerEvent() called: " + eventId); - + // Pass-through if(this._umpPanelStatus && this.umpCtrl) { @@ -2448,4 +2451,4 @@ FuelConsumptionCtrl.prototype.cleanUp = function() } } -framework.registerCtrlLoaded("FuelConsumptionCtrl"); \ No newline at end of file +framework.registerCtrlLoaded("FuelConsumptionCtrl"); diff --git a/app/files/tweaks/config/USBAudioMod/usbaudioApp.js b/app/files/tweaks/config/USBAudioMod/usbaudioApp.js index 1591a56..3f086e5 100644 --- a/app/files/tweaks/config/USBAudioMod/usbaudioApp.js +++ b/app/files/tweaks/config/USBAudioMod/usbaudioApp.js @@ -2409,7 +2409,7 @@ usbaudioApp.prototype._DeviceNormalizedMsgHandler = function (msg) //this._currentContextTemplate.nowPlaying4Ctrl.umpCtrl.setButtonDisabled("GenerateMoreLikeThis", !this._connectedDevs.selectedDevCataloged); if (this._connectedDevs.showGracenote == true) { - this._currentContextTemplate.nowPlaying4Ctrl.setDetailLine3({detailText: AIO_gracenoteText}); + this._currentContextTemplate.nowPlaying4Ctrl.setDetailLine3({detailText: this.AIO_gracenoteText}); this._gracenoteTimeout = setTimeout(this._removeGracenote.bind(this), this._gracenoteTimeoutTime); } } @@ -2443,7 +2443,7 @@ usbaudioApp.prototype._BODReadyMsgHandler = function (msg) if (this._connectedDevs.showGracenote == true && this._cachedSongDetails.title) { - this._currentContextTemplate.nowPlaying4Ctrl.setDetailLine3({detailText: AIO_gracenoteText}); + this._currentContextTemplate.nowPlaying4Ctrl.setDetailLine3({detailText: this.AIO_gracenoteText}); this._gracenoteTimeout = setTimeout(this._removeGracenote.bind(this), this._gracenoteTimeoutTime); } } @@ -2821,7 +2821,7 @@ usbaudioApp.prototype._ObjectInfoMsgHandler = function (msg) //this._currentContextTemplate.nowPlaying4Ctrl.umpCtrl.setButtonDisabled("GenerateMoreLikeThis", !this._connectedDevs.selectedDevCataloged); if (this._connectedDevs.showGracenote == true) { - this._currentContextTemplate.nowPlaying4Ctrl.setDetailLine3({detailText: AIO_gracenoteText}); + this._currentContextTemplate.nowPlaying4Ctrl.setDetailLine3({detailText: this.AIO_gracenoteText}); this._gracenoteTimeout = setTimeout(this._removeGracenote.bind(this), this._gracenoteTimeoutTime); } else // ---MZDMOD--- setDetailLine3 to genre about 10 seconds @@ -4276,7 +4276,7 @@ usbaudioApp.prototype._populateNowPlayingCtrl = function (tmplt, songDetails) } if (this._connectedDevs.showGracenote == true && songDetails.title && songDetails.artist && songDetails.album && this._connectedDevs.selectedDevCataloged) { - tmplt.nowPlaying4Ctrl.setDetailLine3({detailText: AIO_gracenoteText}); + tmplt.nowPlaying4Ctrl.setDetailLine3({detailText: this.AIO_gracenoteText}); this._gracenoteTimeout = setTimeout(this._removeGracenote.bind(this), this._gracenoteTimeoutTime); } } diff --git a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/restore.sh b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/restore.sh index 5fc7e8f..39ea6e1 100644 --- a/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/restore.sh +++ b/app/files/tweaks/config/aio-app/data_persist/dev/system_restore/restore.sh @@ -83,25 +83,25 @@ log_message() show_message() { sleep 5 - killall jci-dialog + killall -q jci-dialog # log_message "= POPUP: $* " /jci/tools/jci-dialog --info --title="AIO TWEAKS v.${AIO_VER}" --text="$*" --no-cancel & } show_message_OK() { sleep 4 - killall jci-dialog + killall -q jci-dialog # log_message "= POPUP: $* " /jci/tools/jci-dialog --confirm --title="AIO TWEAKS SYSTEM RESTORE" --text="$*" --ok-label="YES - GO ON" --cancel-label="NO - ABORT" if [ $? != 1 ] then - killall jci-dialog + killall -q jci-dialog return else log_message "********************* INSTALLATION ABORTED *********************" show_message "SYSTEM RESTORE ABORTED!" sleep 10 - killall jci-dialog + killall -q jci-dialog mount -o ro,remount / exit 0 fi @@ -664,31 +664,24 @@ then log_message "=== input_filter removed from sm.conf. ===" fi + +rm -fr /tmp/mnt/data_persist/dev/androidauto +rm -fr /tmp/mnt/data_persist/dev/headunit* +rm -fr /tmp/mnt/data_persist/dev/system_restore +rm -fr /tmp/mnt/data_persist/dev/bin/headunit* rm -fr /jci/gui/addon-player rm -fr /jci/gui/addon-speedometer rm -fr /jci/gui/speedometer rm -fr /jci/gui/apps/_speedometer -rm -fr /jci/gui/apps/_mzdmeter rm -fr /jci/gui/apps/_videoplayer rm -fr /jci/gui/apps/_aiotweaks rm -fr /jci/gui/apps/_androidauto -rm -fr /jci/gui/apps/_* -rm -f /jci/opera/opera_dir/userjs/aio*js -rm -f /jci/opera/opera_dir/userjs/addon-startup.js +rm -fr /jci/gui/apps/_mzdmeter rm -f /jci/opera/opera_dir/userjs/mySpeedometer* rm -f /jci/opera/opera_dir/userjs/speedometer* rm -f /jci/opera/opera_dir/userjs/*-startup.* rm -f /jci/opera/opera_dir/userjs/additionalApps.* -rm -f /tmp/mnt/data/enable_input_filter -rm -f /tmp/mnt/data/input_filter -rm -f /tmp/mnt/data_persist/dev/bin/websocketd -rm -f /tmp/mnt/data_persist/dev/bin/headunit -rm -f /tmp/mnt/data_persist/dev/bin/aaserver -rm -f /tmp/mnt/data_persist/dev/bin/headunit-wrapper -rm -f /tmp/mnt/data_persist/dev/bin/input_filter -rm -fr /tmp/mnt/data_persist/dev/androidauto -rm -fr /tmp/mnt/data_persist/dev/headunit_libs -rm -fr /tmp/mnt/data_persist/dev/bin/headunit_libs +rm -f /jci/opera/opera_dir/userjs/aio* rm -f /jci/scripts/get-gps-data* rm -f /jci/scripts/get-log-data* rm -f /jci/scripts/get-vehicle-data-other* @@ -705,6 +698,11 @@ rm -f /jci/scripts/stage_wifi.sh.org rm -f /jci/scripts/stage_wifi.sh.org2 rm -f /jci/scripts/stage_wifi.sh.org3 rm -f /jci/scripts/stage_wifi.sh.AA +rm -f /tmp/mnt/data_persist/dev/bin/websocketd +rm -f /tmp/mnt/data_persist/dev/bin/aaserver +rm -f /tmp/mnt/data_persist/dev/bin/input_filter +rm -f /tmp/mnt/data/enable_input_filter +rm -f /tmp/mnt/data/input_filter rm -f /usr/lib/gstreamer-0.10/libgsth264parse.so echo "#!/bin/sh" > /jci/scripts/stage_wifi.sh @@ -790,23 +788,6 @@ then log_message "- CASDK Data script folder '/jci/casdk' not found" fi - # remove initialization file - if grep -q "# CASDK" /jci/scripts/stage_wifi.sh - then - log_message "- Removing staging scripts" - # echo '#!/bin/sh' > /jci/scripts/stage_wifi.sh - sed -i '/# CASDK/d' /jci/scripts/stage_wifi.sh - sed -i '/casdk/d' /jci/scripts/stage_wifi.sh - sed -i '/################/d' /jci/scripts/stage_wifi.sh - sed -i '/# one time/d' /jci/scripts/stage_wifi.sh - sed -i '/# 1s update/d' /jci/scripts/stage_wifi.sh - sed -i '/# 60s update/d' /jci/scripts/stage_wifi.sh - sed -i '/# 300s update/d' /jci/scripts/stage_wifi.sh - sed -i '/mzd-casdk.start/d' /jci/scripts/stage_wifi.sh - else - log_message "- No staging scripts fouund in /jci/scripts/stage_wifi.sh" - fi - # remove proxy if [ -f /jci/opera/opera_dir/userjs/CustomApplicationsProxy.js ] then @@ -849,8 +830,8 @@ then fi # a window will appear before the system reboots automatically sleep 3 -killall jci-dialog +killall -q jci-dialog /jci/tools/jci-dialog --info --title="SYSTEM FULLY RESTORED" --text="THE SYSTEM WILL REBOOT IN A FEW SECONDS!" --no-cancel & sleep 10 -killall jci-dialog +killall -q jci-dialog reboot diff --git a/app/files/tweaks/config/aio-app/jci/gui/apps/_aiotweaks/css/_aiotweaksApp.css b/app/files/tweaks/config/aio-app/jci/gui/apps/_aiotweaks/css/_aiotweaksApp.css index 3fd917a..1568967 100644 --- a/app/files/tweaks/config/aio-app/jci/gui/apps/_aiotweaks/css/_aiotweaksApp.css +++ b/app/files/tweaks/config/aio-app/jci/gui/apps/_aiotweaks/css/_aiotweaksApp.css @@ -8,12 +8,10 @@ body.ellipse .MainMenuCtrlEllipse { background-image: none !important; } /* Remove Button Backgrounds */ - body.no-btn-bg .Ump3CtrlBgArch, body.no-btn-bg .Ump3CtrlBackground, body.no-btn-bg .Ump3CtrlSeparator { background: none !important; } /* CSS For Bigger Album Art */ - body.bgrAlbmArt .NowPlaying4CtrlTitle, body.bgrAlbmArt .NowPlaying4CtrlTitleFull { top: 0px; left: 14px; @@ -181,7 +179,6 @@ body.star2 .MainMenuCtrlComDiv.MainMenuCtrlCoinFocus { transform: scale(1.2, 1.2) translate(0px, -10px); } /* Alternate Layout Large Star */ - body.star3 .MainMenuCtrlComDiv { top: 30px; } @@ -245,7 +242,6 @@ body.star3 .MainMenuCtrlNavDiv.MainMenuCtrlCoinFocus { transform: scale(1.2, 1.2) translate(25px, -50px); } /* Alternate Layout Flatline */ - body.star4 .MainMenuCtrlComDiv { top: 280px; } @@ -317,13 +313,11 @@ body.star4 .MainMenuCtrlComDiv.MainMenuCtrlCoinFocus { transform: scale(1.2, 1.2) translate(0px, -60px); } /* Small Main Menu Coins */ - body.minicoins .MainMenuCtrlAppDiv, body.minicoins .MainMenuCtrlNavDiv, body.minicoins .MainMenuCtrlComDiv, body.minicoins .MainMenuCtrlSetDiv, body.minicoins .MainMenuCtrlEntDiv { -o-transform: scale(.5, .5); transform: scale(.5, .5); } /* 3D MAIN MENU TEXT! */ - body.label3d .MainMenuCtrlIconName.Visible { text-shadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0, 0, 0, .1), 0 0 5px rgba(0, 0, 0, .1), 0 1px 3px rgba(0, 0, 0, .3), 0 3px 5px rgba(0, 0, 0, .2), 0 5px 10px rgba(0, 0, 0, .25), 0 10px 10px rgba(0, 0, 0, .2), 0 20px 20px rgba(0, 0, 0, .15) !important; } diff --git a/app/files/tweaks/config/aio-app/jci/gui/apps/_aiotweaks/js/AIO-startup.js b/app/files/tweaks/config/aio-app/jci/gui/apps/_aiotweaks/js/AIO-startup.js index ae48a98..3106c7e 100644 --- a/app/files/tweaks/config/aio-app/jci/gui/apps/_aiotweaks/js/AIO-startup.js +++ b/app/files/tweaks/config/aio-app/jci/gui/apps/_aiotweaks/js/AIO-startup.js @@ -1,5 +1,6 @@ var turnScreenOff = false; var turnWifiOn = false; // this is experimental and may not work yet +var AIOlonghold = false; function applyTweaks() { var head = document.querySelector("head"); diff --git a/app/files/tweaks/config/aio-app/jci/gui/apps/_aiotweaks/js/_aiotweaksApp.js b/app/files/tweaks/config/aio-app/jci/gui/apps/_aiotweaks/js/_aiotweaksApp.js index f5885ea..69baf1a 100644 --- a/app/files/tweaks/config/aio-app/jci/gui/apps/_aiotweaks/js/_aiotweaksApp.js +++ b/app/files/tweaks/config/aio-app/jci/gui/apps/_aiotweaks/js/_aiotweaksApp.js @@ -38,9 +38,26 @@ _aiotweaksApp.prototype.appInit = function() { "template": "AIOTweaksTmplt", "templatePath": "apps/_aiotweaks/templates/AIOTweaks", //only needed for app-specific templates "readyFunction": this._StartContextReady.bind(this), - "contextOutFunction": this._StartContextOut.bind(this) - } // end of "AIOTweaks" - }; // end of this.contextTable object + "contextOutFunction": this._StartContextOut.bind(this), + "properties": { + "keybrdInputSurface": "JCI_OPERA_PRIMARY", + "visibleSurfaces": ["JCI_OPERA_PRIMARY", "NATGUI_SURFACE"] + } + }, + "RevCam": { + "hideHomeBtn": true, + "template" : "NoCtrlTmplt", + // set custom properties for this template + "properties" : { + "statusBarVisible" : false, + "customBgImage" : "common/images/FullTransparent.png", + "keybrdInputSurface": "JCI_OPERA_PRIMARY", + "visibleSurfaces": ["NATGUI_SURFACE"] // Do not include JCI_OPERA_PRIMARY in this list + }, + "readyFunction": null, + "displayedFunction": null + } // end of "BackupCameraDisplay" + }; //@formatter:on //@formatter:off diff --git a/app/files/tweaks/config/aio-app/jci/gui/apps/_aiotweaks/js/mzd.js b/app/files/tweaks/config/aio-app/jci/gui/apps/_aiotweaks/js/mzd.js index 6d7806f..7cabc6c 100644 --- a/app/files/tweaks/config/aio-app/jci/gui/apps/_aiotweaks/js/mzd.js +++ b/app/files/tweaks/config/aio-app/jci/gui/apps/_aiotweaks/js/mzd.js @@ -4,7 +4,7 @@ // ** By Trezdog44 // ***************************** /* jshint -W117 */ -var aioTweaksVer = 0.7; +var aioTweaksVer = 0.8; var AArunning = false; var appListData = []; @@ -35,6 +35,7 @@ function StartAIOApp() { $("#touchscreenOffBtn").on("click", disableTouchscreen); $("#touchscreenCompassBtn").on("click", enableCompass); $("#adbBtn").on("click", adbDevices); + $("#adbRevBtn").on("click", adbReverse); $("#messageTestBtn").on("click", messageTest); //$("#screenshotBtn").on("click",takeScreenshot); //$("#saveScreenshotBtn").on("click",saveScreenshot); @@ -63,8 +64,8 @@ function StartAIOApp() { $("#displayOffBtn").on("click", displayOff); $("#mountSwapBtn").on("click", mountSwap); $("#unmountSwapBtn").on("click", unmountSwap); - $("#createSwapBtn").on("click", showVehicleType); - $("#backupCamBtn").on("click", showBodyClassName); + $("#showVehData").on("click", showVehicleData); + $("#backupCamBtn").on("click", backUpCam); $("#errLogBtn").on("click", showErrLog); $("#runTerminalBtn").on("click", TerminalConfirm); $("#runCheckIPBtn").on("click", RunCheckIP); @@ -72,6 +73,7 @@ function StartAIOApp() { $("#shiftEntListBtn").on("click", shiftEntertainmentList); $("#devModeSecretBtn").on("click", toggleDevMode); $("#wifiToggle").on("click", turnOnWifi); + $("#verBtn").on("click", showVersion); $("#showBgBtn").on("click", function() { $("html").addClass("showBg") }); $("#twkOut").on("click", function() { framework.sendEventToMmui("common", "Global.IntentHome") }); $("#usba").on("click", function() { framework.sendEventToMmui("system", "SelectUSBA") }); @@ -101,7 +103,7 @@ function StartAIOApp() { $(".toggleTweaks").on("click", saveTweaks); $(".tablinks").on("click", function() { $("#MainMenuMsg").html(""); - localStorage.setItem("aio.prevtab", JSON.stringify($(this).attr("id"))); + localStorage.setItem("aio.prevtab",$(this).attr("tabindex")); }); $("#openNav").on("click", function() { document.getElementById("mySidenav").style.width = "250px"; @@ -142,6 +144,12 @@ function getAppListData() { hasCS(); hasSwap(); hasErrLog(); + if (typeof CustomApplicationsHandler === "object") { + var custApps = CustomApplicationsHandler.getMenuItems(); + custApps.forEach(function(elmt) { + appListData.push({ "name": elmt.text1Id, "label": elmt.title }); + }) + } }); } catch (e) { showAioInfo('Error: Cannot retrieve AIO app list...
    ' + e); @@ -183,6 +191,7 @@ function turnOnWifi() { net = framework.getAppInstance('netmgmt'); if (!net._onOffStatus) { framework.sendEventToMmui('netmgmt', 'SetWifiConnection', { payload: { offOn: wifiOn } }); + showAioInfo("WIFI ON??"); } }, 1000); //give it a second to load } @@ -214,8 +223,9 @@ function toggleDevMode() { } function showEnvVar() { - showAioInfo("$ env"); - aioWs('env', 3); + // showAioInfo("$ env"); + // aioWs('env', 3); + exeCmd('env'); } function takeScreenshot() { @@ -235,7 +245,7 @@ function saveScreenshot() { $('#AioInfoPanel').show(); var msg = '/jci/tools/jci-dialog --info --title="SCREENSHOT SAVED TO SD CARD" --text="NOT REALLY\\n I WILL DO THAT LATER" & '; msg += 'sleep 2; '; - msg += 'killall jci-dialog; '; + msg += 'killall -q jci-dialog; '; msg += "/bin/sh /jci/gui/apps/_aiotweaks/sh/screenshot.sh TrezShot "; msg += "\n"; $('#AioInformation').css({ 'background': 'url(/tmp/root/wayland-screenshot.png?' + Date.now() + ')', 'background-size': '100% 100%', 'background-position': 'center' }); @@ -245,11 +255,13 @@ function saveScreenshot() { function showAioInfo(message, append) { $('#aaTitle, #csTitle').css({ 'outline': 'none' }); $('#AioInfoPanel').addClass('opened'); - message += '
    '; - if (!append) { - $('#AioInformation').html(message); - } else { - $('#AioInformation').append(message); + if (message !== "") { + message += '
    ' + if (!append) { + $('#AioInformation').html(message); + } else { + $('#AioInformation').append(message); + } } if ($('#AioInformation').height() === 360) { $('#AioInfoPanel').addClass('scrollers'); @@ -279,8 +291,13 @@ function closeTSPanel() { } function adbDevices() { - showAioInfo("$ adb devices -l"); - aioWs('adb devices -l', 1); + // showAioInfo("$ adb devices -l"); + // aioWs('adb devices -l', 1); + exeCmd('adb devices -l'); +} + +function adbReverse() { + exeCmd('adb reverse tcp:2222 tcp:22'); } function TerminalConfirm() { @@ -296,7 +313,7 @@ function RunCheckIP() { } function myTest() { - var msgChoice = Math.round(Math.random() * 10/3); + var msgChoice = Math.round(Math.random() * 10 / 3); switch (msgChoice) { case 1: framework.common.startTimedSbn(this.uiaId, "SbnAIOTest", "typeE", { sbnStyle: "Style02", imagePath1: 'apps/_aiotweaks/panda.png', text1: this.uiaId, text2: "Pandamonium!!" }); @@ -326,18 +343,25 @@ function fullSystemRestoreConfirm() { function fullSystemRestore() { aioWs('/bin/sh /tmp/mnt/data_persist/dev/system_restore/restore.sh', 2); // Run Full Restore Script } -/*function backUpCam(){ - utility.setRequiredSurfaces("NATGUI_SURFACE", true); + +function backUpCam() { + utility.setRequiredSurfaces(["NATGUI_SURFACE"], true); + $("body").css({ "display": "none" }); aioWs('/bin/sh /jci/backupcam/start_cam.sh', 2); -}*/ + // aioMagicRoute("_aiotweaks", "RevCam"); + aioMagicRoute("backupparking", "BackupCameraDisplay"); +} + function toggleWifiAP() { - showAioInfo("$ start_wifi.sh && jci-wifiap.sh start"); - aioWs('/bin/sh /jci/scripts/start_wifi.sh; /bin/sh /jci/scripts/jci-wifiap.sh start && echo DONE ', 5); + // showAioInfo("$ start_wifi.sh && jci-wifiap.sh start"); + // aioWs('/bin/sh /jci/scripts/start_wifi.sh; /bin/sh /jci/scripts/jci-wifiap.sh start && echo DONE ', 5); + exeCmd("start_wifi.sh && jci-wifiap.sh start"); } function stopFirewall() { - showAioInfo("$ jci-fw.sh stop"); - aioWs('/bin/sh /jci/scripts/jci-fw.sh stop && echo "DONE" || echo "FAILBOAT" ', 1); + // showAioInfo("$ jci-fw.sh stop"); + // aioWs('/bin/sh /jci/scripts/jci-fw.sh stop && echo "DONE" || echo "FAILBOAT" ', 1); + exeCmd("jci-fw.sh stop"); } /*function myMessage(){ var msg = '/jci/gui/apps/_aiotweaks/sh/message.sh "MESSAGES DISPLAY SUCCESS!!
    THIS IS A P.O.C. FOR DISPAYING JCI-DIALOG
    MESSAGES USING WEBSOCKETS AND JAVASCRIPT"'; @@ -369,7 +393,7 @@ function AioFileCheck(fc) { var FC = fc.substr(fc.lastIndexOf("_")); switch (FC) { case "_NOAA": - $('#aaTitle, .aaFunc').remove(); + $('#aaTitle, .aaFunc, #headunitLogBtn').remove(); $('#csTitle').addClass('centered'); break; case "_CS": @@ -406,17 +430,19 @@ function AioFileCheck(fc) { } } -function showVehicleType() { - var vehicleType = framework.getSharedData("syssettings", "VehicleType"); - var hud = framework.getSharedData("vehsettings", "HudInstalled"); - var IgnitionStatus = framework.getSharedData("vehsettings", "IgnitionStatus"); - var CANStatus = framework.getSharedData("vehsettings", "CanStatus"); - var vehicleConfig = framework.getSharedData("syssettings", "VehicleConfigData"); - var email = framework.getSharedData('email', "emailSupported"); - var destination = framework.getSharedData("syssettings", "DestinationCode"); - var steeringWheelType = framework.getSharedData("vehsettings", "SteeringWheelLoc"); - var toolTipsEnabled = framework.getSharedData("syssettings", "ToolTips"); - showAioInfo("Vehicle Type: " + vehicleType + "
    HUD: " + hud + "
    Ignition Status: " + IgnitionStatus + "
    CAN Status: " + CANStatus + "
    Vehicle Configuration Data: " + vehicleConfig + "
    Email Support: " + email + "
    Destination: " + destination + "
    Steering Wheel Type: " + steeringWheelType + "
    Tool Tips Enabled: " + toolTipsEnabled); +function showVehicleData() { + var vehicleType = [] + vehicleType.push("Shared Vehicle Data:"); + vehicleType.push("
    Vehicle Type: " + framework.getSharedData("syssettings", "VehicleType")); + vehicleType.push("
    HUD: " + framework.getSharedData("vehsettings", "HudInstalled")); + vehicleType.push("
    Ignition Status: " + framework.getSharedData("vehsettings", "IgnitionStatus")); + vehicleType.push("
    Can Status: " + framework.getSharedData("vehsettings", "CanStatus")); + vehicleType.push("
    Vehicle Configuration Data: " + framework.getSharedData("syssettings", "VehicleConfigData")); + vehicleType.push("
    Email Support: " + framework.getSharedData('email', "emailSupported")); + vehicleType.push("
    Destination: " + framework.getSharedData("syssettings", "DestinationCode")); + vehicleType.push("
    Steering Wheel Type: " + framework.getSharedData("vehsettings", "SteeringWheelLoc")); + vehicleType.push("
    Tool Tips Enabled: " + framework.getSharedData("syssettings", "ToolTips")); + showAioInfo(vehicleType.join(" ")); } function showAppList() { @@ -424,7 +450,7 @@ function showAppList() { $.each(appListData, function(key, val) { items.push("

  • " + val.label + "
  • "); }); - showAioInfo('Installed AIO Apps'); + showAioInfo('Installed AIO Apps:'); $("
    ' + '
    ' + '
    ' + - '
    '; + '
    ' + + '
    ' + + '
    '; function AIOTabs(tab, tabLink) { - $(".tablinks").removeClass("active-tab"); + $(".tablinks, .tabcontent").removeClass("active-tab"); $(".tabcontent").hide(); $(".tabcontent").removeClass("animate-zoom"); $("button").removeClass("selectedItem"); maxButtons = $(tab + " a").length - 2; $(tab).show(); - $(tab).addClass('animate-zoom'); + $(tab).addClass('animate-zoom active-tab'); (selectedItem < maxButtons) ? $(tab + " button").eq(selectedItem).addClass("selectedItem"): selectedItem = 0; $(tabLink).addClass("active-tab"); - currTab = tab; + currTab = $(tabLink).attr("tabindex"); } // Buttons @@ -90,29 +93,27 @@ function AIOTweaksTmplt(uiaId, parentDiv, templateID, controlProperties) { $("
    ").attr("id", "MainMenuMsg").css({ "padding": "0px" }).insertAfter($('#MainMenu')); // Apps Section - $("