diff --git a/README.md b/README.md index 7acdfa2..146c174 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,197 @@ -# MZD-AIO-TI 2.5 [![Download](https://api.bintray.com/packages/trevelopment/MZD-AIO-TI/AIO/images/download.svg?version=MZD-AIO-TI) ](http://dl.mazdatweaks.win) +# MZD-AIO-TI 2.8 [![Download](aio.svg?version=MZD-AIO-TI) ](http://dl.mazdatweaks.win) ## MZD All In One tweaks Installer #### Installer and uninstaller for several different system tweaks for Mazda MZD Infotainment System + [How To Install](#how-to-install) + ##### App Size ~ 260MB -AIO Rebuilt with [Electron] & [AngularJS] -[MazdaTweaks.com] + +AIO Rebuilt with [Electron] & [AngularJS][mazdatweaks.com] Included Translator & Photo-Joiner (for background rotator tweak) + ### Special thanks to all the developers out there that made this possible! + ### And of course, Thanks to @Siutsch for [AIO 1.x][1] -##### (Mazda 2 (DJ), Mazda 3 (BM), Mazda 6 (GJ), Mazda CX-3 (DK), Mazda CX-5 (KE), Mazda MX-5 Roadster (ND) and new 2017 Mazda CX-9 (TC)) -#### WHICH FW VERSIONS ARE SUPPORTED: +##### (Mazda 2 (DJ), Mazda 3 (BM), Mazda 6 (GJ), Mazda CX-3 (DK), Mazda CX-5 (KE), Mazda MX-5 Roadster (ND) and Mazda CX-9 (TC)) -##### All Firmware versions v55, v56, v58, v59 up to 59.00.502 **NOTE: v59.00.502 has removed the ability to install tweaks When updating from a previous version install autorun & recovery scripts BEFORE updating to recover access.** - ------ +* * * ### **IMPORTANT: All changes happen at your own risk!** + ##### **Please understand that you can damage or brick your infotainment system running these tweaks!** + ##### **Anyone who is unsure should leave it alone, ask someone with experience to help or ask in the forum.** + ##### **I am not responsible for damages that may incur from the use.** +* * * + +##### Touchscreen + +Allows the use of the touchscreen while driving. +Fix Cluster Compass: Some things will be disabled while driving but the touchscreen itself and the cluster compass will work + +##### No More Disclaimer + +Completely remove the disclaimer or reduce the expansion time of the disclaimer from 3.5 to 0.5 seconds. + +##### Reverse Camera Safety Warning + +No security + +##### Semi-Transparent Parking Sensor Graphics. + +Semitransparent parking sensor graphics for proximity sensors. When activating the rear camera, the car is displayed at the top right corner. The graphics now appear semitransparent by installing tweak. ![semi-transparent_parking-sensors](app/files/img/semi-transparent_parking-sensors.jpg) + +##### Main Menu Loop. + +Loop for the main menu. +You can jump from left to far right, and vice versa. + +##### Improved List Loop. + +Loop for all lists and submenu (music, contacts, etc.). +You can now jump from the top position of a list to the bottom and vice versa. + +##### Shorter Delay Mod. + +Reduces the waiting time for switching between pages with the multi commander from 1.5 to 0.3 seconds. + +##### No More Beeps + +Disable all 'Beeps' made by the system that are not silenced by the 'Settings > Sound > Beep' option. This also includes the beeps that cannot be silenced by the settings option. + +##### Change Order of the Audio Source List. + +Customize The order of the audio sources list. + +##### Pause On Mute. + +When pressing mute (pressing the volume button) played media are also paused. Only works in the music player screen. + +##### Remove Message Replies + +Removes the text 'Sent from my Mazda Quick Text System' if answering messages. + +##### 1 Sec Diag Menu + +Allows you to open the diagnostic menu by touching the clock at the top right of the **display settings menu** for one second. + +##### Boot Animation + +Customize the boot animation. + +##### Date In Status Bar Mod. + +Permanently visible date + icons above the clock, even if system messages are displayed. Choose between 3 date formats. ![mzd_datum_icons_all](app/files/img/mzd_datum_icons_all.jpg) + +##### USB Audio Mod. By: Enlsen + +## **NOT Compatible with FW v59.00.502+** + +\*\*Patches The USB Audio App With These Mods: + +1. Long press (click hold) folders/all songs to play +2. Adds new icon for USB root menu on the UMP control +3. Removes "More like this" button from UMP control +4. Adds folders button to UMP control +5. Set folders and song list icons correctly (were switched) on UMP control +6. Removes trailing "/" character from folder names for list control and title of now playing +7. Adds folder and song icons to the list control +8. Adds folder and playlist icons to now playing +9. At the begining or each track shows **Artist - Title** in a status-bar notification. + +![USBAudioMod](app/files/img/USBAudioMod.jpg) + +##### Bigger Album Art + +You get a bigger album art graphic. +Extra Options: + +- Full Width Titles: Song/Album/Artist will span across the entire screen. +- Hide Album Art: Hides all album art. + ![full_titles](app/files/img/full_titles.png) + +##### No Background Behind Buttons + +Remove the background behind the buttons and other semi-transparent overlay backgrounds. Overlays that can be removed: Now Playing, List View, In Call, Text Message View, and Behind Buttons ![NoButtonBackground](app/files/img/NoButtonBackground.jpg) + +##### Change Blank Album Art Frame + +The empty album cover frame is removed, which is displayed when there is no entry in the Gracenote database for the artist. Then the image of your choice (or transparent image) is displayed, if there is no cover in the MP3 tag too. Supported image formats are: jpg, jpeg, and png (any size). Note: The image chosen will be resized to 146px x 146px **BUT NOT CROPPED** and converted to .png format + +##### Swapfile + +The Swapfile will provide your system with an additionasl 1 GB of RAM running from the USB drive for playing videos. The installation of the swap file must be done on a USB drive with music and/or movies, that remains in the car.. The installation files are automatically deleted, the drive may no longer be removed during operation, because the system will use it also as memory.. Only remove the USB drive if the MZD system is off. + +##### Fuel Consumption Tweak. + +Additional display of KM / L (or MPG). ![FuelConsumptionTweak](app/files/img/FuelConsumptionTweak.jpg) + +##### Videoplayer + +[The VideoPlayer App.](/videoplayer/) + +##### Speedometer + +Speedometer App with many options and features. + +![mzd_SpeedoCompass](app/files/img/mzd_SpeedoCompass.gif) + +##### Castscreen receiver. + +After installation you can mirror the smartphone screen at the infotainment display (mirroring). + +- You have to install the castscreen app on your Android Phone (castscreen-1.0.apk) The app can be found in the 'config' folder of your USB drive +- activate the debug mode on your smartphone +- connect the smartphone with USB cable to the infotainment system +- start the app settings: H264, 800x480 @ 160, 1 mbps, then input 127.0.0.1 and press input receiver, then tap Start on right-up corner. + +. + +##### Android Auto Headunit App. + +1. Install the Android app from google play store +2. Connect the phone to USB and pair the phone bluetooth with the CMU +3. Android Auto will then start. If it does not try to open from the 'Applications' menu +4. 3 ways to stop AA + 1. Press Home Button on the Mazda's Commander + 2. Disconnect the USB cable + 3. Use the onscreen menu 'Return to Mazda Connect' on last screen with speedo icon. + +![AndroidAuto](app/files/img/AndroidAuto.jpg) + +##### AIO Tweaks App. + +###### **Every function in this app is _not_ guaranteed to work** but here are some useful and/or fun things you can do: + +- 'Apps' Tab: + - Home: Goes home. This was the easy part. + - Go to: USB A, USB B, Bluetooth (audio context). + - Previous, Next - Works without changing contexts + - Stop (and Start\*) Android Auto Headunit process. + - Killing headunit process with allow Bluetooth calling to work correctly. + - Starting the process does not work properly yet, reboot CMU to restart headunit process. + - Stop and Start Castscreen Receiver + - Useful for troubleshooting if it is not functioning correctly. + - Both of these do work but there is a possibility that a memory issue may prevent the process from properly starting in which case a reboot is required to allow the process to run. +- 'Tweaks' Tab: + - Many familiar AIO layout related tweaks that can be applied on the fly + - Applied tweaks are automatically saved to localStorage and saved tweaks are applied on boot. + - Toggle each individual tweak on or off. + - One button to reset all tweaks. + - _NOTE: AIO Tweaks App will not UNDO installed tweaks, they will mix and may result in unexpected and/or interesting layouts_ +- 'Options' Tab: + + - Enable/Disable Touchscreen: _NOTE: Changes to the touchscreen functionality are applied when the vehicle comes to a **COMPLETE STOP**_ + + - Reboot: To Reboot. + +![AIO_Tweaks-Screen](app/files/img/AIO_Tweaks-Screen.png) + # [CHANGELOG] ## In 2.3.x diff --git a/aio.svg b/aio.svg new file mode 100644 index 0000000..9ec0beb --- /dev/null +++ b/aio.svg @@ -0,0 +1 @@ +DownloadDownloadMZD-AIO-TIMZD-AIO-TI \ No newline at end of file diff --git a/app/assets/css/casdk.css b/app/assets/css/casdk.css index 63eb907..d71000b 100644 --- a/app/assets/css/casdk.css +++ b/app/assets/css/casdk.css @@ -14,6 +14,9 @@ padding: 0; border: none; } +.casdk-app-img { + width: 15%; +} @media only screen and (min-width: 1400px) { #sidePanel>ul>li { width: 33%; @@ -519,9 +522,12 @@ PANELS CONFIGURATIONS } /* TODO PANEL */ -.steps { +.mb.casdk-apps { display: block; - overflow: hidden; + overflow: auto; +} +.mb.casdk-apps::-webkit-scrollbar { + width: 15px; } .steps input[type=checkbox] { display: none; @@ -532,7 +538,7 @@ PANELS CONFIGURATIONS padding: 0px; margin: auto; width: 100%; - height: 50px; + height: 16.6%; color: white; text-transform: uppercase; font-weight: 900; @@ -546,7 +552,7 @@ PANELS CONFIGURATIONS } .steps>label { background: #393D40; - height: 55px; + height: 16.6%; line-height: 55px; width: 100%; display: block; @@ -578,7 +584,7 @@ PANELS CONFIGURATIONS .steps>label:hover:before { border: 1px solid #46b7e5; } -#op1:checked~label[for=op1]:before, #op2:checked~label[for=op2]:before, #op3:checked~label[for=op3]:before, #op4:checked~label[for=op4]:before, #op5:checked~label[for=op5]:before, #op6:checked~label[for=op6]:before { +[id*=op]:checked+label[for*=op]:before { border: 2px solid #96c93c; background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAHCAYAAAA1WQxeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAGFJREFUeNpinHLMhgEHKADia0xQThIQs6JJ9gPxZhYQAcS6QHwDiI8hSYJAC0gBPxDLAvFcIJ6JJJkDxFNBVtgBcQ8Qa6BLghgwN4A4a9ElQYAFSj8C4mwg3o8sCQIAAQYA78QTYqnPZuEAAAAASUVORK5CYII=') no-repeat center center; } @@ -1041,9 +1047,6 @@ label { background: #fff; color: #000; } -#CASDKinfo:hover, #CASDKinfoBtn:hover+#CASDKinfo { - display: inline-block; -} .ck-button label span { border-radius: 4px; border: 2px dotted #008800; @@ -1068,13 +1071,9 @@ label { #CASDKinfo img { max-width: 350px; } -.w3-text::-webkit-scrollbar-button:single-button:start, .w3-text::-webkit-scrollbar-button:single-button:end, ::-webkit-scrollbar-button:single-button:start, ::-webkit-scrollbar-button:single-button:end { +a#load-last-btn, a#load-btn, a#save-btn, .w3-text::-webkit-scrollbar-button:single-button:start, .w3-text::-webkit-scrollbar-button:single-button:end, ::-webkit-scrollbar-button:single-button:start, ::-webkit-scrollbar-button:single-button:end { display: none; } -input[type="checkbox"]#casdkTOsd { - top: 11px; - display: initial; -} #CASDKinfo input[type="checkbox"]:checked+label, #CASDKinfo input[type="checkbox"]:checked+span { font-weight: bold } @@ -1084,3 +1083,20 @@ input[type="checkbox"]#casdkTOsd { .modal-footer .btn+.btn { margin-left: 0; } +span.casdk-apps { + display: table-cell; +} +.casdk-app-img { + width: 95%; + max-width: 300px; +} +.reset-fade { + z-index: 999; + color: #fff; +} +div#file a { + display: none; +} +div#file a:last-child { + display: block; +} diff --git a/app/assets/css/checkboxStyles.css b/app/assets/css/checkboxStyles.css index dabdd98..8fc73b2 100644 --- a/app/assets/css/checkboxStyles.css +++ b/app/assets/css/checkboxStyles.css @@ -644,6 +644,7 @@ input[type=color]::-webkit-color-swatch { } .icon-question~.popover { background-color: #000; + font-size: 12px; } .hasColorFiles td:nth-child(2) label { padding: 2px 11px; @@ -729,8 +730,7 @@ tr.w3-row.w3-col td strong { #sidePanel .speedo-lang .speedo-radio label { width: 25%; } -#sidePanel .speedo-radio.third label, -#sidePanel .sbspeedo .speedo-radio label { +#sidePanel .speedo-radio.third label, #sidePanel .sbspeedo .speedo-radio label { width: 33.3333%; } #sidePanel .speedo-color .speedo-radio label { diff --git a/app/assets/css/index.css b/app/assets/css/index.css index ae1e2d0..08b3e99 100644 --- a/app/assets/css/index.css +++ b/app/assets/css/index.css @@ -115,7 +115,7 @@ div#header, #notices, nav#mySidenav, header span#openNav, header span#openSidePa margin-top: 30px; } .showNav~nav#mySidenav { - top: 25px; + /* top: 25px; */ } .hideNav span.icon-lock:before { /*font-size: 26px;*/ @@ -560,22 +560,27 @@ tr#custThemeHelp { #custbgOptions td { padding: 5px; } +#custbgOptions button { + width: 100%; +} .uninstall-check input[disabled]~label:after, .install-check input[disabled]~label:after { background: none; content: 'x'; - font-size: 25px; + font-size: 30px; padding: 0; margin: 0px 0px 0px 0px; - line-height: .4; - color: inherit; + line-height: 0.4; opacity: 0.1; + color: #b3b3b3; } input[disabled]~label:hover:after { - opacity: .7; + opacity: 0.4; + color: #ff9900; box-shadow: none; } input[disabled]~label:active:after { opacity: 1; + color: #ff0000; cursor: not-allowed; } div#bgPickTitle { @@ -587,6 +592,12 @@ div#bgPickTitle { text-align: center; font-size: 10px; } +.flacmsg { + font-size: 11px; +} +.flacmsg p { + display: none; +} #img2use { width: 810px; max-height: 490px; @@ -825,7 +836,7 @@ div#helpMenuTop, div#helpMenuTop .w3-third { margin-right: 10px; } .finishedMessage .modal-dialog { - max-width: 450px; + max-width: 550px; } .tooltip>.tooltip-inner { max-width: 100% !important; @@ -1271,14 +1282,22 @@ input#bgRotatorSeconds { padding: 3px 16px; font-size: 20px; font-weight: 800; + width: 85px; + display: inline-block; + border: 2px solid transparent; + border-bottom: 2px solid #808080; } input#bgRotatorSeconds:hover { - border: 2px dotted #ff0000; - background: #aaa; + border: 2px dashed #099; + background: #9dd; } input#bgRotatorSeconds:focus { background: #ddd; } +input#bgRotatorSeconds.error { + border: 2px dotted #fcf939; + background: #ff0000; +} input:focus { outline: 2px solid rgba(0, 0, 0, 0.55); } @@ -1610,6 +1629,9 @@ select#spdOp-barThemeStart { .gauge-type { width: 40%; } +.featherlight.announcementWindow a { + display: inline; +} /* @media Queries */ @media only screen and (min-width: 801px) { @@ -1968,6 +1990,9 @@ a#update-available { #changelog { text-transform: capitalize; } +#changelog li { + text-transform: none; +} span.nocap { text-transform: none; } @@ -2265,6 +2290,13 @@ button#compileAutorun { #audioSourceOrder input[type=number] { width: 25%; text-align: center; + padding-top: 0; +} +#audioSourceOrder .audio-order { + padding-top: 8px; +} +#audioSourceOrder .audio-order span { + padding-top: 4px; } #SbSpeedoOps { font-size: 16px; @@ -2460,6 +2492,7 @@ input#spdOp-interval { } #serialConnection .link { color: blue; + cursor: pointer; border-bottom: 1px dashed green; } .ng-invalid { @@ -2475,12 +2508,14 @@ input#spdOp-interval { outlline: none; cursor: auto; } +.fuel-gauge-capacities { + transition: .6s ease-in .2s; + text-decoration: underline; +} +.fuel-gauge-capacities:hover { + background: rgba(242, 145, 249, 0.56); + color: blue; +} input:disabled { cursor: not-allowed; } -/* ******* REMOVE FOR VERSION 2.8.0 ******** */ - -.casdk-link { - display: none; -} -/* ****************************************** */ diff --git a/app/assets/js/audioSourceList.js b/app/assets/js/audioSourceList.js index 43c10d7..3da99f9 100644 --- a/app/assets/js/audioSourceList.js +++ b/app/assets/js/audioSourceList.js @@ -4,10 +4,13 @@ var entertainmentItems = [ { label: 'USB B', menuItem: 'UsbAudioBPos', pos: 2 }, { label: 'Aux In', menuItem: 'AuxInPos', pos: 3 }, { label: 'Bluetooth', menuItem: 'BluetoothPos', pos: 4 }, + { label: 'Android Auto', menuItem: 'aaAudioPos', pos: 15 }, + { label: 'Car Play', menuItem: 'cpAudioPos', pos: 16 }, { label: 'FM Radio', menuItem: 'FmRadioPos', pos: 5 }, { label: 'AM Radio', menuItem: 'AmRadioPos', pos: 6 }, { label: 'XM Radio', menuItem: 'SdarsRadioPos', pos: 7 }, - { label: 'DAB Radio', menuItem: 'DabRadioPos', pos: 2 }, + { label: 'XM Audio', menuItem: 'xmRadioPos', pos: 17 }, + { label: 'DAB Radio', menuItem: 'DabRadioPos', pos: 14 }, { label: 'Aha Radio', menuItem: 'AhaRadioPos', pos: 8 }, { label: 'Pandora', menuItem: 'PandoraPos', pos: 9 }, { label: 'Stitcher', menuItem: 'StitcherItemPos', pos: 10 }, diff --git a/app/assets/js/build-tweaks.js b/app/assets/js/build-tweaks.js index 7afaff6..27bd0b0 100644 --- a/app/assets/js/build-tweaks.js +++ b/app/assets/js/build-tweaks.js @@ -68,65 +68,78 @@ function buildTweakFile(user, apps) { saveInstallerOps(user) if (fs.existsSync(`${tmpdir}`)) { aioLog('Delete old _copy_to_usb folder...') - try { - // delete tmp folder if it exists and make new tmpdir - rimraf.sync(`${tmpdir}`) - } catch (e) { - let m = `${e} - Error occured while deleting old '_copy_to_usb' folder. Try closing all other running programs and folders before compiling.` - aioLog(m, m) - finishedMessage() - return - } - } - /* Autorun Script Installer */ - if (user.autorun.installer) { - buildAutorunInstaller(user) - return } try { - mkdirp.sync(`${tmpdir}`) - mkdirp.sync(`${tmpdir}/config/`) - mkdirp.sync(`${tmpdir}/config_org/`) + // delete tmp folder if it exists and make new tmpdir + rimraf.sync(`${tmpdir}`) } catch (e) { - m = `${e} - Error occured while creating '_copy_to_usb' folder. Try closing all other running programs and folders before compiling.` - aioLog(e.message, m) + let m = `Error occured while deleting old '_copy_to_usb' folder: ${e}\n Try closing all other running programs and folders before compiling.` + aioLog(m, m) finishedMessage() return } - /* Full System Restore Script */ - if (user.restore.full) { - fullSystemRestore(user) - return - } - /* CASDK Installer */ - if (user.casdk.inst || user.casdk.uninst) { - if (apps) { - buildCASDK(user, apps) - rimraf.sync(`${tmpdir}/config/`) - rimraf.sync(`${tmpdir}/config_org/`) + setTimeout(() => { + /* Autorun Script Installer */ + if (user.autorun.installer) { + buildAutorunInstaller(user) return } - } - // first back up JCI folder if chosen - if (user.mainOps.indexOf(1) !== -1) { - addTweak('00_backup.txt') - } - if (user.mainOps.indexOf(0) !== -1 || user.options.indexOf(21) !== -1) { - addTweak('00_wifi.txt') - } - if (user.mainOps.indexOf(4) !== -1 || user.options.indexOf(21) !== -1) { - addTweak('00_sshbringback.txt') - addTweakDir('ssh_bringback', true) - } - if (user.options.indexOf(16) !== -1) { - mkdirp.sync(`${tmpdir}/config/blank-album-art-frame/jci/gui/common/images/`) - addTweakDir('blank-album-art-frame', true) - } - checkForColorScheme(user) + try { + mkdirp.sync(`${tmpdir}/`) + mkdirp.sync(`${tmpdir}/config/`) + // mkdirp.sync(`${tmpdir}/config_org/`) + } catch (e) { + m = `${e} - Error occured while creating '_copy_to_usb' folder. Try closing all other running programs and folders before compiling.` + aioLog(e.message, m) + finishedMessage() + return + } + /* Full System Restore Script */ + if (user.restore.full) { + fullSystemRestore(user) + return + } + /* CASDK Installer */ + if (user.casdk.inst || user.casdk.uninst) { + if (apps) { + buildCASDK(user, apps) + rimraf.sync(`${tmpdir}/config/`) + rimraf.sync(`${tmpdir}/config_org/`) + return + } + } + // first back up JCI folder if chosen + if (user.mainOps.includes(1)) { + addTweak('00_backup.txt') + } + if (user.mainOps.includes(0) || user.options.includes(21)) { + addTweak('00_wifi.txt') + } + if (user.mainOps.includes(4) || user.options.includes(21)) { + addTweak('00_sshbringback.txt') + addTweakDir('ssh_bringback', true) + } + if (user.options.includes(16)) { + addTweakDir('blank-album-art-frame', true) + mkdirp.sync(`${tmpdir}/config/blank-album-art-frame/jci/gui/common/images/`) + var outStr = fs.createWriteStream(`${tmpdir}/config/blank-album-art-frame/jci/gui/common/images/no_artwork_icon.png`) + var inStr = fs.createReadStream(`${varDir}/no_artwork_icon.png`) + outStr.on('close', function() { + aioLog('Blank Album Art Copy Successful!') + checkForColorScheme(user) + }) + outStr.on('error', function(err) { + aioLog(err, 'Blank Album Art Copy FAILED!') + }) + inStr.pipe(outStr) + } else { + checkForColorScheme(user) + } + }, 1000) } /* Check For Color Scheme Tweak */ function checkForColorScheme(user) { - if (user.mainOps.indexOf(3) !== -1) { + if (user.mainOps.includes(3)) { if (user.colors > 16) { customTheme(themeColor, user) } else if (user.colors < 8 || user.colors === 11) { // 11 for CarOS theme @@ -185,10 +198,6 @@ function setTheme(color, user) { function setColor(color, user) { fs.mkdirSync(`${tmpdir}/config/color-schemes`) - copydir(`${extradir}/color-schemes/speedometer/`, `${tmpdir}/config/color-schemes/speedometer`, function(err) { - if (err) { aioLog(err, err) } - aioLog('Speedometer Color Files Copied') - }) aioLog(`Unzipping ${color} color theme folder`) extract(`${extradir}/color-schemes/${color}/jci.zip`, { dir: `${tmpdir}/config/color-schemes/${color}` }, function(err) { if (err) { aioLog(err, err) } @@ -217,106 +226,99 @@ function buildTweak(user) { // ****************************************************/ // **********Write uninstalls first********************/ // ****************************************************/ - if (user.options.indexOf(101) !== -1) { + if (user.options.includes(101)) { addTweak('01_touchscreen-u.txt') } - if (user.options.indexOf(102) !== -1) { + if (user.options.includes(102)) { addTweak('02_disclaimer-u.txt') - addTweakDir('audio_order_AND_no_More_Disclaimer', false) - disclaimerAndAudioFlag = true } - if (user.options.indexOf(103) !== -1) { + if (user.options.includes(103)) { addTweak('03_warning-u.txt') addTweakDir('safety-warning-reverse-camera', false) } - if (user.options.indexOf(104) !== -1) { + if (user.options.includes(104)) { addTweak('04_sensor-u.txt') addTweakDir('transparent-parking-sensor', false) } - if (user.options.indexOf(105) !== -1) { + if (user.options.includes(105)) { addTweak('05_mainloop-u.txt') addTweakDir('main-menu-loop', false) } - if (user.options.indexOf(106) !== -1) { + if (user.options.includes(106)) { addTweak('06_listloop-u.txt') addTweakDir('list-loop', false) } - if (user.options.indexOf(107) !== -1) { + if (user.options.includes(107)) { addTweak('07_shorterdelay-u.txt') } - if (user.options.indexOf(108) !== -1) { + if (user.options.includes(108)) { addTweak('08_sysbeep-u.txt') } - if (user.options.indexOf(109) !== -1) { + if (user.options.includes(109)) { addTweak('09_audioorder-u.txt') - buildEntList(user) - if (!disclaimerAndAudioFlag) { - addTweakDir('audio_order_AND_no_More_Disclaimer', false) - } } - if (user.options.indexOf(110) !== -1) { + if (user.options.includes(110)) { addTweak('10_pausemute-u.txt') - addTweakDir('pause-on-mute', false) } - if (user.options.indexOf(111) !== -1) { + if (user.options.includes(111)) { addTweak('11_msgreplies-u.txt') addTweakDir('message_replies', false) } - if (user.options.indexOf(112) !== -1) { + if (user.options.includes(112)) { addTweak('12_diag-u.txt') } - if (user.options.indexOf(113) !== -1) { + if (user.options.includes(113)) { addTweak('13_boot-u.txt') addTweakDir('bootanimation', false) } - if (user.options.indexOf(114) !== -1) { + if (user.options.includes(114)) { addTweak('14_bgart-u.txt') addTweakDir('bigger-album-art', false) } - if (user.options.indexOf(115) !== -1) { + if (user.options.includes(115)) { addTweak('15_btnbackground-u.txt') addTweakDir('NoButtons', false) } - if (user.options.indexOf(116) !== -1) { + if (user.options.includes(116)) { addTweak('16_blnkframe-u.txt') addTweakDir('blank-album-art-frame', false) } - if (user.options.indexOf(117) !== -1) { + if (user.options.includes(117)) { addTweak('17_videoplayer-u.txt') } - if (user.options.indexOf(118) !== -1) { + if (user.options.includes(118)) { addTweak('18_swapfile-u.txt') } - if (user.options.indexOf(119) !== -1) { + if (user.options.includes(119)) { addTweak('19_speedo-u.txt') addTweakDir('speedometer', false) } - if (user.options.indexOf(122) !== -1) { + if (user.options.includes(122)) { addTweak('22_fuel-u.txt') addTweakDir('FuelConsumptionTweak', false) } - if (user.options.indexOf(124) !== -1) { + if (user.options.includes(124)) { addTweak('24_castscreen-u.txt') } - if (user.options.indexOf(125) !== -1) { + if (user.options.includes(125)) { addTweak('25_androidauto-u.txt') - addTweakDir('androidauto', false) + //addTweakDir('androidauto', false) } - if (user.options.indexOf(121) !== -1) { + if (user.options.includes(121)) { addTweak('08_orderflac-u.txt') addTweakDir('media-order-patching', false) } - if (user.options.indexOf(126) !== -1) { + if (user.options.includes(126)) { addTweak('26_usbaudiomod-u.txt') addTweakDir('USBAudioMod', false) } - if (user.options.indexOf(127) !== -1) { + if (user.options.includes(127)) { addTweak('27_aioapp-u.txt') } if (user.mzdmeter.uninst) { addTweak('28_mzdmeter-u.txt') } - if (user.mainOps.indexOf(106) !== -1) { + if (user.mainOps.includes(106)) { addTweak('00_bgrotator-u.txt') addTweakDir('BackgroundRotator', false) } @@ -325,7 +327,7 @@ function buildTweak(user) { // ****************************************************/ // ******************Write Installs********************/ // ****************************************************/ - if (user.mainOps.indexOf(3) !== -1) { + if (user.mainOps.includes(3)) { if (user.colors === 0) { addTweak('21_colors-u.txt') } else if (user.colors < 8 || user.colors === 11) { @@ -335,56 +337,48 @@ function buildTweak(user) { addTweak('21_theme-i.txt') } } - if (user.options.indexOf(1) !== -1) { + if (user.options.includes(1)) { addTweak('01_touchscreen-i.txt') } - if (user.options.indexOf(2) !== -1) { - if (user.disclaimOps === 1) { - addTweak('02_disclaimer5-i.txt') - } else { - addTweak('02_disclaimer-i.txt') - } - addTweakDir('audio_order_AND_no_More_Disclaimer', true) - buildEntList(user) - disclaimerAndAudioFlag = true + if (user.options.includes(2)) { + // if (user.disclaimOps === 1) { + // addTweak('02_disclaimer5-i.txt') + //} else { + addTweak('02_disclaimer-i.txt') + // } } - if (user.options.indexOf(3) !== -1) { + if (user.options.includes(3)) { addTweak('03_warning-i.txt') addTweakDir('safety-warning-reverse-camera', true) } - if (user.options.indexOf(4) !== -1) { + if (user.options.includes(4)) { addTweak('04_sensor-i.txt') addTweakDir('transparent-parking-sensor', true) } - if (user.options.indexOf(5) !== -1) { + if (user.options.includes(5)) { addTweak('05_mainloop-i.txt') addTweakDir('main-menu-loop', true) } - if (user.options.indexOf(6) !== -1) { + if (user.options.includes(6)) { addTweak('06_listloop-i.txt') addTweakDir('list-loop', true) } - if (user.options.indexOf(7) !== -1) { + if (user.options.includes(7)) { addTweak('07_shorterdelay-i.txt') } if (user.listbeep) { addTweak('07_listbeep-i.txt') } - if (user.options.indexOf(8) !== -1) { + if (user.options.includes(8)) { addTweak('08_sysbeep-i.txt') } - if (user.options.indexOf(9) !== -1) { + if (user.options.includes(9)) { addTweak('09_audioorder-i.txt') - if (!disclaimerAndAudioFlag) { - addTweakDir('audio_order_AND_no_More_Disclaimer', true) - buildEntList(user) - } } - if (user.options.indexOf(10) !== -1) { + if (user.options.includes(10)) { addTweak('10_pausemute-i.txt') - addTweakDir('pause-on-mute', true) } - if (user.options.indexOf(19) !== -1) { + if (user.options.includes(19)) { addTweak('19_speedo-i1.txt', true) switch (user.speedoOps.lang.id) { case 1: @@ -416,7 +410,7 @@ function buildTweak(user) { if (user.speedoOps.xph.id === 10) { addTweak('19_speedo-mph.txt', true) } - if (user.speedoOps.effic.id === 41) { + if (user.speedoOps.effic.id === 40) { addTweak('19_speedo-kml.txt', true) } if (user.speedoOps.classicLargeText) { @@ -459,55 +453,60 @@ function buildTweak(user) { addTweakDir('speedometer', true) writeSpeedoConfigFile(user) } - if (user.options.indexOf(21) !== -1) { + if (user.options.includes(21)) { addTweak('08_orderflac-i.txt') addTweakDir('media-order-patching', true) } - if (user.options.indexOf(24) !== -1) { + if (user.options.includes(24)) { addTweak('24_castscreen-i.txt') addTweakDir('castscreen-receiver', true) } - if (user.options.indexOf(25) !== -1) { + if (user.options.includes(25)) { addTweak('25_androidauto-i.txt') addTweakDir('androidauto', true) + if (user.aaWifi) { + addTweak('25_androidautowifi-i.txt') + addTweakDir('androidautowifi', true) + } if (user.aaBetaVer) { addTweak('25_androidautob-i.txt') - addTweakDir('androidautob', true) + if (!user.aaWifi) addTweakDir('androidautob', true) } + } - if (user.options.indexOf(11) !== -1) { + if (user.options.includes(11)) { addTweak('11_msgreplies-i.txt') addTweakDir('message_replies', true) } - if (user.options.indexOf(12) !== -1) { + if (user.options.includes(12)) { addTweak('12_diag-i.txt') addTweakDir('test_mode', true) } - if (user.options.indexOf(13) !== -1) { + if (user.options.includes(13)) { addTweak('13_boot-i.txt') addTweakDir('bootanimation', true) } - if (user.options.indexOf(26) !== -1) { + if (user.options.includes(26)) { addTweak('26_usbaudiomod-i.txt') // USB Audio Mod Install comes before Bigger Album Art addTweakDir('USBAudioMod', true) } - if (user.options.indexOf(14) !== -1) { + if (user.options.includes(14)) { addTweak('14_bgart-i.txt') addTweakDir('bigger-album-art', true) } - if (user.options.indexOf(15) !== -1) { + if (user.options.includes(15)) { addTweak('15_btnbackground-i.txt') addTweakDir('NoButtons', true) } - if (user.options.indexOf(17) !== -1) { + if (user.options.includes(17)) { addTweak('17_videoplayer-i.txt') addTweakDir('videoplayer', true) - if (user.vpUnicode) { - addTweak('17_videoplayer-unicode.txt') - } } - if (user.options.indexOf(27) !== -1) { + if (user.options.includes(27)) { addTweak('27_aioapp-i.txt') + if (user.screenOffBoot) { + addTweak('27_aioapp-screenoff.txt') + } addTweakDir('aio-app', true) } if (user.mzdmeter.inst) { @@ -515,7 +514,7 @@ function buildTweak(user) { addTweakDir('mzdmeter', true) } /* TODO: Fuel Consumptoion Tweak - Think of a better way to pick MPG or Km/L (Like a variable) */ - if (user.options.indexOf(22) !== -1) { + if (user.options.includes(22)) { if (user.fuelOps === 1) { addTweak('22_fuelMPG-i.txt') } else { @@ -523,11 +522,16 @@ function buildTweak(user) { } addTweakDir('FuelConsumptionTweak', true) } + // disclaimer & order of audio source list + if (user.options.includes(2) || user.options.includes(9) || user.options.includes(102) || user.options.includes(109)) { + addTweakDir('audio_order_AND_no_More_Disclaimer', true) + buildEntList(user) + } // Statusbar Tweaks - if (user.options.indexOf(120) !== -1) { + if (user.options.includes(120)) { addTweak('20_date-u.txt') addTweakDir('date-to-statusbar_mod', false) - } else if (user.options.indexOf(20) !== -1) { + } else if (user.options.includes(20)) { if (user.statusbar.d2sbuninst) { addTweak('20_date2status-u.txt') addTweakDir('date-to-statusbar_mod', false) @@ -548,28 +552,22 @@ function buildTweak(user) { if (user.uistyle.uninst) { addTweak('20_uistyle-u.txt') - } else if (user.mainOps.indexOf(9) !== -1) { + } else if (user.mainOps.includes(9)) { addTweak('20_uistyle-i.txt') } if (user.uistyle.uninstmain) { addTweak('20_mainmenu-u.txt') - } else if (user.mainOps.indexOf(8) !== -1) { + } else if (user.mainOps.includes(8)) { addTweak('20_mainmenu-i.txt') addTweakDir('MainMenuTweaks', true) } - if (user.options.indexOf(16) !== -1) { - var outStr = fs.createWriteStream(`${tmpdir}/config/blank-album-art-frame/jci/gui/common/images/no_artwork_icon.png`) - var inStr = fs.createReadStream(`${varDir}/no_artwork_icon.png`) - outStr.on('close', function() { - aioLog('Blank Album Art Copy Successful!') - }) - inStr.pipe(outStr) + if (user.options.includes(16)) { addTweak('16_blnkframe-i.txt') } // Off Screen Background - if (user.mainOps.indexOf(10) !== -1 || user.mainOps.indexOf(110) !== -1) { + if (user.mainOps.includes(10) || user.mainOps.includes(110)) { var inStrOff - if (user.mainOps.indexOf(10) !== -1) { + if (user.mainOps.includes(10)) { inStrOff = fs.createReadStream(`${varDir}/OffScreenBackground.png`) addTweak('00_offbackground-i.txt') } else { @@ -583,10 +581,9 @@ function buildTweak(user) { inStrOff.pipe(outOff) } // Add chosen background - if (user.mainOps.indexOf(2) !== -1) { - if (user.mainOps.indexOf(6) !== -1) { + if (user.mainOps.includes(2)) { + if (user.mainOps.includes(6)) { addTweak('00_bgrotator-i.txt') - addTweakDir('BackgroundRotator', true) } var inStrbg = fs.createReadStream(`${varDir}/background.png`) var out = fs.createWriteStream(`${tmpdir}/config/background.png`, { flags: 'w' }) @@ -596,19 +593,20 @@ function buildTweak(user) { inStrbg.pipe(out) addTweak('00_background.txt') } - if (user.mainOps.indexOf(5) !== -1) { + if (user.mainOps.includes(5)) { addTweak('00_sd-cid.txt') addTweakDir('get_sd_cid', true) } - if (user.options.indexOf(19) !== -1 || user.options.indexOf(17) !== -1 || user.options.indexOf(25) !== -1 || user.options.indexOf(27) !== -1 || user.options.indexOf(28) !== -1 || user.options.indexOf(119) !== -1 || user.options.indexOf(117) !== -1 || user.options.indexOf(125) !== -1 || user.options.indexOf(127) !== -1 || user.options.indexOf(128) !== -1) { + if (user.options.includes(19) || user.options.includes(17) || user.options.includes(25) || user.options.includes(27) || user.options.includes(28) || user.options.includes(119) || user.options.includes(117) || user.options.includes(125) || user.options.includes(127) || user.options.includes(128)) { addTweakDir('bin', true) - if (user.options.indexOf(19) !== -1 || user.options.indexOf(17) !== -1 || user.options.indexOf(25) !== -1 || user.options.indexOf(27) !== -1 || user.options.indexOf(28) !== -1) { + if (user.options.includes(19) || user.options.includes(17) || user.options.includes(25) || user.options.includes(27) || user.options.includes(28)) { addTweakDir('jci', true) + addTweak('00_59patch.txt') } } // Swapfile tweak has to be last because the final operation // in the script is to remove all of the other tweak files - if (user.options.indexOf(18) !== -1) { + if (user.options.includes(18)) { copySwapfile = true if (user.swapOps.mount) { swapdest = '/config/swapfile/' @@ -737,16 +735,11 @@ function writeSpeedoConfigFile(user) { function tweakVariables(user) { - var bak = `KEEPBKUPS=` - bak += (user.backups.org) ? `1\n` : `0\n` - bak += `TESTBKUPS=` - bak += (user.backups.test) ? `1\n` : `0\n` - bak += `SKIPCONFIRM=` - bak += (user.backups.skipconfirm) ? `1\n` : `0\n` - bak += `ZIPBACKUP=` - bak += (user.zipbackup) ? `1\n` : `0\n` - bak += `FORCESSH=` - bak += (user.forcessh) ? `1\n` : `0\n` + var bak = `KEEPBKUPS=` + (user.backups.org ? `1\n` : `0\n`) + bak += `TESTBKUPS=` + (user.backups.test ? `1\n` : `0\n`) + bak += `SKIPCONFIRM=` + (user.backups.skipconfirm ? `1\n` : `0\n`) + bak += (user.mainOps.includes(1) ? `ZIPBACKUP=` + (user.zipbackup ? `1\n` : `0\n`) : '') + bak += (user.mainOps.includes(4) ? `FORCESSH=` + (user.forcessh ? `1\n` : `0\n`) : '') fs.writeFileSync(`${varDir}/backups.txt`, bak) tweaks2write.push(`${varDir}/backups.txt`) @@ -757,63 +750,81 @@ function tweakVariables(user) { tweaks2write.push(`${varDir}/restore.txt`) } - - if (user.mainOps.indexOf(6) !== -1) { + if (user.mainOps.includes(6)) { tweaks2write.push(`${varDir}/bg-rotator.txt`) } - if (user.mainOps.indexOf(3) !== -1) { - if (user.colors === 0) { - themeColor = 'Red' - } else if (user.colors === 1) { - themeColor = 'Blue' - } else if (user.colors === 2) { - themeColor = 'Green' - } else if (user.colors === 3) { - themeColor = 'Silver' - } else if (user.colors === 4) { - themeColor = 'Pink' - } else if (user.colors === 5) { - themeColor = 'Purple' - } else if (user.colors === 6) { - themeColor = 'Orange' - } else if (user.colors === 7) { - themeColor = 'Yellow' - } else if (user.colors === 8) { - themeColor = 'SmoothRed' - } else if (user.colors === 9) { - themeColor = 'SmoothAzure' - } else if (user.colors === 10) { - themeColor = 'SmoothViolet' - } else if (user.colors === 11) { - themeColor = 'CarOS' - } else if (user.colors === 12) { - themeColor = 'StormTroopers' - } else if (user.colors === 13) { - themeColor = 'Poker' - } else if (user.colors === 14) { - themeColor = 'Mazda' - } else if (user.colors === 15) { - themeColor = 'Floating' - } else if (user.colors === 16) { - themeColor = 'X-Men' - } else if (user.colors === 17) { - themeColor = 'Custom' - } else { - themeColor = 'Red' + if (user.mainOps.includes(3)) { + switch (user.colors) { + case 0: + themeColor = 'Red' + break + case 1: + themeColor = 'Blue' + break + case 2: + themeColor = 'Green' + break + case 3: + themeColor = 'Silver' + break + case 4: + themeColor = 'Pink' + break + case 5: + themeColor = 'Purple' + break + case 6: + themeColor = 'Orange' + break + case 7: + themeColor = 'Yellow' + break + case 8: + themeColor = 'SmoothRed' + break + case 9: + themeColor = 'SmoothAzure' + break + case 10: + themeColor = 'SmoothViolet' + break + case 11: + themeColor = 'CarOS' + break + case 12: + themeColor = 'StormTroopers' + break + case 13: + themeColor = 'Poker' + break + case 14: + themeColor = 'Mazda' + break + case 15: + themeColor = 'Floating' + break + case 16: + themeColor = 'X-Men' + break + case 17: + themeColor = 'Custom' + break + default: + themeColor = 'Red' } } - if (user.options.indexOf(13) !== -1) { + if (user.options.includes(13)) { var bootAnimations = `BOOTLOGO1=${user.boot.logo1}\n` bootAnimations += `BOOTLOGO2=${user.boot.logo2}\n` bootAnimations += `BOOTLOGO3=${user.boot.logo3}\n` fs.writeFileSync(`${varDir}/bootlogo.txt`, bootAnimations) tweaks2write.push(`${varDir}/bootlogo.txt`) } - if (user.mainOps.indexOf(3) !== -1) { + if (user.mainOps.includes(3)) { fs.writeFileSync(`${varDir}/color.txt`, `COLORTHEME=${themeColor}\n`) tweaks2write.push(`${varDir}/color.txt`) } - if (user.options.indexOf(1) !== -1) { + if (user.options.includes(1)) { if (user.keepSpeedRestrict) { fs.writeFileSync(`${varDir}/touchscreen.txt`, `KEEP_SPEED_RESTRICT=1\n`) } else { @@ -821,7 +832,7 @@ function tweakVariables(user) { } tweaks2write.push(`${varDir}/touchscreen.txt`) } - if (user.mainOps.indexOf(8) !== -1) { + if (user.mainOps.includes(8)) { var mmenu = `UI_STYLE_ELLIPSE=` mmenu += (user.uistyle.ellipse) ? `1\n` : `0\n` mmenu += `UI_STYLE_MINICOINS=` @@ -836,7 +847,7 @@ function tweakVariables(user) { fs.writeFileSync(`${varDir}/mainmenu.txt`, mmenu) tweaks2write.push(`${varDir}/mainmenu.txt`) } - if (user.mainOps.indexOf(9) !== -1) { + if (user.mainOps.includes(9)) { var ui = `UI_STYLE_BODY=${user.uistyle.body}\n` ui += `UI_STYLE_LIST=${user.uistyle.listitem}\n` ui += `UI_STYLE_DISABLED=${user.uistyle.listitemdisabled}\n` @@ -847,7 +858,7 @@ function tweakVariables(user) { fs.writeFileSync(`${varDir}/uistyle.txt`, ui) tweaks2write.push(`${varDir}/uistyle.txt`) } - if (user.options.indexOf(14) !== -1) { + if (user.options.includes(14)) { var noalbmart = `NOALBM=` noalbmart += (user.uistyle.noalbm) ? `1\n` : `0\n` noalbmart += `FULLTITLES=` @@ -855,7 +866,7 @@ function tweakVariables(user) { fs.writeFileSync(`${varDir}/bgralbmart.txt`, noalbmart) tweaks2write.push(`${varDir}/bgralbmart.txt`) } - if (user.options.indexOf(15) !== -1) { + if (user.options.includes(15)) { var transbg = `NO_BTN_BG=` transbg += (user.uistyle.nobtnbg) ? `1\n` : `0\n` transbg += `NO_NP_BG=` @@ -869,7 +880,7 @@ function tweakVariables(user) { fs.writeFileSync(`${varDir}/removebgs.txt`, transbg) tweaks2write.push(`${varDir}/removebgs.txt`) } - if (user.options.indexOf(20) !== -1) { + if (user.options.includes(20)) { var dateFormat = user.d2sbOps - 1 fs.writeFileSync(`${varDir}/d2sb.txt`, `DATE_FORMAT=${dateFormat}\n`) tweaks2write.push(`${varDir}/d2sb.txt`) @@ -881,7 +892,7 @@ function tweakVariables(user) { fs.writeFileSync(`${varDir}/statusbar-color.txt`, sc) tweaks2write.push(`${varDir}/statusbar-color.txt`) } - if (user.options.indexOf(19) !== -1) { + if (user.options.includes(19)) { var sops = `OPACITY=` sops += (user.speedoOps.bg.id === 30) ? `${user.speedoOps.opac}\n` : `0\n` sops += `SPEEDCOLOR=` @@ -892,6 +903,8 @@ function tweakVariables(user) { sops += (user.spdExtra.hideSpeedBar) ? `1\n` : `0\n` sops += `SPD_COUNTER=` sops += (user.spdExtra.speedAnimation) ? `1\n` : `0\n` + sops += `HIDE_SPEEDO_SBN=` + sops += (user.spdExtra.hidespeedosbn) ? `1\n` : `0\n` sops += `SPD_XTRA_FUEL_SUFF=${user.spdExtra.fuelGaugeValueSuffix}\n` sops += `SPD_XTRA_FUEL_FACT=${user.spdExtra.fuelGaugeFactor}\n` sops += (user.speedoOps.sbmain !== undefined) ? `SBMAIN=${user.speedoOps.sbmain}\n` : `\n` @@ -909,7 +922,7 @@ function tweakVariables(user) { tweaks2write.push(`${varDir}/bgopacity.txt`) } - if (user.options.indexOf(26) !== -1) { + if (user.options.includes(26)) { fs.writeFileSync(`${varDir}/gracenote.txt`, `GRACENOTE="${user.gracenoteText}"`) tweaks2write.push(`${varDir}/gracenote.txt`) } @@ -921,15 +934,12 @@ function convert2LF() { if (err) { aioLog(err, 'LF Convert Error') } else if (endingType === 'NA') { - aioLog(`EOL => ${endingType} (Format should be: LF)`) + aioLog(`LF Convert Error`, `EOL => ${endingType} (Format should be: LF)`) } else if (endingType === 'LF') { aioLog(`EOL => ${endingType}`) - } else if (endingType === 'CRLF') { - aioLog(`EOL => ${endingType}`) } else { - aioLog(`EOL FORMAT ${endingType} (Format should be: LF)`) + aioLog(`LF Convert Error`, `EOL => ${endingType} (Format should be: LF)`) } - // if (err) aioLog(err,'LF Convert Error')throw err ********************** // Rename tweaks.txt to tweaks.sh fs.renameSync(`${tmpdir}/tweaks.txt`, `${tmpdir}/tweaks.sh`) aioLog('Writing Tweaks.sh') @@ -949,6 +959,7 @@ function addTweakDir(twk, inst) { var twkdir = '/config/' if (!inst) { twkdir = '/config_org/' + mkdirp.sync(`${tmpdir}/config_org/`) } try { if (!fs.existsSync(`${tmpdir}${twkdir}${twk}`)) { @@ -1157,7 +1168,7 @@ function usbDrives() { message: `
${e.toString()}

Build has completed successfully

Although USB drives cannot be found because of an error.
${langObj.popupMsgs[9].msg}
${tmpdir}
${langObj.popupMsgs[10].msg}.
`, callback: function() { bootbox.hideAll() - finishedMessage() + unzipSwapfile(null) } }) appendAIOlog(e) @@ -1181,7 +1192,7 @@ function copyToUSB(mp) { className: 'copyingtoUSB', closeButton: false }) - if(!keeplog){ + if (!keeplog) { mp = `${mp}/XX` mkdirp.sync(mp) } @@ -1317,7 +1328,7 @@ function cleanCopyDir() { rimraf(`${tmpdir}`, function() { appendAIOlog(`
  • Deleted '_copy_to_usb' Folder
  • `) }) } -function casdkAppOptions(apps) { +function casdkAppOptions(apps, inst) { var casdkapps = `APPSIMPLEDASHBOARD=` casdkapps += (apps.simpledashboard) ? `1\n` : `0\n` casdkapps += `APPGPSSPEED=` @@ -1338,26 +1349,63 @@ function casdkAppOptions(apps) { casdkapps += (apps.breakout) ? `1\n` : `0\n` casdkapps += `APPSNAKE=` casdkapps += (apps.snake) ? `1\n` : `0\n` + casdkapps += `APPCLOCK=` + casdkapps += (apps.clock) ? `1\n` : `0\n` + casdkapps += `APPSIMPLESPEEDO=` + casdkapps += (apps.simplespeedo) ? `1\n` : `0\n` casdkapps += `CASDK_SD=` casdkapps += (apps.sdcard) ? `1\n` : `0\n` + if (inst) { + addCASDKapp(apps.simpledashboard, "simpledashboard") + addCASDKapp(apps.gpsspeed, "gpsspeed") + addCASDKapp(apps.multidash, "multidash") + addCASDKapp(apps.vdd, "vdd") + addCASDKapp(apps.devtools, "devtools") + addCASDKapp(apps.terminal, "terminal") + addCASDKapp(apps.background, "background") + addCASDKapp(apps.tetris, "tetris") + addCASDKapp(apps.breakout, "breakout") + addCASDKapp(apps.snake, "snake") + addCASDKapp(apps.clock, "clock") + addCASDKapp(apps.simplespeedo, "simplespeedo") + } fs.writeFileSync(`${varDir}/casdkapps.txt`, casdkapps) tweaks2write.push(`${varDir}/casdkapps.txt`) } +function addCASDKapp(add, app) { + if (add) { + copydir(`${builddir}casdk/apps/app.${app}`, `${tmpdir}/casdk/apps/app.${app}`, function(err) { + if (err) { + aioLog(`File Copy Error: ${err}`, err.message) + return + } + aioLog(`Files for CASDK copied successfully!`) + }) + } +} + function buildCASDK(user, apps) { addRootFiles() + casdkAppOptions(apps, user.casdk.inst) if (user.casdk.inst) { - casdkAppOptions(apps) mkdirp.sync(`${tmpdir}/casdk/`) - tweaks2write.push(`${builddir}00__casdk-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 { - fs.writeFileSync(`${varDir}/casdkreg.txt`, `sed -i "s/'eu'/'na'/g" /jci/gui/apps/custom/runtime/runtime.js && log_message "=== Region Changed to NA ==="`) + if (!user.casdkAppsOnly) { + tweaks2write.push(`${builddir}00__casdk-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 { + fs.writeFileSync(`${varDir}/casdkreg.txt`, `sed -i "s/'eu'/'na'/g" /jci/gui/apps/custom/runtime/runtime.js && log_message "=== Region Changed to NA ==="`) + } + tweaks2write.push(`${varDir}/casdkreg.txt`) } - tweaks2write.push(`${varDir}/casdkreg.txt`) tweaks2write.push(`${builddir}00__casdkapps-i.txt`) - copydir(`${builddir}casdk`, `${tmpdir}/casdk`, function(err) { + copydir(`${builddir}casdk`, `${tmpdir}/casdk`, function(stat, filepath, filename) { + if (filepath.includes(`apps`)) { + return false + } + return true; + }, function(err) { if (err) { aioLog(`File Copy Error: ${err}`, err.message) return @@ -1365,7 +1413,7 @@ function buildCASDK(user, apps) { aioLog(`Files for CASDK copied successfully!`) }) } else if (user.casdk.uninst) { - tweaks2write.push(`${builddir}00__casdk-u.txt`) + tweaks2write.push(user.casdkAppsOnly ? `${builddir}00__casdkapps-u.txt` : `${builddir}00__casdk-u.txt`) } else { errFlag = true finishedMessage() diff --git a/app/assets/js/ex-links.js b/app/assets/js/ex-links.js index 18351aa..83ace9b 100644 --- a/app/assets/js/ex-links.js +++ b/app/assets/js/ex-links.js @@ -1,4 +1,4 @@ -// Open all external links outside the app +// Open all external links *with class="link"* outside the app // Credit: Electron API Demos app const links = document.querySelectorAll('a.link') diff --git a/app/assets/js/gritter-conf.js b/app/assets/js/gritter-conf.js index 46690aa..91730de 100644 --- a/app/assets/js/gritter-conf.js +++ b/app/assets/js/gritter-conf.js @@ -1,6 +1,6 @@ -var Gritter = function () { +var Gritter = function() { - $('#add-sticky').click(function () { + $('#add-sticky').click(function() { var unique_id = $.gritter.add({ // (string | mandatory) the heading of the notification @@ -33,7 +33,7 @@ var Gritter = function () { }); - $('#add-regular').click(function () { + $('#add-regular').click(function() { $.gritter.add({ // (string | mandatory) the heading of the notification @@ -52,7 +52,7 @@ var Gritter = function () { }); - $('#add-max').click(function () { + $('#add-max').click(function() { $.gritter.add({ // (string | mandatory) the heading of the notification @@ -64,7 +64,7 @@ var Gritter = function () { // (bool | optional) if you want it to fade out on its own or just sit there sticky: false, // (function) before the gritter notice is opened - before_open: function () { + before_open: function() { if ($('.gritter-item-wrapper').length == 3) { // Returning false prevents a new gritter from opening return false; @@ -76,7 +76,7 @@ var Gritter = function () { }); - $('#add-without-image').click(function () { + $('#add-without-image').click(function() { $.gritter.add({ // (string | mandatory) the heading of the notification @@ -88,7 +88,7 @@ var Gritter = function () { return false; }); - $('#add-gritter-light').click(function () { + $('#add-gritter-light').click(function() { $.gritter.add({ // (string | mandatory) the heading of the notification @@ -101,7 +101,7 @@ var Gritter = function () { return false; }); - $("#remove-all").click(function () { + $("#remove-all").click(function() { $.gritter.removeAll(); return false; diff --git a/app/assets/js/index.js b/app/assets/js/index.js index fe49fbc..4deec24 100644 --- a/app/assets/js/index.js +++ b/app/assets/js/index.js @@ -13,6 +13,7 @@ /* jshint esversion:6, -W033 */ const { electron, nativeImage, remote, clipboard, shell } = require('electron') const { app, BrowserWindow } = remote +const _ = require('lodash') const fs = require('fs') const ipc = require('electron').ipcRenderer const Config = require('electron-store') @@ -31,9 +32,9 @@ 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 +var translateSchema, langPath, lang, langDefault var tempDir = `${app.getPath('userData')}/background` -var date = function () { return new Date() } +var date = function() { return new Date() } // require('./lib/log')('MZD-AIO-LOG') // var output = process.stdout // var errorOutput = process.stderr @@ -45,12 +46,16 @@ console.log("speedcamfiles: "+hasSpeedCamFiles) */ lang = persistantData.get('lang') || 'english' if (window.location.pathname.includes('joiner')) { langPath = `../lang/${lang}.aio.json` + langDefault = '../lang/english.aio.json' translateSchema = require('../lang/aio.schema.json') } else { - translateSchema = require('./lang/aio.schema.json') langPath = `${app.getPath('home')}/lang/${lang}.aio.json` + langDefault = `${app.getPath('home')}/lang/english.aio.json` + translateSchema = require(`${app.getPath('home')}/lang/aio.schema.json`) } var langObj = require(langPath) +var langDef = require(langDefault) +langObj = _.merge(langDef, langObj) /* IDEA FOR AIO BG PICKER var bg-images = [] fs.readdir('./background-images/', (err, files) => { @@ -58,11 +63,21 @@ files.forEach(file => { console.log(file) bg-images.push('') }) -}) */ -function getBackground () { +}) +const testFolder = './background-images/'; +var bgpics = []; +fs.readdir(testFolder, (err, files) => { + files.forEach(file => { + bgpics.push('') + console.log(file); + }); +}) +*/ +function getBackground() { return `${tempDir}/background.png` } -function saveMenuLock () { + +function saveMenuLock() { persistantData.set('menuLock', !persistantData.get('menuLock')) $('body, .hideNav, .w3-overlay').toggleClass('showNav') } @@ -75,6 +90,10 @@ function helpMessageFreeze(item) { $(item).children().toggleClass('w3-show') } + +function runInstallCSApp() { + require('./assets/js/installCS.js')() +} /* Clock for Background preview */ function startTime() { var today = new Date() @@ -92,9 +111,7 @@ function checkTime(i) { if (i < 10) { i = '0' + i } // add zero in front of numbers < 10 return i } -/* function createImageWindow() { -var imageWindow = windowManager.open('imageWindow')// , 'Drag & Drop Background Image', '/views/imageWindow.html','imageWindow') -} */ + ipc.on('open-copy-folder', () => { openCopyFolder() }) @@ -122,29 +139,30 @@ 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 autoHelp() { + $.featherlight('views/autoHelp.htm', { closeSpeed: 500, variant: 'autoHelpBox' }) } -function myStance () { - ipc.send('reset-window-size') - $.featherlight('views/stance.htm',{closeSpeed:2000,variant:'myStance',afterClose:updateNotesCallback}) +function myStance() { + //updateNotesCallback() + //ipc.send('reset-window-size') + $.featherlight('views/stance.htm', { closeSpeed: 2000, variant: 'myStance', afterClose: updateNotesCallback }) } function announcement() { var anoncmntNum = localStorage.getItem('anoncmnt') } -function showAnnouncement () { +function showAnnouncement() { $.featherlight('https://aio.trevelopment.com/aio.php',{closeSpeed:1000,variant:'announcementWindow'}) -} -function hideAnnouncement (anonNum) { + } +function hideAnnouncement(anonNum) { $('.communicationFile').hide() $.featherlight.close() localStorage.setItem('anoncmnt', anonNum) } -function anonData (anonNum) { +function anonData(anonNum) { localStorage.setItem('anondat', anonNum) } -function updateNotes () { - $.get('views/update.htm', function (data) { $('#changelog').html(data) }) +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: `

    `, @@ -159,10 +177,10 @@ function updateNotes () { } function firstTimeVisit() { - if (!persistantData.has('updateVer') || persistantData.get('updateVer') < 279) { + if (!persistantData.has('updateVer') || persistantData.get('updateVer') < 280) { myStance() settings.set('reset', true) - persistantData.set('updateVer', 279) + persistantData.set('updateVer', 280) persistantData.set('updated', false) persistantData.delete('ver270') persistantData.delete('message-502') @@ -192,17 +210,17 @@ function updateNotesCallback() { $('body').prepend('
    ') var firstTimeMessage = bootbox.dialog({ title: `
    Welcome To MZD-AIO-TI v${app.getVersion()} | MZD All In One Tweaks Installer
    `, - message: `

    Welcome to the AIO!

    All changes happen at your own risk! Please understand that you can damage or brick your infotainment system running these tweaks! If you are careful, follow all instructions carefully, and heed all warnings, the chances of damaging your system are greatly reduced.
    For more help, open the Help Panel or visit MazdaTweaks.com

    I appreciate feedback
    use the feedback link below to let me know what you think.

    Take The Tour

    ***NOTE FOR FIRMWARE V59.00.502+*** CAN ONLY INSTALL TWEAKS AFTER GAINING ACCESS VIA SERIAL CONNECTION . THEN YOU WILL NEED TO INSTALL THE AUTORUN & RECOVERY SCRIPTS AFTER GAINING SERIAL ACCESS.


    ...
    `, + message: `

    Welcome to the AIO!

    All changes happen at your own risk! Please understand that you can damage or brick your infotainment system running these tweaks! If you are careful, follow all instructions carefully, and heed all warnings, the chances of damaging your system are greatly reduced.
    For more help, open the Help Panel or visit MazdaTweaks.com

    I appreciate feedback
    use the feedback link below to let me know what you think.

    Take The Tour

    ***NOTE: FOR FIRMWARE V59.00.502+*** CAN ONLY INSTALL TWEAKS AFTER GAINING ACCESS VIA SERIAL CONNECTION . THEN YOU WILL NEED TO INSTALL THE AUTORUN & RECOVERY SCRIPTS AFTER GAINING SERIAL ACCESS.


    ...
    `, closeButton: false, className: "first-time-dialog" }) - setTimeout(function () { $('#super-overlay').remove() }, 3000) - setTimeout(function () { + setTimeout(function() { $('#super-overlay').remove() }, 3000) + setTimeout(function() { $('#first-time-msg-btn').html(`
    `) $('#newVerBtn').fadeIn(10000) - }, 20000) + }, 5000) } - dataCheck() + } var helpClick = false @@ -248,7 +266,7 @@ function dropDownMenu(id) { x.className = x.className.replace(' w3-show', '') } y.on({ - mouseleave: function () { + mouseleave: function() { y.toggleClass('w3-show') } }) @@ -349,7 +367,8 @@ function secretMenu() {
    - + +