commit ec30353eace2d7bb9a4a08344f7ec3ec0c1bdf0e Author: Christopher Roy Bratusek Date: Tue Jan 23 21:11:52 2018 +0100 Initial commit diff --git a/ChangeLog.md b/ChangeLog.md new file mode 100644 index 00000000..3e6d519a --- /dev/null +++ b/ChangeLog.md @@ -0,0 +1,1239 @@ +# ChangeLog + +## 16.0 in-dev +* Important Notes + * this release changes the name from 'NanoMod' to 'NanoDroid' + * the module IDs will change as follows + * NanoMod NanoDroid + * NanoModmicroG NanoDroid_microG + * NanoModfdroid NanoDroid_FDroid + * the nanomod-overlay script is now nanodroid-overlay + * the novl shortcut is unchanged + * the installers will take care of getting rid of the old modules +* Bug Fixes: + * nanodroid-overlay script + * fix `-p`, `--permission` switch not working in System Mode + * Full, microG package + * fix Google Sync Adapters installation + * microG package + * fix aapt not installed +* General Changes: + * Common Installer + * take care of getting rid of old-named module upon installation + * generalize function showing the NanoDroid banner + * minor code revision + * Full, microG, F-Droid packages + * move banner displaying into Common Installer + * update Magisk module.props for name change + * improve Magisk module.props description + * more simplification + * Configuration Files + * the installers will auto-rename configuration files if necessary + * .nanomod-setup .nanodroid-setup + * .nanomod-apps .nanodroid-apps + * .nanomod-overlay .nanodroid-overlay + * the installers will migrate the variable names to the new ones if necessary + * Uninstaller + * support all installations (NanoMod <15.0, NanoMod <16.0 and NanoDroid) + * minor code revision + +## 15.1.20180119 +* Bug Fixes: + * Patcher package, addon.d + * fix architecture detection + * mount /system read-write if required + * Uninstaller + * fix restoring Settings.apk backup (if any) +* General Changes: + * Full, microG, F-Droid packages + * split out common installer functions (~ 95 %) into separate file + * Common installer + * contains most installer functions (~ 95 %) + * code revision to do most stuff with least calls + * support all Full, microG, F-Droid packages without code duplications + * Full package + * provide custom OpenLauncher build from latest sources + * Uninstaller + * support both old (<15.0) and new (>=15.0) system mode installations + * only mount /system read-write if a system mode installation exists + * revise and simplify the code +* Updates (automatic): + * nlpBackendDéjàVu (1.0.8) + * (Simple) Gallery (3.2.3) + * NewPipe (0.11.4) + * Odyssey (0.1.11) + * (Simple) Calendar (3.1.0) +* Updates (manual): + * MPV (20180118) + * OpenLauncher (20180118) + +## 15.0.20180113 + +* Important Notes: + * if using as a Magisk Module the minimum required Magisk version is now 15.0 +* General Changes + * Full package + * custom MPV build from latest upstream source + * Full, microG packages + * add Déjà Vu unified location provider backend + * custom FakeStore build featuring CHECK_LICENSE permission + * install SDK 26 (8.0) Google Sync Adapters on SDK 27 (8.1), if requested + * Full, microG, F-Droid packages + * installation routines completely rewritten + * installer now enforces apk and directory name to be equal + * uninstaller information is now created in /data/adb/.nanomod-patcher + * uninstaller information is removed prior installation and then re-created during + * patcher now creates it's lockfile in /data/adb/.nanomod-patcher + * update to new Magisk paths introduced in 15.0 + * create better error messages + * several other internal changes + * save TWRP log in /data/adb/.recovery_MODID + * where MODID is either NanoMod, NanoModmicroG or NanoModfdroid + * save additional log data in /data/adb/.nanomod_MODID + * where MODID is either NanoMod, NanoModmicroG or NanoModfdroid + * prevent Full and submodules installed at the same time (obviously redundant) + * Full package will remove microG and F-Droid packages, if found + * microG or F-Droid packages will abort installation if Full package is found + * microG and F-Droid packages can still be installed together + * Patcher package (on-device), addon.d + * remove restriction for SDK 27 (Android 8.1) + * don't apply UI patch for sigspoof on SDK 25 or newer + * was SDK 26 or newer previously + * add back explicit, improved odex check (for more meaningful error message) + * install addon.d into /data/adb/nanomod_patcher + * create patcher file as /data/adb/.nanomod-patcher + * addon.d removes /data/adb/.nanomod-patcher prior patching and re-creates it upon success + * /system only mounted with read access + * update to new Magisk paths introduced in 15.0 + * several other internal changes + * SetupWizard + * update string to reflect that Sigspoof UI is SDK <25 only + * add option `nanomod_nlpbackend`, choose microG location backend + * 0 = no location backend + * 1 = Déjà Vu location backend + * 2 = Ichnaea (Mozilla) location backend + * 3 = Déjà Vu and Ichnaea location backends + * nanomod-setup configuration file + * add option `nanomod_nlpbackend`, choose microG location backend + * 0 = no location backend + * 1 = Déjà Vu location backend + * 2 = Ichnaea (Mozilla) location backend + * 3 = Déjà Vu and Ichnaea location backends + * Patcher script (on-pc) + * remove restriction fro SDK 27 (Android 8.1) + * don't apply UI patch on SDK > 25 + * already the case for Patcher package and addon.d + * support both old and new Magisk paths + * nanomod-overlay script + * don't create system.prop if not actually required + * update to new Magisk paths introduced in 15.0 + * Uninstaller package + * update for latest changes + * supports both old and new Magisk image paths + * mount-magisk script + * support both old and new Magisk paths + * build-package script + * check for dependencies prior to downloading +* Updates [automatic] + * NewPipe (0.11.3) + * (Simple) Calendar (3.0.1) + * (Simple) Gallery (3.0.2) + * Termux (0.59) + * Yalp Store (0.32) + * nlpBackendIchnaea (1.3.3) + * nlpBackendDejavu (1.0.7) + * Open Camera (1.42.1) + * Odyssey (1.1.10) + * Twidere (3.7.2) + * Substratum (931) + * microG GmsCore (0.2.4-108) + * Orbot (16.0.0-RC2) +* Updates [manual] + * FakeStore (0.0.2+CHECK_LICENSE) + * MPV (20180103) + +## 14.9.20171213 + +* Updates + * microG GmsCore (0.2.4-107) + * OpenKeychain (4.8.1) + * (Simple) Gallery (2.19.0) + * OpenLauncher (0.5.8alpha) + * Termux (0.56) + * Yalp Store (0.31) + * BeHe Keyboard (1.1.0) + * (Simple) Calendar (2.12.0) + * F-Droid (1.1-alpha0) + * KeePassDroid (2.2.0.9) + +## 14.8.20171130 +* General Changes + * Full package + * use official build for Kernel Adiutor + * Framework-Patcher package, addon.d + * update `dexpatcher` to 1.6.0 + * collect additional information from `dexpatcher` for debugging purposes + * nanomod-overlay/novl Script: + * check if running as root, if not exit +* Updates + * KeePassDroid (2.2.0.8) + * Kernel Adiutor (0.9.73.3) + * Odyssey (1.1.8) + * OpenCamera (1.42) + * GNU Nano (2.9.1) + +## 14.7.20171115 +* Bug Fixes + * Full, microG packages + * fix GNU Bash startup configuration + * fix GNU Bash wrapper script + * Full package + * fix GNU Nano wrapper script + * build-package script + * fix downloading Substratum from APK Mirror +* General Changes + * nanomod-overlay script + * be more robust against wrong or incomplete user input + * Full package + * use official GitHub pre/build for Twidere + * use official GitHub pre/build for KeePassDroid +* Updates + * Orbot (15.5.1-RC2) + * K9-Mail (5.304) + * Twidere (3.7.3) + * (Simple) Calendar (2.9.2) + * (Simple) Gallery (2.17.3) + * NewPipe (0.11.0) + * Odyssey (1.1.7) + * Substratum (914) + * KeePassDroid (2.2.0.1) + * Yalp Store (0.29) + +## 14.6.20171031 +* General Changes + * Full, microG packages: + * switch to official microG GmsCore build, modifying Play Store alone is enough for (in-)app purchases to work + * remove unused variables and aliases from Bash configuration file + * make bash, nano, less wrappers not throw a message if `resize` command is not available + * in case your OS does not have a `resize` command, install osm0sis' Busybox + * nano, less wrappers only set TERMINFO if it actually exists + * add crDroidFilemanager to list of apps pseudo-debloated by default + * crDroidFilemanger = Amaze + * add crDroidMusic to list of apps pseudo-debloated by default + * if `com.qualcomm.location` is found, only add it to the list of pseudo-debloated applications, if it isn't already + * Full package: + * some ROMs call Adaway AdAway instead (not the capital A) + * let the installer handle that case, so the user does not get a double-installation of Adaway + * if an application provided by NanoMod is already part of the ROM don't install it + * nanomod-overlay Script: + * added `-f`, `--fix-update` parameter, fixes navbar, lockscreen, statusbar issues after OTA update + * see: https://www.xda-developers.com/broken-navigation-bar-lock-screen-ota-update/ + * added `-P`, `--airplane-mode` parameter, allows to choose which radios are disabled in Airplane Mode + * those will not be activatable, until Airplane Mode is deactivated + * user is given instructions when this parameter is called + * added `-b`, `--boot-count` parameter, show how often the device was booted + * required Android 7.0 or newer + * added `-F`, `--audio-focus` parameter, prevent given application from stealing audio focus + * pass application name as parameter, example: `novl -F com.test.application` + * added `-B`, `--read-clipboard` parameter, prevent given application from reading the clipboard + * pass application name as parameter, example: `novl -B com.test.application` + * `-b|B|f|F|P` paramters are available in both Magisk and System Mode +* Updates (automatic) + * OpenCamera (1.41.1) + * (Simple) Calendar (2.9.1) + * F-Droid (1.0.1) + * NewPipe (0.10.1) + * (Simple) Gallery (2.17.2) + * Orbot (15.5.0.RC1) + * Termux (0.54) + +## 14.5.20171022 +* General Changes + * Full, microG packages: + * make `sed` shut up when `nanomod-overlay -[A|C|L|R]` is called for the first time + * add `novl` script as shortcut for `nanomod-overlay` script + * Full package: + * switch from APK Mirror build to F-Droid build for Kernel Adiutor + * Full, microG, F-Droid, Uninstaller, Framework-Patcher package, Framework-Patcher addon.d, force-debloat script, nanomod-overlay script + * no longer support `/persist` as location for configuration files +* Updates (manual) + * Play Store (8.3.43.U) +* Updates (automatic) + * (Simple) Calendar (2.8.2) + * F-Droid (1.0) + * Twidere (3.7.1) + * Yalp Store (0.28) + +## 14.4.20171014 +* Bug Fixes + * Full, microG packages: + * fix patched `services.jar` backup and restore upon update (if any) +* General Changes + * Framework patcher package, addon.d: + * don't patch `Settings.apk` on Oreo (regardless of user's choice) + * update patches to latest versions + * update `dexpatcher` to version 1.5.0 + * Full package: + * switch from F-Droid build to Pre-Release build for K-9 Mail +* Updates (manual) + * Play Store (8.3.42.U) +* Updates (automatic) + * (Simple) Calendar (2.8.1) + * Twidere (3.7.0) + * F-Droid (1.0-alpha5) + * (Simle) Gallery (2.15.2) + * Yalp Store (0.27) + * Kernel Adiutor (0.9.73.1) + * K-9 Mail (5.300) + +## 14.3.20171005 +* Bug Fixes + * Framework-patcher addon.d: + * prefer TWRP binaries over system binaries + * nanomod-overlay Script: + * fix `-A` and `-R` parameters +* General Changes + * build-package Script: + * code consolidation and simplification + * Full, microG packages: + * Google Sync Adapters for Oreo are now pulled from OpenGApps + * Framework-patcher addon.d: + * display version number +* Updates (manual) + * Play Store (8.3.41.U) +* Updates (automatic) + * F-Droid (1.0-alpha4) + * (Simple) Gallery (2.15.1) + * Face Slim (3.2.1) + * OpenKeychain (4.7) + * (Simple) Calendar (2.7.6) + * OpenLauncher (0.5.5) + * Substratum (854) + +## 14.2.20170925 +* Bug Fixes + * Framework-Patcher addon.d: + * Fix error when trying to mount magisk.img + * Use /dev/tmp for custom dalvik-cache to ensure it works in all cases +* General Changes + * Framework-Patcher package, addon.d: + * drop odex check (dexpatcher fails on odexed ROMs anyway) + * drop separate dalvik-cache creation (decreases required time) + * apply patches in parallel (majorly decreases required time) + * no longer support `nanomod_forcesystem` setting + * other minor internal improvements + * Update dexpatcher to 1.4.0 +* Updates (manual) + * Play Store (8.2.55.T) + * built with Apktool 2.3.1 for full Oreo/InstantApps support +* Updates (automatic) + * Substratum (853) + * New Pipe (0.10.0) + * (Simple) Gallery (2.14.4) + * Yalp Store (0.26) + * F-Droid Privileged Extension (0.2.7) + +## 14.1.20170923 +* Bug Fixes + * Framework-Patcher package, addon.d: + * Fix installation into `/system` +* General Changes + * nanmod-overlay Script: + * add `-C, --cast` parameter, fixes cast not working on some custom ROMs + * uses Magisk to enable `persist.debug.wfd.enable` both on-the-fly and permanently + * on-the-fly setting may not work, in that case, simply reboot + * add `-A, --add-prop` parameter, add system property + * both on-the-fly and permanently + * add `-R, --remove-prop` parameter, remove a property previously added through `-A, --add-prop` + * requires reboot to take effect + * add `-L, --list-props` parameter, list alls properties added through `-A, --add-prop` + * Full, microG packages: + * backup and restore `system.prop` generated by `nanomod-overlay`, if any, during update + * Full package: + * remove `permissions` init script +* Updates (manual) + * Play Store (8.2.40.T) +* Updates (automatic) + * MPV (2017-09-20) + +## 14.0a.20170918 +* Bug Fixes + * Framework-Patcher package, addon.d: + * fix installation path detection + * force-delobat script: + * syntax and bug fixes + +## 14.0.20170916 +* Bug Fixes + * Full, microG packages: + * install DroidGuard Helper as user app (fixes it crashing) + * `com.qualcomm.location` conflicts with microG location backends, so when installing microG + * in Magisk Mode pseudo-debloat `com.qualcomm.location` (if it exists) + * in System Mode move `com.qualcomm.location` (if it exists) to /sdcard + * Full, microG, F-Droid packages: + * fix that under certain circumstances installation errors don't cause the installer to abort + * fix that arm libraries are not properly installed on arm64 devices + * affects applications that have arm libraries, but not arm64 (namely: Play Store) + * fix that x86 libraries are not properly installed on x86_64 devices + * affects applications that have x86 libraries, but not x86_64 (namely: Play Store) + * on x86 / x86_64 try to extract arm libraries, if no x86 / x86_64 libraries are found + * fix that the installer doesn't clean up if installation of libraries fails in Magisk Mode + * more verbose recovery.log regarding library installation + * fix useless recovery.log messages on post-KitKat ROMs + * Update Magisk functions to Module Template 1400 + * Update Magisk Module template versions to 1400 + * remove TMPDIR after installation + * Full package: + * when `.nanomod-apps` contains an application that is not included don't abort + * instead just print a message + * Framework-Patcher package: + * actually patch SecSettings.apk + * fix backing up SecSettings.apk to /sdcard in System Mode + * F-Droid package: + * fix SDK version detection +* General Changes + * Full, microG, F-Droid packages: + * minor internal improvements + * Full package: + * switch to official F-Droid build for Lightning browser + * update Magisk Manager module description + * SetupWizard: + * updated + * Uninstaller: + * if `com.qualcomm.location` was backed up to /scard, restore it + * restore `SecSettings.apk` or `SecSettings2.apk` if it was backed up to /sdcard + * Framework-Patcher package: + * support patching of `SecSettings2.apk` for optional UI patch, aswell + * big internal code consolidation + * build-package Script: + * Fix repo index.xml downloading + * force-debloat Script: + * support `.nanomod-overlay` configuration file + * uses fallback values, if none found, which are in the script itself and can be edited + * no longer abort when Magisk is installed + * suggest the user to pseudo-debloat instead when Magisk is installed + * change the way Magisk is detected + * add the ability to only test what would be done + * other minor internal changes + * Documentation: + * updated +* Updates (manual) + * Play Store (8.2.37.T) +* Updates (automatic) + * F-Droid (1.0-alpha3) + * F-Droid Privileged Extension (0.2.6) + * (Simple) Gallery (2.14.2) + * (Simple) Calendar (2.7.5) + * Substratum (842) + * XDA Labs (1.1.3.3b) + * Yalp Store (0.25) + * Twidere (3.6.29) +* Removed Applications + * Hacker Keyboard +* New Applications + * BeHe Keyboard + +## 13.3.20170910 +* Bug Fixes + * Full, microG, F-Droid packages: + * `magisk.img` is not always created by Magisk 14.0 + * change the way Magisk is detected + * create `magisk.img` if required +* General Changes + * build-package Script + * check SHA256 hash of apks downloaded from + * F-Droid + * microG repository + * APK Mirror + * other internal improvements +* Updates (manual) + * Play Store (8.2.36.T) + * microG GmsCore (0.2.4-105) +* Updates (automatic) + * (Simple) Calendar (2.7.4) + * F-Droid (1.0-alpha2) + +## 13.2a.20170906 +* Bug Fixes + * Full, microG packages: + * Fix bootloop with Magisk 13.5 / 13.6 / 14.0 + +## 13.2.20170906 +* Bug Fixes + * Framework-Patcher package, Framework-Patcher addon.d: + * include 32 bit paths in `${LD_LIBRARY_PATH}` on 64 bit devices + * revert back to own magisk.img handling functions + * other minor fixes +* General Changes + * Framework-Patcher package, Framework-Patcher addon.d, + * Framework-Patcher Script: + * Nougat patches also work on Oreo, remove restriction for SDK 26 + * Full, microG packages: + * add Oreo Google Sync Adapters (from O DP4) + * Full, microG, F-Droid packages: + * remove most apks from GitLab repository + * instead use `build-package pull` to download latest apks automatically + * a few apks are still in the repo as `build-package` can't (yet) grab them automatically + * a few apks are still in the repo as they are self-built or modified + * thanks to shadow53's `android-zip-builder` [> GitLab](https://gitlab.com/Shadow53/android-zip-builder) + * `build-package` Script + * `build-package` now prefers configuration files from `repo/data` over `repo/doc` during package creation + * `.nanomod-setup` + * `.nanomod-apps` + * `.nanomod-overlay` + * `build-package` now has new switches: + * `build-package pull` to download all required apks for Full, microG and F-Droid package + * `build-package u-microg` to update microG + * `build-package u-fdroid` to update F-Droid + * `build-package u-apps` to update (most) applications + * `build-package u-swipe` to update swipe libraries + * `build-package u-gsync` to update Google Sync Adapters + * `clean` remove any untracked files from the repo (e. g. from `build-package pull`) + * `build-package` script no longer surpresses `zip` error messages + * Documentation: + * updated for recent changes + * minor changes +* Updates + * Yalp Store (0.24) + * Simple Gallery (2.13.4) + * K9-Mail (5.208) + * OpenKeychain (4.6) + * Play Store (8.1.73.S) + * GNU Nano (2.8.7) + +## 13.1.20170829 +* Bug Fixes + * F-Droid package: + * Fix installation issue in `nanomod_libs` + * Full, microG packages: + * Downgrade Google Sync Adapters for LL to 5.0 +* General Changes: + * Framework-Patcher package: + * update `dexpatcher` to 1.3.1 + * remove unused dexpatcher.jar file + * no longer requires booting into ROM before patching + * more reliably catch `dexpatcher` errors + * patching signature spoofing UI now supports + * LineageOS/AOSP Settings.apk + * Samsung TouchWiz SecSettings.apk + * update to use Magisk v13 functions when Magisk is utilized + * do all `dexpatcher` operations in `BASEDIR`, not `TMPDIR` + * clean-up environment before doing anything + * update to new Haystack patches + * addon.d support (auto repatch after ROM update) + * on-pc Framework-Patcher script: + * exit if not in TWRP immediately, not late in process + * add `--gui` parameter to patch Signature Spoofing toggle in UI + * clean-up previously patched files on start (if any) + * build-package: + * add `dalvik` option, prepares a jar file for use with DalvikVM + * Uninstaller: + * also remove Framework-Patcher addon.d upon uninstallation +* Updates + * Play Store (8.1.73.S) + * Substratum (823) + * Amaze (3.2.1) + * Yalp Store (0.23) + * Kernel Adiutor (0.9.72) + * Simple Gallery (2.13.1) + * Lightning (4.5.1+snapshot20170813) + * Open Camera (1.40) + +## 13.0.20170817 +* Bug fixes + * Full, microG, F-Droid, Framework-Patcher packages: + * use `/dev/tmp` instead of `/tmp`, fixes several bugs when installing from Magisk Manager + * Full, microG packages: + * fix back-up and restore of `services.jar` when installing from Magisk Manager + * fix `nanomod_substitute` not creating expected result when installing from Magisk Manager + * fix pseudo-debloat feature not enabled when installing from Magisk Manager + * many fixes in `nanomod-overlay` Script + * call `nanomod-overlay --create` during installation, instead of `nanomod-overlay --update` + * fixed that directory for nlpBackendNominatim was nlpBackendNomiantim + * install binaries in `/system/xbin`, not `/system/bin` + * Full, microG, Framework-Patcher packages: + * fix `/system/.nanomod-patcher` handling when installing from Magisk Manager + * Framework-Patcher package: + * properly install `services.jar` into merge-pending NanoMod Magisk Modules + * don't mount `/system` twice and don't try to unmount it, when installing through Magisk Manager + * Full, microG, F-Droid packages: + * fix that uninstaller information for System Mode is not correctly recorded in all cases + * fix that permissions were not properly set on non-binary files + * F-Droid package: + * when looking for `.nanomod-setup` file `ZIPDIR` has higher priority than `/data` + * Full package: + * fixup init scripts installation +* General Changes: + * Full, microG, F-Droid packages: + * ignore `nanomod_forcesystem` when installing through Magisk Manager + * deeper indent `nanomod_libs` output, makes recovery.log easier to read + * print a warning message on pre-KitKat ROMs that compatibility is not garantueed + * improve and simplify `nanomod_install` and `nanomod_libs` routines + * more detailed and better indented log messages + * add support for KitKat (Android 4.4) + * Full, microG packages: + * update swipe libraries for x86_64 + * provide separate Google Sync Adapters for KK, LL, MM and N, install correct version + * on pre-KitKat ROMs print a message that Google Sync Adapters are not supported + * first print messages then do installation of the given component, not the over way round + * makes it easier to understand the recovery.log + * `nanomod-overlay` has new `-x`, `--create` parameter, to create overlays without removing them before + * Framework-Patcher package: + * check for `.nanomod-setup` and respect `nanomod_forcesystem` setup variable + * add `nanomod_sigspoofui` setup variable + * whether to add toogle to Developer Settings to globally enable or disable signature spoofing + * include vendor libraries in adjusted `LD_LIBRARY_PATH` + * Setup Wizard: + * verbose output during setup file creation + * Uninstaller package: + * [System Mode] remove empty directories from: + * /system/app + * /system/priv-app + * /system/share + * Documentation: + * add various additional links + * fully document `nanomod-overlay` script + * other minor improvements + * build-package: + * `swipe` parameter updates swipe libraries using shadow53's website + * `gsync` parameter updates gsync apks using shadow53's website +* Updates + * Orfox (1.4-RC3) + * Simple Gallery (2.13.0) + * Twidere (3.6.24) + * Yalp Store (0.22) + * Play Store (8.1.29.S) + * Substratum (819) + +## 12.1.20170807 +* Bug Fixes + * Full, microG, F-Droid packages: + * make `nanomod_libs` installer routine actually fail, when an error occurs + * filter out error code 11 (apk does not have libs to install) + * when an error occurs in Magisk Mode installation perform cleanup when `error` is called + * run Magisk's `recovery_cleanup` to ensure TWRP is in usable state (without reboot) + * remove partially installed Magisk Module + * unmount Magisk image + * shrink Magisk image's size + * microG, F-Droid packages: + * fix that `unzip` was not bundled +* General Changes + * Full, microG packages: + * merge all nanomod-overlay sub-scripts into the main script + * SetupWizard: + * print Yet Another Message(tm) that the SetupWizard is *only* the SetupWizard + * on-pc framework-patcher: + * update hook patch name to reflect Haystack update + * if Haystack repo is already downloaded, update it, instead of re-cloning it +* New + * Orbot (15.4.2-RC1) + * Orfox (1.4-RC2) +* Updates + * Anysoft Keyboard (1.8.1333) + * Substratum (815) + * Yalp Store (0.21) + * Odyssey (1.1.6) + * OpenKeychain (4.5) + * Play Store (8.1.25.S) + * GNU Nano (2.8.6) + * Lightning (4.5.1+snapshot20170806) + +## 12.0.20170723 +* Bug Fixes + * Full package: + * fixed that GNU Nano didn't work properly when ther terminal only had a few lines + * microG package: + * fixed that `column` was not bundled + * Full, microG packages: + * fixed that Swipe libraries where not properly installed in Magisk Mode + * fixed that GNU Bash did not read `/etc/bashrc` + * fixed that the fallback `/data/.nanomod-overlay` did not get removed + * further fixes to `nanomod-overlay -g` + * remove `nanomod_reinstall` parameter for `.nanomod-setup` configuration file (Magisk-only) + * `services.jar` will now be auto backed up and restored during NanoMod Magisk Module update when `/system/.nanomod-patcher` exists, print a message to the user accordingly + * `services.jar` will be removed from NanoMod Magisk Module when `/system/.nanomod-patcher` is missing (which indicates ROM update), print a message to the user accordingly + * if `services.jar` is missing but `/system/.nanomod-patcher` exists, assume Magisk was (temporarily) uninstalled, print a message to the user accordingly + * Full, microG, F-Droid packages: + * workaround a rare issue where Magisk's own resize functions fail by manually using `resize2fs` in that case +* General Changes + * Improved Documentation + * Configuration Files: + * `.nanomod-apps` layout simplified, now only one app per line, nothing else + * existing configuration files will be migrated to new format + * `.nanomod-overlay` layout simplified, now only one app per line, nothing else + * existing configuration files will be migrated to new format + * Full package: + * provide more tools from `bsdmainutils` + * col, colcrt, colrm, hexdump, look, ncal + * provide more tools from `util-linux` + * findfs, findmnt, lsblk, lscpu, lsipc, lslocks, lsns, setterm, whereis + * provide `less` pager with `lessecho` and `lesskey` utils + * make `less` the default `PAGER` for GNU Bash + * make default `TERM` for GNU Nano `xterm` + * Setup Wizard: + * AROMA based Setup Wizard to create the configuration files in either + * `/sdcard` + * `/external_sd` + * `/data` (fallback) + * renamed `mod.sh` to `build-package` + * revised code, removed cruft + * add multi-param support, for example `build-package fdroid microg` will create those two package in one go + * renamed `force-debloat.sh` to `force-debloat` + * improved code + * renamed `magisk-mount.sh` to `magisk-mount` + * improved code + * renamed `framework-patcher.sh` to `framework-patcher` + * renamed helper script `remote.sh` to `framework-patcher-remote` + * improved code +* Downgrades + * Google Backup Transport (7.1.1 > 6.0.1) +* Updates + * Substratum (811) + * Amaze (3.1.2-rc4) + * Yalp Store (0.19) + * Simple Gallery (2.12.2) + * OpenVPN (0.6.73) + * NewPipe (0.9.10) + * Lightning (4.5.1+snapshot20170720) + * F-Droid (0.100-alpha1) + * Play Store (8.0.73.R) + +## 11.1.201707714 +* Bug Fixes + * Full, microG, F-Droid packages: + * provide standalone `unzip` binary (resolves installation issues with 11.0) + * Full, microG packages: + * fix `nanomod-overlay -s` not working +* General Changes + * Full, microG, F-Droid packages: + * Magisk Mode installer is now closer to magisk-module-template v4 () + * Full, microG packages: + * provide `column` binary + * let `nanomod-overlay -s` use `column` to prettify the output + * let the user know `nanomod-overlay -s` actually does something as it can be slow on old devices + +## 11.0.20170713 +* Bug Fixes + * uninstaller: + * fixed restoring unpatched `services.jar` + * on-device framework-patcher: + * fixed that it accidently backed up the patched `services.jar` instead of vanilla + * external_sd init script: + * higher compatibility, should now work for most (if not all) devices +* General Changes + * Full, microG, F-Droid package + * if using fallback configuration during installation print the information accordingly + * change syntax for `.nanomod-apps` file + * existing configuration files will be migrated to new format + * change syntax for `.nanomod-setup` file + * existing configuration files will be migrated to new format + * simplify handling fallback configuration + * update module template to something v4-ish, modified to match NanoMod requirements/features + * Full, microG package + * if using fall back `nanomod-overlay` configuration remove it after installation + * the `nanomod-overlay` script will create it during runtime, if required + * remove all launchers from list of pseudo-debloated apps by default + * several fixes to `nanomod-overlay` script + * add optional `Swipe` libraries, controlled by `nanomod_swipe=[0|1]` + * make `/data` the very last directory to look for configuration files + * when patched `services.jar` exists before installing/updating, remove `/system/.nanomod-patcher` +* Updates + * Play Store (8.0.26.R) + * Simple Gallery (2.12.1) + * Simple Calendar (2.5.7) + * Open Camera (1.39) + * New Pipe (0.9.9) + * GNU Nano (2.8.5) + * OpenLauncher (0.5.3) + * Kernel Adiutor (0.9.71.1) + * F-Droid (1.0-alpha0) + * Amaze (3.1.2-beta12) + +## 10.0.20170701 +* Bug Fixes + * Full, microG package + * fixup `nanomod-overlay.genconfig` syntax error + * fixup `nanomod-overlay.permission` not properly working + * install GoogleBackupTransport into `/system/priv-app`, not `/system/app` + * on-device framework-patcher + * stop process if `/system/.nanomod-patcher` file exists + * fixup missing function in on-device framework-patcher + * fixup architecture detection in on-device framework-patcher + * on-pc framework-patcher + * stop process if `/system/.nanomod-patcher` file exists + * force-debloat.sh remove Launchers from list of apps to remove + * PixelLauncher + * NexusLauncher + * Trebuchet + * zipalign microG Gms Core +* General Changes + * Full, microG, F-Droid package + * migrate to shiny new installation mechanism + * improved printed information + * add support to enforce installation in System Mode using `nanomod.forcesystem` setup variable + * on-device framework-patcher + * code improvements + * better error messages when dalvikvm fails + * when installing patched `services.jar` to ROM back it up to `/sdcard` + * print somewhat more useful information + * on-pc framework-patcher + * when installing patched `services.jar` to ROM back it up to `/sdcard` + * uninstaller + * code improvements + * remove `/system/.nanomod-patcher` regardless wether Magisk is installed + * support uninstalling NanoMod when installed in system mode +* Updates + * Simple Calendar (2.5.6) + * Simple Gallery (2.11.4) + * XDA Labs (1.1.2.3) + * MPV (2017-06-25) + * Substratum (803) + * Termux (0.53) + * Anysoft Keyboard (1.8.844) + * OpenLauncher (0.5.2) + * Lightning (4.5.1) + * Yalp Store (0.18) + +## 9.3.20170623 +* Bug Fixes + * Full, F-Droid, microG packages: fix installation in System Mode + * microG package: bundle `aapt` (required for `nanomod-overlay`) +* Installer Changes + * Full package: remove app libraries not required for device architecture + * example: on ARM the libraries for ARM64, x86 and x86_64 are removed + * add `nanomod.gsync=[0|1]` setup variable + * defines whether to install Google Sync Adapters +* General Changes + * x86/x86_64 support (work-in-progress) + * currently working in System Mode, but not as Magisk Module + * add `Jelly` to the list of pseudo-debloated apps by default + * `nanomod-overlay -p` now checks for proper permissions of system apps + * FAKE_PACKAGE_SIGNATURE for microG Gms Core and Play Store + * READ_CALENDAR and WRITE_CALENDAR For Google Calendar Sync + * READ_CONTACT, WRITE_CONTACTS and GET_ACCOUNTS for Google Contacts Sync + * add `permissions` init script that runs `nanomod-overlay -p` + * Full package only + * for microG package manully run `nanomod-overlay -p` as before + * added force-debloat script (for system mode!) + * script that can be run from recovery to debloat the system + * the list of applications resides in the script itself + * the default settings equal to the pseudo-debloat settings of `nanomod-overlay` script + * needs to be run from TWRP, requires explicit user acceptance + * re-signed microG GmsCore and Phonesky with my own key instead of debug key + * microG package: don't install terminfo files as GNU Nano is not included + * on-pc framework-patcher: only do actual work if in TWRP +* Removed Applications + * Magisk Manager (now bundled with Magisk itself +* Replaced Applications + * VLC replaced with MPV +* Added Applications + * OpenWeatherMap Provider (1.0) + * add optional Google Calendar Sync and Google Contacts Sync + * not installed by default + * bundled with Full and microG package +* Updated Applications + * GNU Nano (2.8.2) + * microG Gms Core (0.2.4-103) + * Substratum (782) + * Yalp Store (0.17) + * Simple Calendar (2.5.3) + * Simple Gallery (2.10.10) + * Termux (0.52) + * Twidere (3.6.21) + * Play Store (7.9.80.Q) + * New Pipe (0.9.8) + * Kernel Adiutor (0.9.70.3) + * Yahoo Weather Provider (1.0) + * Lightning (4.5.0~snapshot) + * F-Droid (0.104) + +## 9.2.20170610 +* Internal Changes + * no longer require `Busybox` for `sqlite` init script + * install init scripts in `MODDIR/init.d` when in Magisk Mode + * prevents double execution of init scripts if the ROM already has init.d support + * when in system mode init scripts will be installed to `/system/etc/init.d` as before + * ensure `external_sd` init script is always given executable bit + * All installers: force `magisk.img` resize operations, perform `fsck` afterwards + * Full and microG installers: fix a `sed` substitution + * On-device framework-patcher: fix `magisk.img` resize operations + * make `nanomod-overlay`'s `-p`, `--permission` parameter work when + * installed in system mode + * no `.nanomod-overlay` configuration file was found + * add `-g`, respectively `--genconfig` parameter to `nanomod-overlay` script + * creates `.nanomod-overlay` configuration file in `/data` + * `genconfig` will be automatically run when `nanomod-overlay` is run and NanoMod is installed in Magisk Mode, but no `.nanomod-overlay` configuration file exists + * rewrite most parts of the `nanomod-overlay` script + * modularize the `nanomod-overlay` script + * rewrite most parts of the documentation + +## 9.1.20170607 +* Internal Changes + * move init script execution from `post-fs-data` to `late-start` + * run init scripts in parallel instead one by one + * fixup init scripts possibly not finding `Busybox` when installed as Magisk Module + * as a side-effect Magisk Log is now properly recorded and no longer imcomplete + * save init scripts logs in `/magisk/NanoMod/.logs/${script}.log.${curdate}` + * `curdate` is the time `services.sh` is run by Magisk in `YYYYMMDD-HH.MM.SS` format + * add `external_sd` init script which will symlink your external SD Card's mount directory to `/external_sd` + * known path from TWRP, makes it easier to `adb push` files to the SD Card + * SD Card needs to be inserted upon boot, else `/external_sd` won't be created + * it might take up to 30 seconds after boot up until `/external_sd` becomes available + * make `logscleaner` init script less aggressive + * let `sqlite` init script first check whether `sqlite3` is available + * make `nanomod-overlay` script use `grep` and `sed` instead of `awk` + * makes `nanomod-overlay` script work in case `Busybox` is not installed + * add `nanomod.init` setup variable to make it possible to not install the init scripts + * fixed that `nanomod-overlay` had `--permission` parameter documented, but was expecting `--permissions` + * the full and microG package installers now set the path for `GNU Bash` in `nanomod-overlay` script + * fixes the issue that `nanomd-overlay` script does not work when installed in system mode +* Updates + * F-Droid (0.103.2) + * VLC (2.1.10~beta) + * Simple Gallery (2.10.8) + * Play Store (7.9.30.Q) + * XDA Labs (1.1.2.2b) + * Twidere (3.6.16) + * Open Camera (1.38.2) + +## 9.0.20170528 +* Internal Changes + * shiny new installer + * cleaner and easier maintainable code + * several improvements to `/system` mode installation + * for microG, F-Droid and full packages + * fix **GNU Bash** installation in microG package + * drop Launchers from list of pseudo-debloated applications in microG package + * disable pseudo-debloat feature in the microG package by default + * NanoMod installers for full and microG package support configuration files located in the same directory as the zip, make the `nanomod-overlay` script remember that path + * also fixes bug that `nanomod-overlay` does not work outside of the installer + * better error message in `nanomod-overlay` script if configuration file does not exist + * install Maps API version 1 by default + * add an **uninstaller** zip which will uninstall any NanoMod Magisk Module + * checks for all three (full, F-Droid and microG) packages and removes them if found + * does not work for system mode installation (and there won't be an uninstaller for that) +* Updates + * Simple Calendar (2.5.1) + * Simple Gallery (2.10.6) + * NewPipe (0.9.7) + * Nominatim Nlp Backend (1.2.2) + * Termux (0.50) + * PlayStore (7.8.74.P) + * VLC (2.1.8~beta) + * Yalp Store (0.15) + * Twidere (3.6.15) + * OpenLauncher (0.5.1) + * Open Camera (1.38.1) + +## 8.0.20170521 +* Internal Changes + * if `Magisk` is not installed, the installer will install everything into `/system` directly + * provide broken-out libraries for all provided applications + * fixes issues with them, for example `Magisk Manager` not being able to install zips + * fix `nanomod-overlay` script to support all `.nanomod-overlay` configuration file locations + * fix `nanomod-overlay` script not properly working with **NanoMod-microG** module + * the on-device and on-pc framework patchers now create the file `/system/.nanomod-patcher` after successful patching + * can be used to check whether the patcher was already run or not + * **NanoMod-microG** now also includes `GNU Bash` + * fix `VLC` directory not matching apk file name + * fix `VLC` getting installed, even if user requested not to do so + * update default `.nanomod-overlay` to pseudo-debloat the following apps + * Pixel Launcher + * Via Browser + * Phonograph (Music Player) + * Sound Recorder (additional overlay path) +* Updates + * Substratum (760) + * OpenLauncher (0.5.0) + * NewPipe (0.9.6) + * Twidere (3.6.14) + * Kernel Adiutor (0.9.7.2) + * F-Droid Privileged Extension (0.2.5) + * Yalp Store (0.14) + * This release allows installation of applications without having to enable `Unknown Sources` + * go to Yalp Store > Settings > Installation Method > `Using system permissions` + * (Simple) Calendar (2.3.4) + * Open Camera (1.38) + * OpenVPN (0.6.66) + * (Simple) Gallery (2.9.1) + * Termux (0.49) + * microG DroidGuard Helper (0.1.0-10) + * VLC (2.1.7~beta) + * Odyssey (1.1.5) + +## 7.2.20170508 +* Internal Changes + * full package: replace `spaces` with `underscores` in Zelda ringtone names + * full package: minor fix in installer + * framework-patcher package: grow and shrink `magisk.img` if required + * fixes issue where patched `services.jar` could not be installed, because not enough space was left in `magisk.img` + * framework-patcher package: show error message to user if `/system` fails to re-mount read-write + * framework-patcher package: unmount `/system` and `/data` after work is done + * framework-patcher package: less verbose output from `dexpatcher` and `zip` + * framework-patcher package: note the user to post `/tmp/recovery.log` if something fails + * framework-patcher package: use static `zip` binary, fixes possbile `zip` failure older ROMs + * framework-patcher package: change the way `LD_LIBRARY_PATH` is determined + * framework-patcher package: check if ROM is `odexed` and exit if so + * framework-patcher package: code clean-up + * framework-patcher script: grow and shrink `magisk.img` if required + * fixes issue where patched `services.jar` could not be installed, because not enough space was left in `magisk.img` + * framework-patcher script: fix installation path for patched `services.jar` when NanoMod is not installed +* Updates: + * GNU Bash (4.4[012]) + * Substratum (721) + * OpenKeyChain (4.4.1) + * OpenLauncher (0.3.2.1) + * Twidere (3.5.36) + * F-Droid (0.103) + * Play Store (7.7.40.N) + * Kernel Adiutor (0.9.7.1beta) + +## 7.1.20170501 +* Internal Changes + * full and microG package: the `.nanomod-overlay` , `.nanomod-apps` and `.nanomod-setup` configuration files can now be stored in the following directories + * `/data` (default) + * `/sdcard` (internal storage) + * `/persist` + * `/external_sd` (special path in TWRP for external SD-Card if not used as adoptable storage) + * directory containing the zip file + * full package: init scripts no longer remount rootfs (not required) + * full package: installer now makes init scripts actually executable + * framework-patcher package: fix detection of device architecture +* Updates + * Twidere (3.5.33) + * (Simple) Calendar (2.3.4) + * OpenKeyChain (4.3) + * Substratum (706) + * (Simple) Gallery (2.9.0) + * NewPipe (0.9.4) + * Amaze (3.1.2~RC3) + * microG GmsCore (0.2.4-92) + * Magisk Manager (4.3.3) + +## 7.0.20140725 +* Internal Changes + * some ROMs don't have a `zip` binary which is required for the on-device `framework-patcher` to work + * it now provides arm and arm64 `zip` binaries as fallback + * all packages: let the installers fails if device has x86/x86_64 architecture (NanoMod only supports arm/arm64) + * full and microG-only packages: if the installers create default configuration files because no user-defined exist, those files get removed after installation + * this is to ensure the users who don't care about them always get the default configuration + * obvioulsy, if you opt-in to create your own setup, it won't be affected by this + * full and microG-only package: if the setup file is incomplete, add the missing properties with default values + * microG-only package: set default value of `nanomod.overlay` to `0` + * microG-only package: create the application overrides if `nanomod.overlay` is `1` +* Fixes + * fix regression from 6.1 which prevented (in-)app-purchases + * fix the microG only package by default installs no app store + * now defaults to Play Store +* Updates + * GNU Nano (2.8.1) + * GNU Bash (4.4) + * F-Droid (0.103-alpha3) + * F-Droid Privileged Extension (0.2.4) + * NewPipe (0.9.3) + * Twidere (3.5.25) + * Substratum (703) + * VLC (2.1.6~beta) +* New + * Application + * (Simple) Calendar (2.3.3) + * Override + * Calendar + +## 6.1.20170421 +* Internal Changes + * minor fix in `mod.sh` + * minor improvements to README + * minor improvements in `mount-magisk.sh` + * make on-pc `framework-patcher` auto-detect install path for modified `services.jar` + * like on-device framework-patcher it supports installing `services.jar` to + * NanoMod (full) + * NanoMod (microG) + * ROM (directly to /system) + * add support for `nanomod-apps` configuration file to let the user control what apps to provide when `nanomod.apps=1` is set (default) + * refer to the README for more details + * fix provided `microG GmsCore` not being installable as user-app +* Updates + * (Simple) Gallery (2.8.6) + * OpenLauncher (0.3.1) + * Play Store (7.7.31.O) + * VLC (2.1.5~beta) + * Substratum (672) + * XDA Labs (1.1.1.1) + +## 6.0.20170418 +* Internal Changes + * there's now an F-Droid only variant + * there's now an on-device framework-patcher + * Note: it is suggested to boot into the ROM once, else the dalvik-cache might not exist (or is not up-to-date in case of incremental ROM update) and the patching process takes ages or fails + * ensure all binaries installed by NanoMod (full package) are executable + * minor fix in `nanomod-overlay` script + * added `fdroid` parameter to `mod.sh`, to create the F-Droid only package from git + * added `patcher` parameter to `mod.sh`, to create the on-device framework-patcher package from git + * revised `mod.sh` (cleaner code) + * revised `mod.sh` (should now be fully functional on Mac OSX) + * added `nanomod.mapsv1` setup variable to `nanomod-setup` configuration file + * the location of the `.nanomod-setup` file was changed from `/data/media/0/.nanomod-setup` to `/data/.nanomod-setup` + * if the old file is found, the installer will move it to the new location + * this is in order to ensure the file is usable when users have adoptable storage in use + * the location of the `.nanomod-overlay` file was changed from `/data/media/0/.nanomod-overlay` to `/data/.nanomod-overlay` + * if the old file is found, the installer will move it to the new location + * this is in order to ensure the file is usable when users have adoptable storage in use + * also install the `nanomod-overlay` script in the microG only package + * so that `nanomod-overlay -p` is available + * revised README in many places + * README now features many graphical links for most things featured in full package, pointing to F-Droid pages, github repos, or the-like, to make it much easier to get additional information +* Updates + * F-Droid (0.103.alpha2) + * AnySoftKeyboard (1.8.735) + * NewPipe (0.9.2) + * Play Store (7.7.17.O) + * Amaze (3.1.2~beta10) + * Substratum (671) + * Twidere (3.5.18) + * K9-Mail (5.207) + * (Simple) Gallery (2.8.4) + +## 5.2.20170413 +* Internal Changes + * no longer copy DroidGuard.apk to /sdcard + * add `nanomod.fdroid` setup variable defines whether to install F-Droid or not + * add `-p`, respectively `--permission` parameter to `nanomod-overlay`, which will grant fakesign permission to microG GmsCore and Play Store, aswell as ignore battery optimization permission to microG GmsCore + * `framework-patcher.sh` revised to support Mac OSX thanks to @victor141516 +* Updates: + * F-Droid Privileged Extension (0.2.3) + * Yalp Store (0.13) + * Substratum (632) + +## 5.1.20170408 +* Internal Changes + * only copy DroidGuard.apk to /sdcard if `nanomod.microg` is `1` in `nanomod-setup` configuration file + * add new option `nanomod.zelda` to `nanomod-setup` configuration file, allows to control whether to install or not install Zelda ringtones and sounds + * `nanomod.play=0` now actually works and does not install any app store +* Variants + * full package: microG, F-Droid & apps, pseudo-debloat feature, Zelda ringtones & sounds, GNU Bash, GNU Nano, aapt utility + * microG package: microG only + * `framework-patcher.sh` updated to support both modules +* Removed files / features + * Effect_Tick Zelda sound + * I admit, that one was too annoying + * Magisk installation + * unsu Script + * Read: NanoMod is now only the Module, no longer includes Magisk itself +* nanomod-overlay Script Changes + * parameter `-l`, respectively `--list` now has properly formatted output + * parameter `-r`, respectively `--remove` now only removed exact matches from config file + * parameter `-a`, respectively `--add` now properly formats config file + * new parameter `-s`, respectively `--show` which shows all non pseudo-debloated system applications + * new paramter `-d`, respectively `--delete` which will remove all overrides and thus re-enable all applications, unlike `-r` / `--remove` this will not change the config file, so you can re-debloat using `-u` / `--update` again +* Updates + * Play Store (7.7.09.O) + * VLC (2.1.4~beta) + * GNU Nano (2.7.5) + * Substratum (631) +* Added applications + * F-Droid Privileged Extension (0.2.2) + * allows installation of apps using F-Droid without enabling 'Unknown Sources' in the security settings of your device + +## 5.0.20170405 +* Internal Changes + * NanoMod is now (mostly) an Magisk Module + * referrenced to as "Overlay" + * Nano-Init merged into NanoMod Overlay + * AROMA installer removed + * the list of applications to override is now in the file `.nanomod-overlay` in the internal data storage. See the README for more information. + * you can alter the setup process to some degree by editing the file `.nanomod-setup` in the internal data storage. See the file README for more information. + * Updated `framework-patcher.sh` to install files modified by haystack directly into the NanoMod Overlay + * `framework-patcher.sh` needs to be re-run everytime you install NanoMod + * it's suggested to re-run `framework-patcher.sh` on every ROM update, too, so that you get to patch your ROMs current framework files + * microG GmsCore and Play Store are modified to allow in-app purchases +* Updates + * Kernel Adiutor (0.9.6.11) + * microG GmsCore (0.24-81) + * Substratum (627) + * Twidere (3.4.48) + * Magisk Manager (4.3.1) + * VLC (2.1.3~beta) + * Amaze (3.1.2~rc1) + * Play Store (7.7.08.O) + * NewPipe (0.9.0) + * F-Droid (0.103-alpha1) +* Replaced Applications + * LeafPic => (Simple) Gallery [2.8.0] + * (Simple) Gallery allows changing the wallpaper (unlike LeafPic) +* Removed Magisk Modules + * Nano-Miitomo (ro.debuggable is now disabled by Magisk by default) + * Nano-Init (merged in the Overlay) +* New Applications + * OpenLauncher [alpha3] + +## 4.1.20170321 +* Updates + * AnySoft Keyboard (1.8.585) + * VLC (2.1.2~beta) + * Magisk (11.6) + * MagiskManager (4.2.7) + * microG GmsCore (0.24-79) + * F-Droid (0.102.2) + * K9-Mail (5.206) + * Odyssey (1.1.4) + * Substratum (604) + * PlayStore (7.6.08.N) + * Termux (0.48) + * Kernel Adiutor (0.9.6.7) + * NewPipe (0.8.12) + * Nano-init (4) + * let's several more Samsung devices pass SafetyNet (though, not all) + * Twidere (3.4.39) +* Added applications + * OpenKeyChain (4.2.4) + * YalpStore (0.11) + * FakeStore (0.0.2) +* Other Changes + * unsu.sh: only re-flash boot image backup if it is a SuperSU backup + * installer: let the user choose whether to install microG with official PlayStore or with unofficial YalpStore + * When YalpStore is installed, also install FakeStore, so that apps that expect PlayStore still work. This also ensures SafetyNet responses work as they should. + * installer: when installing PlayStore, remove FakeStore and YalpStore, or remove PlayStore, before installing YalpStore, makes it much more easy to try out both variants without having to manually remove system apps or re-flashing ROM + +## 4.0.20170223 +* Updates + * update Nominatim Nlp Backend (1.2.1) + * update microG (0.2.4-76) + * update Twidere (3.4.29) + * update Face Slim (3.1.0) + * update NewPipe (0.8.10) + * update Open Camera (1.37) + * update Lightning (4.4.2) + * update Magisk (12~beta.20170218) + * update MagiskManager (4.2.6) +* Added applications + * AnySoftKeyboard (1.8.503) + * KeePassDroid (2.0.6.4) + * OpenVPN (0.6.64) +* Other Changes + * non-debug build for microG GsfProxy + * Remove Nano-Selinux-Senforce Magisk Module + * some ROMs have AdAway pre-installed, remove that version if NanoMod provided version is choosen to be installed + * include customized version of osm0sis' unSU script to fully remove any existing root + * re-flashes boot image backup in case system less SuperUser was installed + * only unSU if Magisk is to be installed + * drop option to remove Nexus Launcher + +## 3.1.20170207 +* Updates + * update NewPipe (0.8.9) + * update Twidere (3.4.26) + * update PlayStore (7.5.08.M) + * update Magisk (11.1) + * update Magisk Manager (4.1) +* Fixes + * fix permissions for GNU Bash installation + * fix permissions for GNU Nano installation +* Other Changes + * Remove SuperUser application (now handled by Magisk Manager) + * Don't install Nano-Selinux-Enforce Magisk Module by default (Magisk 11 features an pseudo-enforcing Selinux Mode) +* Notes: + * If updating from 3.0 remove the SuperUser app from /system/app/SuperUser before the first boot after flashing 3.1, as Magisk Manager does the SuperUser handling now + +## 3.0.20170204 +* initial AROMA release diff --git a/F-Droid/META-INF/com/google/android/update-binary b/F-Droid/META-INF/com/google/android/update-binary new file mode 100644 index 00000000..018c9f07 --- /dev/null +++ b/F-Droid/META-INF/com/google/android/update-binary @@ -0,0 +1,32 @@ +#!/sbin/sh + +umask 022 +OUTFD=${2} +ZIP=${3} + +ZIPDIR=$(dirname "${ZIP}") +MODID=NanoDroid_FDroid + +unzip -o "${ZIP}" nanodroid-functions -d "/tmp" || \ + error " !! failed to load Common Installer" +source "/tmp/nanodroid-functions" || \ + error " !! failed to load Common Installer" + +detect_bootmode +detect_outfd + +show_banner + +check_system +unpack_zip +detect_arch + +get_cfg_setup + +detect_mode + +install_fdroid + +nanodroid_finalize + +exit 0 diff --git a/F-Droid/META-INF/com/google/android/updater-script b/F-Droid/META-INF/com/google/android/updater-script new file mode 100644 index 00000000..11d5c96e --- /dev/null +++ b/F-Droid/META-INF/com/google/android/updater-script @@ -0,0 +1 @@ +#MAGISK diff --git a/F-Droid/module.prop b/F-Droid/module.prop new file mode 100644 index 00000000..334fb033 --- /dev/null +++ b/F-Droid/module.prop @@ -0,0 +1,7 @@ +id=NanoDroid_FDroid +name=NanoDroid (F-Droid sub module) +version=v15.90.99999999 +versionCode=32 +author=Nanolx +description=NanoDroid (F-Droid sub module) for LineageOS/AOSP based ROMs +minMagisk=1500 diff --git a/Full/META-INF/com/google/android/update-binary b/Full/META-INF/com/google/android/update-binary new file mode 100644 index 00000000..a4ad6853 --- /dev/null +++ b/Full/META-INF/com/google/android/update-binary @@ -0,0 +1,47 @@ +#!/sbin/sh + +umask 022 +OUTFD=${2} +ZIP=${3} + +ZIPDIR=$(dirname "${ZIP}") +MODID=NanoDroid + +unzip -o "${ZIP}" nanodroid-functions -d "/tmp" || \ + error " !! failed to load Common Installer" +source "/tmp/nanodroid-functions" || \ + error " !! failed to load Common Installer" + +detect_bootmode +detect_outfd + +show_banner + +check_system +unpack_zip + +detect_arch + +get_cfg_setup +get_cfg_apps +get_cfg_overlay + +detect_mode + +install_microg +install_mapsv1 +install_gsync +install_fdroid +install_store +install_apps +install_zelda +install_initd +install_swipe +install_bash +install_nano +install_novl +install_shell_utils + +nanodroid_finalize + +exit 0 diff --git a/Full/META-INF/com/google/android/updater-script b/Full/META-INF/com/google/android/updater-script new file mode 100644 index 00000000..11d5c96e --- /dev/null +++ b/Full/META-INF/com/google/android/updater-script @@ -0,0 +1 @@ +#MAGISK diff --git a/Full/common/service.sh b/Full/common/service.sh new file mode 100644 index 00000000..41f0cd22 --- /dev/null +++ b/Full/common/service.sh @@ -0,0 +1,19 @@ +#!/system/bin/sh +# Please don't hardcode /magisk/modname/... ; instead, please use $MODDIR/... +# This will make your scripts compatible even if Magisk change its mount point in the future +MODDIR=${0%/*} + +# Create private Log directory +LOGDIR="${MODDIR}"/.logs + +[[ ! -d ${LOGDIR} ]] && mkdir "${LOGDIR}" + +# Set current date in 20170607-12.07.25 format +CURDATE=$(date +%Y%m%d-%I.%M.%S) + +# This script will be executed in late_start service mode +# More info in the main Magisk thread +for init in fstrim logscleaner sqlite external_sd permissions; do + "${MODDIR}/init.d/${init}" | \ + tee -a "${LOGDIR}/${init}.log.${CURDATE}" & +done diff --git a/Full/gsync/etc/permissions/contacts-calendar-sync.xml b/Full/gsync/etc/permissions/contacts-calendar-sync.xml new file mode 100644 index 00000000..3b5a9795 --- /dev/null +++ b/Full/gsync/etc/permissions/contacts-calendar-sync.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Full/module.prop b/Full/module.prop new file mode 100644 index 00000000..3b0ea131 --- /dev/null +++ b/Full/module.prop @@ -0,0 +1,7 @@ +id=NanoDroid +name=NanoDroid +version=v15.90.99999999 +versionCode=34 +author=Nanolx +description=NanoDroid: microG, FOSS apps, pseudo-debloat, Zelda ringtones, Shell utilities and more. +minMagisk=1500 diff --git a/Full/nanodroid-functions b/Full/nanodroid-functions new file mode 100644 index 00000000..e3cd8d95 --- /dev/null +++ b/Full/nanodroid-functions @@ -0,0 +1,1027 @@ +#!/sbin/sh + +VERSION=15.90.99999999 + +########################################################################################## +# Misc. Functions +########################################################################################## + +detect_bootmode () { + ps | grep zygote | grep -v grep >/dev/null && BOOTMODE=true || BOOTMODE=false + ${BOOTMODE} || ps -A 2>/dev/null | grep zygote | grep -v grep >/dev/null && BOOTMODE=true +} + +ui_print() { + if ${BOOTMODE}; then + echo "${@}" + else + echo -n -e "ui_print ${@}\n" >> /proc/self/fd/$OUTFD + echo -n -e "ui_print\n" >> /proc/self/fd/$OUTFD + fi +} + +grep_prop() { + REGEX="${1}" + shift + [ -z "${@}" ] && FILES='/system/build.prop' + cat "${@}" 2>/dev/null | \ + sed -n "s/^${REGEX}=//p" | \ + head -n 1 +} + +is_mounted() { + if [ ! -z "$2" ]; then + cat /proc/mounts | grep ${1} | grep ${2}, >/dev/null + else cat /proc/mounts | grep ${1} >/dev/null + fi + return $? +} + +set_perm() { + chown ${2}:${3} ${1} || error " !! failed change owner for ${1}" + chmod ${4} ${1} || error " !! failed to change mode for ${1}" + if [ ! -z "${5}" ]; then + chcon ${5} ${1} 2>/dev/null + else chcon 'u:object_r:system_file:s0' ${1} 2>/dev/null + fi +} + +set_perm_recursive() { + find ${1} -type d 2>/dev/null | while read dir; do + set_perm ${dir} ${2} ${3} ${4} ${6} + done + find ${1} -type f 2>/dev/null | while read file; do + set_perm ${file} ${2} ${3} ${5} ${6} + done +} + +set_perm_data () { + if [ "${1}" = "-r" ]; then + echo " perm: data [recursive] {${2}}" + set_perm_recursive ${2} 0 0 0755 0644 + else + echo " perm: data [single] {${1}}" + set_perm ${1} 0 0 0644 + fi +} + +set_perm_bin () { + if [ "${1}" = "-r" ]; then + echo " perm: exec [recursive] {${2}}" + set_perm_recursive ${2} 0 0 0755 0755 + else + echo " perm: exec [single] {${1}}" + set_perm ${1} 0 0 0755 + fi +} + +detect_outfd () { + readlink /proc/$$/fd/${OUTFD} 2>/dev/null | grep /tmp >/dev/null + if [ "$?" -eq "0" ]; then + OUTFD=0 + + for FD in `ls /proc/$$/fd`; do + readlink /proc/$$/fd/${FD} 2>/dev/null | grep pipe >/dev/null + if [ "$?" -eq "0" ]; then + ps | grep " 3 ${FD} " | grep -v grep >/dev/null + if [ "$?" -eq "0" ]; then + OUTFD=${FD} + break + fi + fi + done + fi +} + +show_banner () { + ui_print " " + ui_print "*****************************" + ui_print " NanoDroid ${VERSION} " + ui_print " created by Nanolx " + case ${MODID} in + NanoDroid_microG ) + ui_print " microG package " + ;; + NanoDroid_FDroid ) + ui_print " F-Droid package " + ;; + esac + ui_print "*****************************" + ui_print " " +} + +check_system () { + is_mounted /system || mount -o ro /system 2>/dev/null + is_mounted /data || mount /data 2>/dev/null + + [ ! -f '/system/build.prop' ] && \ + error " !! /system/build.prop does not exist" +} + +error () { + ui_print " !!" + ui_print "${@}" + ui_print " !!" + + if [ "${MODE}" = "MAGISK" ]; then + rm -rf "${MODPATH}" + magisk_install_cleanup + fi + + nanodroid_storelogs + + exit 1 +} + +detect_mode () { + case "${nanodroid_forcesystem}" in + 0 ) + if [ -f /data/adb/magisk/magisk ]; then + MODE=MAGISK + MODE_TEXT=" > Mode | Magisk | detected" + else + MODE=SYSTEM + MODE_TEXT=" > Mode | System | detected" + fi + ;; + + 1 ) + if ! ${BOOTMODE}; then + MODE=SYSTEM + MODE_TEXT=" > Mode | System | forced" + else + MODE=MAGISK + MODE_TEXT=" > Mode | Magisk | forced" + fi + ;; + esac + + ui_print "${MODE_TEXT}" + ui_print " " + + if [ "${MODE}" = "MAGISK" ]; then + magisk_install_setup + case ${MODID} in + NanoDroid | NanoDroid_microG ) + magisk_install_preinst + ;; + esac + else + mount -orw,remount /system 2>/dev/null || \ + error " !! failed to re-mount /system read-write" + unset MODPATH + fi +} + +backup_nlpconflicts () { + if [ -d "/system/priv-app/com.qualcomm.location" -a "${nanodroid_microg}" -eq 1 ]; then + mv /system/priv-app/com.qualcomm.location /sdcard/ + + ui_print " " + ui_print " ++ Moving com.qualcomm.location to /sdcard" + ui_print " ++ it conflicts with microG location backends" + ui_print " " + fi +} + +unpack_zip () { + TMPDIR=/dev/tmp + TMP_LIBDIR=${TMPDIR}/nanodroid-lib + INSTALLER=${TMPDIR}/install + + rm -rf ${INSTALLER} + mkdir -p ${INSTALLER} || error " !! failed to prepare environment!" + + ui_print " > prepare installation" + unzip -o "${ZIP}" -d "${INSTALLER}" || \ + error " !! failed to prepare environment!" + chmod +x "${INSTALLER}/system/xbin/unzip.${BIN_ARCH}" +} + +nanodroid_finalize () { + if [ "${MODE}" = "MAGISK" ]; then + magisk_install_finish + else + case ${MODID} in + NanoDroid | NanoDroid_microG ) + backup_nlpconflicts + ;; + esac + fi + + nanodroid_storelogs + + rm -rf ${INSTALLER} + + if [ "${MODE}" = "MAGISK" ]; then + magisk_install_cleanup + elif ! ${BOOTMODE}; then + umount /system 2>/dev/null + fi + + ui_print " " + ui_print " Thanks for using NanoDroid " + ui_print " " +} + +########################################################################################## +# Architecture detection +########################################################################################## + +detect_arch () { + SDK_VERSION=$(grep_prop ro.build.version.sdk) + + ABI=$(grep_prop ro.product.cpu.abi | cut -c-3) + ABI2=$(grep_prop ro.product.cpu.abi2 | cut -c-3) + ABILONG=$(grep_prop ro.product.cpu.abi) + + ARCH=arm + + [ "$ABI" = "x86" ] && ARCH=x86 + [ "$ABI2" = "x86" ] && ARCH=x86 + [ "$ABILONG" = "arm64-v8a" ] && ARCH=arm64 + [ "$ABILONG" = "x86_64" ] && ARCH=x64 + + case ${ARCH} in + arm ) BIN_ARCH="arm" + LIB_ARCHES="armeabi-v7a armeabi" + SWIPE_LIBDIR=lib ;; + arm64 ) BIN_ARCH="arm" + LIB_ARCHES="arm64-v8a armeabi-v7a armeabi" + SWIPE_LIBDIR=lib64 ;; + x86 ) BIN_ARCH="x86" + LIB_ARCHES="x86 armeabi-v7a armeabi" + SWIPE_LIBDIR=lib ;; + x86_64 ) BIN_ARCH="x86" + LIB_ARCHES="x86_64 x86 armeabi-v7a armeabi" + SWIPE_LIBDIR=lib64 ;; + esac + + case ${SDK_VERSION} in + 19 ) GSYNC_VER=K ;; + 21 | 22 ) GSYNC_VER=L ;; + 23 ) GSYNC_VER=M ;; + 24 | 25 ) GSYNC_VER=N ;; + 26 | 27 ) GSYNC_VER=O ;; + * ) GSYNC_UNSUPPORTED=1 ;; + esac + + if [[ "${SDK_VERSION}" -lt 21 ]]; then + UNFOLD_APP_DIR=1 + else UNFOLD_APP_DIR=0 + fi + + if [[ "${SDK_VERSION}" -lt 19 ]]; then + ui_print " " + ui_print " ++ Installing on pre-KitKat ROM, full" + ui_print " ++ compatibility is not garantueed!" + ui_print " " + fi +} + +########################################################################################## +# Magisk Mode Installation +########################################################################################## + +magisk_install_setup () { + ui_print "******************************" + ui_print "Powered by Magisk (@topjohnwu)" + ui_print "******************************" + ui_print " " + ui_print " > setup Magisk environment" + + MAGISKBIN=/data/adb/magisk + MOUNTPATH=${TMPDIR}/magisk_img + + [ -d ${MAGISKBIN} -a -f ${MAGISKBIN}/magisk -a -f ${MAGISKBIN}/util_functions.sh ] || \ + error " !! Magisk version 15.0 or newer is required" + + . ${MAGISKBIN}/util_functions.sh + + MIN_VER=`grep_prop minMagisk ${INSTALLER}/module.prop` + [ ! -z ${MAGISK_VER_CODE} -a ${MAGISK_VER_CODE} -ge ${MIN_VER} ] || \ + error " !! Magisk 15.0 or newer is required" + + ${BOOTMODE} && IMG=/data/adb/magisk_merge.img || IMG=/data/adb/magisk.img + + MODPATH=${MOUNTPATH}/${MODID} + REALPATH=/sbin/.core/img/${MODID} + + ${BOOTMODE} && boot_actions || recovery_actions + + request_size_check "${INSTALLER}" + mount_magisk_img + + case ${MODID} in + NanoDroid ) + # check for old-named module or sub-modules are + # not supposed to be installed alongside + for dir in NanoMod NanoModmicroG NanoDroid_microG \ + NanoModfdroid NanoDroid_FDroid; do + if [[ -d ${MOUNTPATH}/${dir} ]]; then + ui_print " !! ${dir} module detected - uninstalling!" + rm -rf ${MOUNTPATH}/${dir} + fi + done + ;; + + NanoDroid_microG ) + # check for Full package and abort if found + if [[ -d ${MOUNTPATH}/NanoMod -o -d ${MOUNTPATH}/NanoDroid ]]; then + error " !! ${MODID} can't be installed along side the Full package" + fi + + # check for old-named module + if [[ -d ${MOUNTPATH}/NanoModmicroG ]]; then + ui_print " !! old version module detected - uninstalling!" + rm -rf ${MOUNTPATH}/NanoModmicroG + fi + ;; + + NanoDroid_FDroid ) + # check for Full package and abort if found + if [[ -d ${MOUNTPATH}/NanoMod -o -d ${MOUNTPATH}/NanoDroid ]]; then + error " !! ${MODID} can't be installed along side the Full package" + fi + + # check for old-named module + if [[ -d ${MOUNTPATH}/NanoModfdroid ]]; then + ui_print " !! old version module detected - uninstalling!" + rm -rf ${MOUNTPATH}/NanoModfdroid + fi + ;; + esac +} + +magisk_install_preinst () { + if [ -f ${MODPATH}/system.prop ]; then + ui_print " << backing up module's system.prop" + cp ${MODPATH}/system.prop \ + ${TMPDIR}/system.prop + fi + + if [ -f ${MODPATH}/system/framework/services.jar ]; then + if [ -f /data/adb/.nanodroid-patcher ]; then + ui_print " << backing up patched services.jar" + cp ${MODPATH}/system/framework/services.jar \ + ${TMPDIR}/services.jar + else ui_print " " + ui_print " ++ /data/adb/.nanodroid-patcher is missing, assuming" + ui_print " ++ ROM was updated, please re-run NanoDroid-Patcher" + ui_print " " + rm -f ${MODPATH}/system/framework/services.jar + fi + elif [ -f /data/adb/.nanodroid-patcher ]; then + ui_print " " + ui_print " ++ /data/adb/.nanodroid-patcher exists, but" + ui_print " ++ ${MODPATH}/system/framework/services.jar" + ui_print " ++ doesn't, assuming Magisk was uninstalled" + ui_print " ++ re-run NanoDroid-Patcher if required" + ui_print " " + rm -f /data/adb/.nanodroid-patcher + fi + + rm -rf "${MODPATH}" + + for dir in app etc priv-app xbin; do + mkdir -p "${MODPATH}/system/${dir}" + done + +} + +magisk_install_postinst () { + # Setup Overrides + if [ "${nanodroid_overlay}" -eq 1 ]; then + ui_print " << with /system applications override" + + ${MODPATH}/system/xbin/bash \ + ${MODPATH}/system/xbin/nanodroid-overlay --create + else + ui_print " << without /system applications override" + fi + + # Sorry, but com.qualcomm.location conflicts with microG + if [ "${nanodroid_microg}" -eq 1 ]; then + ${MODPATH}/system/xbin/bash \ + ${MODPATH}/system/xbin/nanodroid-overlay \ + --add com.qualcomm.location + fi + + if [ -f ${TMPDIR}/system.prop ]; then + ui_print " << restoring system.prop" + cp ${TMPDIR}/system.prop \ + ${MODPATH}/system.prop + fi + + if [ -f ${TMPDIR}/services.jar ]; then + ui_print " << restoring patched services.jar" + mkdir -p ${MODPATH}/system/framework + cp ${TMPDIR}/services.jar \ + ${MODPATH}/system/framework/services.jar + fi +} + +magisk_install_finish () { + # Magisk Module files + mktouch ${MODPATH}/auto_mount + cp -af ${INSTALLER}/module.prop ${MODPATH}/module.prop + cp -af ${INSTALLER}/common/service.sh ${MODPATH}/service.sh + chmod +x ${MODPATH}/service.sh + + if ${BOOTMODE}; then + # Update info for Magisk Manager + mktouch /sbin/.core/img/${MODID}/update + cp -af ${INSTALLER}/module.prop /sbin/.core/img/${MODID}/module.prop + fi + + case ${MODID} in + NanoDroid | NanoDroid_microG ) + magisk_install_postinst + ;; + esac + + magisk_install_cleanup +} + +magisk_install_cleanup () { + unmount_magisk_img + ${BOOTMODE} || recovery_cleanup +} + +########################################################################################## +# Generic Installation +########################################################################################## + +install_microg () { + # install microG if requested + # respectively force if it's the microG package + if [ "${nanodroid_microg}" -eq 1 -o "${MODID}" = "NanoDroid_microG" ]; then + case ${nanodroid_nlpbackend} in + 0 ) NLPBACKEND="" + ui_print " << with microG [Nominatim]" ;; + 1 ) NLPBACKEND="nlpBackendDejavu" + ui_print " << with microG [Déjà Vu, Nominatim]" ;; + 2 ) NLPBACKEND="nlpBackendIchnaea" + ui_print " << with microG [Ichnaea, Nominatim]" ;; + 3 ) NLPBACKEND="nlpBackendDejavu nlpBackendIchnaea" + ui_print " << with microG [Déjà Vu, Ichnaea, Nominatim]" ;; + esac + + for app in ${NLPBACKEND} nlpBackendNominatim GmsCore GsfProxy; do + nanodroid_install_apk ${app} + done + + # DroidGuard Helper as user app + mkdir -p /data/app/org.microg.gms.droidguard/ + cp ${INSTALLER}/system/priv-app/DroidGuard/DroidGuard.apk \ + /data/app/org.microg.gms.droidguard/base.apk + set_perm_data -r /data/app/org.microg.gms.droidguard/ + else ui_print " << without microG" + fi +} + +install_mapsv1 () { + # install mapsv1 if requested + if [ "${nanodroid_mapsv1}" -eq 1 ]; then + ui_print " << with Maps API version 1" + nanodroid_install_dir etc/permissions + nanodroid_install_dir framework + else ui_print " << without Maps API version 1" + fi +} + +install_gsync () { + # install GSync if requested + if [ "${nanodroid_gsync}" -eq 1 ]; then + if [ "${GSYNC_UNSUPPORTED}" -eq 1 ]; then + ui_print " << Google Sync Adapters are unsupported on pre-KitKat ROMs" + else + GSYNC_BASE="${INSTALLER}/gsync/${GSYNC_VER}" + ui_print " << with Google Sync Adapters (${GSYNC_VER})" + + for app in CalendarSync ContactsSync; do + echo " installing app: Google${app}" + mkdir -p "${MODPATH}/system/app/Google${app}" + + cp "${GSYNC_BASE}/app/Google${app}/Google${app}.apk" \ + "${MODPATH}/system/app/Google${app}/" || \ + error " !! failed to install Google${app}" + + set_perm_data -r "${MODPATH}/system/app/Google${app}" + + [ "${MODE}" = "${SYSTEM}" ] && \ + echo "/system/app/Google${app}/Google${app}.apk" \ + >> /data/adb/.nanodroid-list + done + + echo " installing app: GoogleBackupTransport" + mkdir -p "${MODPATH}/system/priv-app/GoogleBackupTransport" + + cp "${GSYNC_BASE}/priv-app/GoogleBackupTransport/GoogleBackupTransport.apk" \ + "${MODPATH}/system/priv-app/GoogleBackupTransport/" || \ + error " !! failed to install GoogleBackupTransport" + + set_perm_data -r "${MODPATH}/system/priv-app/GoogleBackupTransport" + + [ "${MODE}" = "SYSTEM" ] && \ + echo "/system/priv-app/GoogleBackupTransport/GoogleBackupTransport.apk" \ + >> /data/adb/.nanodroid-list + + cp -r "${INSTALLER}/gsync/permissions/" "${MODPATH}/system/etc/" + set_perm_data -r "${MODPATH}/system/etc/" + + [ "${MODE}" = "SYSTEM" ] && \ + find -type f "${INSTALLER}/gsync/permissions/" | + sed -e "s,${INSTALLER}/gsync,/system/etc,g" \ + >> /data/adb/.nanodroid-list + fi + else ui_print " << without Google Sync Adapters" + fi +} + +install_fdroid () { + # install F-Droid if requested + # respectively force if it's the F-Droid package + if [ "${nanodroid_fdroid}" -eq 1 -o "${MODID}" = "NanoDroid_FDroid" ]; then + ui_print " << with F-Droid" + nanodroid_install_apk FDroid + nanodroid_install_apk FDroidPrivileged + else ui_print " << without F-Droid" + fi +} + +install_apps () { + # install apps if requested + if [ "${nanodroid_apps}" -eq 1 ]; then + ui_print " << with applications" + APP_STRING=" <<>" + + INSTALL_APPS=$(cat "${cfg_apps}") + for app in ${INSTALL_APPS}; do + [[ -d "${INSTALLER}/system/app/${app}" ]] && \ + APP_STRING="${APP_STRING} ${app}, " + done + + ui_print "${APP_STRING}" + + for app in ${INSTALL_APPS}; do + if [[ ${app} = Adaway && -d /system/app/AdAway ]]; then + ui_print " <<> app: ${app} already provided by ROM (as AdAway)" + elif [[ -d /system/app/${app} && ! -d ${REALPATH}/system/app/${app} ]]; then + ui_print " <<> app: ${app} already provided by ROM" + elif [[ -d "${INSTALLER}/system/app/${app}" ]]; then + nanodroid_install_apk ${app} + else ui_print " <<>> app: ${app} missing" + fi + done + + else ui_print " << without applications" + fi +} + +install_store () { + # install Yalp Store or Play Store whichever requested + if [ "${nanodroid_play}" -eq 1 ]; then + ui_print " << with Play Store" + nanodroid_install_apk Phonesky + elif [ "${nanodroid_play}" -eq 2 ]; then + ui_print " << with Yalp Store (and Fake Store)" + nanodroid_install_apk YalpStore + nanodroid_install_apk FakeStore + else ui_print " << without App Store" + fi +} + +install_zelda () { + # install Zelda Ringtones when requested + if [ "${nanodroid_zelda}" -eq 1 ]; then + ui_print " << with Zelda sounds" + nanodroid_install_dir media + else ui_print " << without Zelda sounds" + fi +} + +install_bash () { + ui_print " << GNU Bash Shell" + nanodroid_install_file etc/bash_logout + nanodroid_install_file etc/bashrc + + nanodroid_install_file xbin/bash bin + nanodroid_install_file xbin/bash.bin.${BIN_ARCH} bin + nanodroid_install_file xbin/bashbug.${BIN_ARCH} bin +} + +install_novl () { + ui_print " << NanoDroid-Overlay Script" + + nanodroid_install_file xbin/nanodroid-overlay bin + nanodroid_substitute xbin/nanodroid-overlay + + nanodroid_install_file xbin/novl bin + nanodroid_substitute xbin/novl + + nanodroid_install_file xbin/column.${BIN_ARCH} bin + nanodroid_install_file xbin/aapt.${BIN_ARCH} bin +} + +install_nano () { + ui_print " << GNU Nano Terminal Editor" + nanodroid_install_dir etc/terminfo + + nanodroid_install_file xbin/nano bin + nanodroid_install_file xbin/nano.bin bin +} + +install_shell_utils () { + ui_print " << Shell Utilities (util-linux, bsdmainutils, less)" + nanodroid_install_file xbin/less bin + + # architecture dependend stuff + for binary in col colcrt colrm findfs findmnt hexdump \ + less.bin lessecho lesskey look lsblk lscpu lsipc \ + lslocks lsns ncal setterm unzip whereis; do + nanodroid_install_file xbin/${binary}.${BIN_ARCH} bin + done +} + +install_initd () { + if [ "${nanodroid_init}" -eq 1 ]; then + ui_print " << with init scripts" + + if [ "${MODE}" = "SYSTEM" ]; then + INIT_BASE="${MODPATH}/system/etc/init.d" + else INIT_BASE="${MODPATH}/init.d" + fi + + mkdir -p "${INIT_BASE}" + cp "${INSTALLER}/system/etc/init.d"/* "${INIT_BASE}/" + set_perm_bin "${INIT_BASE}" + + [ "${MODE}" = "SYSTEM" ] && \ + for init in fstrim logscleaner sqlite external_sd; do + echo "/system/etc/init.d/${init}" \ + >> /data/adb/.nanodroid-list + done + else ui_print " << without init scripts" + fi +} + +install_swipe () { + if [ "${nanodroid_swipe}" -eq 1 ]; then + ui_print " << with swipe libraries" + + SWIPE_SRC="${INSTALLER}/swipe/${ARCH}" + SWIPE_DEST="/system/${SWIPE_LIBDIR}" + + mkdir -p "${MODPATH}${SWIPE_DEST}" + + for lib in latinimegoogle keyboarddecoder; do + cp "${SWIPE_SRC}/libjni_${lib}.so" "${MODPATH}${SWIPE_DEST}" || \ + error " !! failed to install libjni_${lib}.so" + set_perm_data "${MODPATH}${SWIPE_DEST}/libjni_${lib}.so" + + [ "${MODE}" = "SYSTEM" ] && \ + echo "${SWIPE_DEST}/libjni_${lib}.so" \ + >> /data/adb/.nanodroid-list + done + else ui_print " << without swipe libraries" + fi +} + +########################################################################################## +# Advanced Installation Functions +########################################################################################## + +nanodroid_install_dir () { + dir="${1}" + dest="/system/${dir}" + + [ ! -d "${INSTALLER}/system/${dir}" ] && \ + error " !! dir: ${dir} not found" + + echo " installing dir: ${dir}" + + mkdir -p "${MODPATH}${dest}" + cp -r "${INSTALLER}/system/${dir}"/* "${MODPATH}${dest}/" || \ + error " !! failed to install ${dir}" + + case ${2} in + bin ) set_perm_bin -r "${MODPATH}${dest}" ;; + * ) set_perm_data -r "${MODPATH}${dest}" ;; + esac + + [ "${MODE}" = "SYSTEM" ] && \ + find -type f "${INSTALLER}${dest}" | \ + sed -e "s,^${INSTALLER},,g" \ + >> /data/adb/.nanodroid-list +} + +nanodroid_install_apk () { + app=${1} + unset prefix + + if [ -f "${INSTALLER}/system/app/${app}/${app}.apk" ]; then + dir=system/app + elif [ -f "${INSTALLER}/system/priv-app/${app}/${app}.apk" ]; then + dir=system/priv-app + else + error " !! app ${app} not found" + fi + + source="${INSTALLER}/${dir}/${app}/${app}.apk" + + if [ "${UNFOLD_APP_DIR}" -eq 1 ]; then + dest="${dir}" + mkdir -p "${MODPATH}/${dir}" + else + dest="${dir}/${app}" + mkdir -p "${MODPATH}/${dir}/${app}" + fi + + echo " installing app: ${app}" + cp "${source}" "${MODPATH}/${dest}" || \ + error " !! failed to install ${source} to ${dest}" + + set_perm_data -r "${MODPATH}/${dest}" + + [ "${MODE}" = "${SYSTEM}" ] && \ + echo "${dest}/${app}.apk" >> /data/adb/.nanodroid-list + + nanodroid_install_lib +} + +nanodroid_install_file () { + dir="$(dirname "${1}")" + file="$(basename "${1}")" + + [ ! -f "${INSTALLER}/system/${dir}/${file}" ] && \ + error " !! file: ${file} not found" + + # strip off .${BIN_ARCH} from final filename (if any) + xfile=$(basename ${file} .${BIN_ARCH}) + + echo " installing file: ${xfile}" + + mkdir -p "${MODPATH}/system/${dir}/" + cp "${INSTALLER}/system/${dir}/${file}" \ + "${MODPATH}/system/${dir}/${xfile}" || \ + error " !! failed to install ${xfile}" + + case ${2} in + bin ) set_perm_bin "${MODPATH}/system/${dir}/${xfile}" ;; + * ) set_perm_data "${MODPATH}/system/${dir}/${xfile}" ;; + esac + + [ "${MODE}" = "${SYSTEM}" ] && \ + echo "/system/${dir}/${xfile}" >> /data/adb/.nanodroid-list +} + +nanodroid_install_lib () { + apk="${MODPATH}/${dest}/${app}.apk" + + if [ "${UNFOLD_APP_DIR}" -eq 1 ]; then + case ${ARCH} in + arm | x86 ) libd=${MODPATH}/system/lib ;; + arm64 | x86_64 ) libd=${MODPATH}/system/lib64 ;; + esac + else + libd=${MODPATH}/${dir}/${app}/lib + fi + + rm -rf ${TMP_LIBDIR} + mkdir -p ${TMP_LIBDIR} + + unset srcdir + + "${INSTALLER}/system/xbin/unzip.${BIN_ARCH}" \ + -oq ${apk} "lib/*" -d "${TMP_LIBDIR}" \ + 2>/dev/null + unzip_return=$? + + case ${unzip_return} in + 0 ) echo " ${app} does have libs" ;; + 11 ) echo " ${app} does not have any libs" ;; + * ) error " !! installing libs for ${app} failed" ;; + esac + + if [ -d ${TMP_LIBDIR}/lib ]; then + for ARCHLIB in ${LIB_ARCHES}; do + if [ -d ${TMP_LIBDIR}/lib/${ARCHLIB} ]; then + srcdir=${TMP_LIBDIR}/lib/${ARCHLIB} + break + fi + done + + if [ -d "${srcdir}" ]; then + case ${srcdir} in + *arm64* ) echo " ${app}: installing arm64 libs" + lib_arch=arm64 ;; + *arm* ) echo " ${app}: installing arm libs" + lib_arch=arm ;; + *x86_64* ) echo " ${app}: installing x86_64 libs" + lib_arch=x86_64 ;; + *x86* ) echo " ${app}: installing x86 libs" + lib_arch=x86 ;; + esac + + echo " from: ${srcdir}" + echo " into: ${libd}/${lib_arch}" + mkdir -p ${libd}/${lib_arch} + + for lib in ${srcdir}/*; do + echo " library: $(basename ${lib})" + cp ${lib} ${libd}/${lib_arch}/ || \ + error " !! installing libraries failed" + + set_perm_data ${libd}/${lib_arch}/$(basename ${lib}) + + [ "${MODE}" = "SYSTEM" ] && \ + echo /${dir}/${app}/${lib_arch}/$(basename ${lib}) \ + >> /data/adb/.nanodroid-list + done + fi + fi +} + +nanodroid_substitute () { + target="${MODPATH}/system/${1}" + + if grep -q @ZIPDIR@ "${target}"; then + if [[ "${ZIPDIR}" == "/external_sd" ]]; then + # /external_sd is already known by `nanodroid-overlay` + # no need to add it a second time + sed -e 's|@ZIPDIR@||' -i ${target} + echo " substitute: remove @ZIPDIR@ in ${target}" + else + sed -e "s|@ZIPDIR@|${ZIPDIR}|g" -i ${target} + echo " substitute: adjust @ZIPDIR@ in ${target}" + fi + fi + + if grep -q @MODPATH@ ${target}; then + sed -e "s|@MODPATH@|${REALPATH}|g" -i ${target} + echo " substitute: adjust @MODPATH@ in ${target}" + fi +} + +nanodroid_storelogs () { + ${BOOTMODE} || cp /tmp/recovery.log /data/adb/.recovery_${MODID} + + echo "\ +### VALUES ### +ZIP=${ZIP} +ZIPDIR=${ZIPDIR} +TMPDIR=${TMPDIR} +TMP_LIBDIR=${TMP_LIBDIR} +INSTALLER=${INSTALLER} +MODID=${MODID} +SDK_VERSION=${SDK_VERSION} +ARCH=${ARCH} +LIB_ARCHES=${LIB_ARCHES} +MODPATH=${MODPATH} +SWIPE_LIBDIR=${SWIPE_LIBDIR} +REALPATH=${REALPATH} +MODE=${MODE} +MAGISK_VER_CODE=${MAGISK_VER_CODE} + +### SETUP ### +" > /data/adb/.nanodroid_${MODID} + +cat "${cfg_setup}" >> /data/adb/.nanodroid_${MODID} + +echo " +### APPS ### +" >> /data/adb/.nanodroid_${MODID} + +cat "${cfg_apps}" >> /data/adb/.nanodroid_${MODID} + +echo " +### OVERLAY ### +" >> /data/adb/.nanodroid_${MODID} + +cat "${cfg_overlay}" >> /data/adb/.nanodroid_${MODID} + +} + +########################################################################################## +# NanoDroid Configuration File Handling +########################################################################################## + +# check for configuration files +config_locations="/sdcard /external_sd ${ZIPDIR} /data" + +get_config () { + config="" + config_exists=0 + for path in ${config_locations}; do + # rename config files if required (< 15.1) + if test -r "${path}/.nanomod-${1}"; then + mv "${path}/.nanomod-${1}" "${path}/.nanodroid-${1}" + fi + + if test -r "${path}/.nanodroid-${1}"; then + config="${path}/.nanodroid-${1}" + config_exists=1 + return + fi + done +} + +set_prop () { + echo "${1}=${2}" >> ${cfg_setup} +} + +# check whether '.nanodroid-setup' has all required entries +# update format if required +check_cfg_setup () { + # < 12.0 + if grep -q "nanomod\." "${cfg_setup}"; then + ui_print " ++ migrating ${cfg_setup} to new format" + sed -e 's/nanomod\./nanomod_/g' -i "${cfg_setup}" + fi + + # < 16.0 + if grep -q "nanomod_" "${cfg_setup}"; then + ui_print " ++ migrating ${cfg_setup} to new format" + sed -e 's/nanomod_/nanodroid_/g' -i "${cfg_setup}" + fi + + source ${cfg_setup} + + [ -z ${nanodroid_fdroid} ] && set_prop nanodroid_fdroid 1 + [ -z ${nanodroid_microg} ] && set_prop nanodroid_microg 1 + [ -z ${nanodroid_apps} ] && set_prop nanodroid_apps 1 + [ -z ${nanodroid_play} ] && set_prop nanodroid_play 1 + + if [ "${MODID}" = "NanoDroid" ]; then + [ -z ${nanodroid_overlay} ] && set_prop nanodroid_overlay 1 + else [ -z ${nanodroid_overlay} ] && set_prop nanodroid_overlay 0 + fi + + [ -z ${nanodroid_zelda} ] && set_prop nanodroid_zelda 1 + [ -z ${nanodroid_mapsv1} ] && set_prop nanodroid_mapsv1 1 + [ -z ${nanodroid_init} ] && set_prop nanodroid_init 1 + [ -z ${nanodroid_gsync} ] && set_prop nanodroid_gsync 0 + [ -z ${nanodroid_forcesystem} ] && set_prop nanodroid_forcesystem 0 + [ -z ${nanodroid_swipe} ] && set_prop nanodroid_swipe 0 + [ -z ${nanodroid_nlpbackend} ] && set_prop nanodroid_nlpbackend 1 + + source ${cfg_setup} +} + +# check whether '.nanodroid-apps' has new format +# and update if required +check_cfg_apps () { + # < 12.0 + if grep -q INSTALL_APPS "${cfg_apps}"; then + ui_print " ++ migrating ${cfg_apps} to new format" + sed -e 's/^INSTALL_APPS=//;s/\"//g' -i "${cfg_apps}" + fi +} + +# check whether '.nanodroid-overlay' has new format +# and update if required +check_cfg_overlay () { + if grep -q "APPS=(" "${cfg_overlay}"; then + ui_print " ++ migrating ${cfg_overlay} to new format" + sed -e 's/^.*APPS=//;s/(//g;s/)//g' -i "${cfg_overlay}" + sed '/^\s*$/d' -i "${cfg_overlay}" + fi +} + +get_cfg_setup () { + get_config setup + if [ "$config_exists" -eq 1 ]; then + cfg_setup="${config}" + check_cfg_setup + ui_print " > Config | nanodroid-setup | $(dirname ${cfg_setup})" + else + cfg_setup="${INSTALLER}/.nanodroid-setup" + source "${cfg_setup}" + ui_print " > Config | nanodroid-setup | fallback" + fi +} + +get_cfg_overlay () { + get_config overlay + if [ "$config_exists" -eq 1 ]; then + cfg_overlay="${config}" + check_cfg_overlay + ui_print " > Config | nanodroid-overlay | $(dirname ${cfg_overlay})" + else + cfg_overlay="${INSTALLER}/.nanodroid-overlay" + ui_print " > Config | nanodroid-overlay | fallback" + fi +} + +get_cfg_apps () { + get_config apps + if [ "$config_exists" -eq 1 ]; then + cfg_apps="${config}" + check_cfg_apps + ui_print " > Config | nanodroid-apps | $(dirname ${cfg_apps})" + else + cfg_apps="${INSTALLER}/.nanodroid-apps" + ui_print " > Config | nanodroid-apps | fallback" + fi +} diff --git a/Full/system/etc/bash_logout b/Full/system/etc/bash_logout new file mode 100644 index 00000000..5b4f8bb6 --- /dev/null +++ b/Full/system/etc/bash_logout @@ -0,0 +1 @@ +clear diff --git a/Full/system/etc/bashrc b/Full/system/etc/bashrc new file mode 100644 index 00000000..4e187f64 --- /dev/null +++ b/Full/system/etc/bashrc @@ -0,0 +1,41 @@ +# /etc/bash/bashrc +# +# This file is sourced by all *interactive* bash shells on startup, +# including some apparently interactive shells such as scp and rcp +# that can't tolerate any output. So make sure this doesn't display +# anything or bad things will happen ! + +export HOME=/sdcard +export HOSTNAME=$(getprop ro.cm.device) +export TERM=xterm +export TMPDIR=/data/local/tmp +export USER=$(id -un) +export PAGER=less + +# Test for an interactive shell. There is no need to set anything +# past this point for scp and rcp, and it's important to refrain from +# outputting anything in those cases. +if [[ $- != *i* ]] ; then + # Shell is non-interactive. Be done now! + return +fi + +# Bash won't get SIGWINCH if another process is in the foreground. +# Enable checkwinsize so that bash will check the terminal size when +# it regains control. #65623 +# http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11) +shopt -s checkwinsize + +# Enable history appending instead of overwriting. #139609 +shopt -s histappend + +# enable colorful terminal +if [[ ${EUID} == 0 ]] ; then + PS1='\[\033[01;31m\]${HOSTNAME:=$(hostname)}\[\033[01;34m\] \W \$\[\033[00m\] ' +else + PS1='\[\033[01;32m\]${USER:=$(id \-un)}@${HOSTNAME:=$(hostname)}\[\033[01;34m\] \w \$\[\033[00m\] ' +fi + +# correct the terminal size ; +# some OS' don't ship `resize` +resize >/dev/null diff --git a/Full/system/etc/init.d/external_sd b/Full/system/etc/init.d/external_sd new file mode 100755 index 00000000..4b4d2ce9 --- /dev/null +++ b/Full/system/etc/init.d/external_sd @@ -0,0 +1,47 @@ +#!/system/bin/sh + +echo "external_sd init script" + +# retry 6 times, wait 5 seconds between each try +count=0 + +while [[ -z $(grep "^/dev/block.*/mnt/media_rw" /proc/mounts) ]]; do + count=$((count+1)) + if [ "${count}" -lt 7 ]; then + sleep 5 + else + echo ">> no SD Card found" + exit 1 + fi +done + +media_rw=$(grep "^/dev/block.*/mnt/media_rw" /proc/mounts \ + | cut -d " " -f 2 \ + | cut -d "/" -f 4) +storage="/storage/${media_rw}" + +if [[ -d ${storage} ]]; then + echo ">> SD Card found" + echo ">> storage: \"${storage}\"" + + if [[ -e /external_sd ]]; then + link=$(ls -l /external_sd | sed -e 's/.*-> //g') + if [[ "${link}" != "${storage}" ]]; then + echo ">> removing old link: \"${link}\"" + mount -orw,remount / + rm -f /external_sd + mount -oro,remount / + fi + fi + + if [[ -e /external_sd ]]; then + echo ">> /external_sd link up to date" + else + echo ">> /external_sd link created" + mount -orw,remount / + ln -sf ${storage} /external_sd + mount -oro,remount / + fi +else + echo ">> no SD Card found" +fi diff --git a/Full/system/etc/init.d/fstrim b/Full/system/etc/init.d/fstrim new file mode 100755 index 00000000..8e48e183 --- /dev/null +++ b/Full/system/etc/init.d/fstrim @@ -0,0 +1,14 @@ +#!/system/bin/sh + +echo "fstrim init script" + +if [ -e /init.fstrim.sh ]; then + echo "/init.fstrim.sh exists, trimming /preload only" + fstrim -v /preload +else + echo "/init.fstrim.sh does not exist, trimming /cache, /system, /data, /preload" + fstrim -v /cache + fstrim -v /system + fstrim -v /data + fstrim -v /preload +fi diff --git a/Full/system/etc/init.d/logscleaner b/Full/system/etc/init.d/logscleaner new file mode 100755 index 00000000..a4c9c783 --- /dev/null +++ b/Full/system/etc/init.d/logscleaner @@ -0,0 +1,20 @@ +#!/system/bin/sh + +echo "logscleaner init script" +echo "Starting Automatic Cleaning $(date +"%m-%d-%Y %H:%M:%S")" +rm -f /data/data/*/*/*/*.tmp +rm -f /data/data/*/*/*/*/*.tmp +rm -f /data/local/*.apk +rm -f /data/local/tmp/*.apk +rm -f /data/log/* +rm -f /data/slog/* +rm -f /cache/*.* +rm -f /cache/recovery/*.* +rm -f /data/system/dropbox/*.* +rm -f /data/backup/pending/*.tmp +rm -f /data/tombstones/* +rm -f /data/system/usagestats/0/daily/* +rm -f /data/system/usagestats/0/monthly/* +rm -f /data/system/usagestats/0/weekly/* +rm -f /data/system/usagestats/0/yearly/* +echo "Automatic Cleaning finished at $(date +"%m-%d-%Y %H:%M:%S")" diff --git a/Full/system/etc/init.d/sqlite b/Full/system/etc/init.d/sqlite new file mode 100755 index 00000000..e4764707 --- /dev/null +++ b/Full/system/etc/init.d/sqlite @@ -0,0 +1,28 @@ +#!/system/bin/sh + +echo "sqlite init script" + +if which sqlite3 >/dev/null; then + echo "SQLite database VACUUM and REINDEX started at $(date +"%m-%d-%Y %H:%M:%S")" + for i in `find /data/* -iname "*.db"`; do + sqlite3 $i 'VACUUM;' + resVac=$? + if [ $resVac == 0 ]; then + resVac="SUCCESS" + else + resVac="ERRCODE-$resVac" + fi; + + sqlite3 $i 'REINDEX;' + resIndex=$? + if [ $resIndex == 0 ]; then + resIndex="SUCCESS" + else + resIndex="ERRCODE-$resIndex" + fi + echo "Database $i: VACUUM=$resVac REINDEX=$resIndex" + done + + echo "SQLite database VACUUM and REINDEX finished at $(date +"%m-%d-%Y %H:%M:%S")" +else echo "sqlite3 not installed, stop" +fi diff --git a/Full/system/etc/permissions/com.google.android.maps.xml b/Full/system/etc/permissions/com.google.android.maps.xml new file mode 100644 index 00000000..5be5c2ce --- /dev/null +++ b/Full/system/etc/permissions/com.google.android.maps.xml @@ -0,0 +1,20 @@ + + + + + + diff --git a/Full/system/etc/terminfo/E/Eterm b/Full/system/etc/terminfo/E/Eterm new file mode 100644 index 00000000..504d6738 Binary files /dev/null and b/Full/system/etc/terminfo/E/Eterm differ diff --git a/Full/system/etc/terminfo/E/Eterm-color b/Full/system/etc/terminfo/E/Eterm-color new file mode 100644 index 00000000..504d6738 Binary files /dev/null and b/Full/system/etc/terminfo/E/Eterm-color differ diff --git a/Full/system/etc/terminfo/a/ansi b/Full/system/etc/terminfo/a/ansi new file mode 100644 index 00000000..6de79787 Binary files /dev/null and b/Full/system/etc/terminfo/a/ansi differ diff --git a/Full/system/etc/terminfo/c/cons25 b/Full/system/etc/terminfo/c/cons25 new file mode 100644 index 00000000..09d473cd Binary files /dev/null and b/Full/system/etc/terminfo/c/cons25 differ diff --git a/Full/system/etc/terminfo/c/cygwin b/Full/system/etc/terminfo/c/cygwin new file mode 100644 index 00000000..56560d23 Binary files /dev/null and b/Full/system/etc/terminfo/c/cygwin differ diff --git a/Full/system/etc/terminfo/d/dumb b/Full/system/etc/terminfo/d/dumb new file mode 100644 index 00000000..fd4091a9 Binary files /dev/null and b/Full/system/etc/terminfo/d/dumb differ diff --git a/Full/system/etc/terminfo/h/hurd b/Full/system/etc/terminfo/h/hurd new file mode 100644 index 00000000..0327b91b Binary files /dev/null and b/Full/system/etc/terminfo/h/hurd differ diff --git a/Full/system/etc/terminfo/l/linux b/Full/system/etc/terminfo/l/linux new file mode 100644 index 00000000..b458ffaf Binary files /dev/null and b/Full/system/etc/terminfo/l/linux differ diff --git a/Full/system/etc/terminfo/m/mach b/Full/system/etc/terminfo/m/mach new file mode 100644 index 00000000..94699c27 Binary files /dev/null and b/Full/system/etc/terminfo/m/mach differ diff --git a/Full/system/etc/terminfo/m/mach-bold b/Full/system/etc/terminfo/m/mach-bold new file mode 100644 index 00000000..1b72fcc0 Binary files /dev/null and b/Full/system/etc/terminfo/m/mach-bold differ diff --git a/Full/system/etc/terminfo/m/mach-color b/Full/system/etc/terminfo/m/mach-color new file mode 100644 index 00000000..0e63d810 Binary files /dev/null and b/Full/system/etc/terminfo/m/mach-color differ diff --git a/Full/system/etc/terminfo/p/pcansi b/Full/system/etc/terminfo/p/pcansi new file mode 100644 index 00000000..b24fba93 Binary files /dev/null and b/Full/system/etc/terminfo/p/pcansi differ diff --git a/Full/system/etc/terminfo/r/rxvt b/Full/system/etc/terminfo/r/rxvt new file mode 100644 index 00000000..4d54c324 Binary files /dev/null and b/Full/system/etc/terminfo/r/rxvt differ diff --git a/Full/system/etc/terminfo/r/rxvt-basic b/Full/system/etc/terminfo/r/rxvt-basic new file mode 100644 index 00000000..05474636 Binary files /dev/null and b/Full/system/etc/terminfo/r/rxvt-basic differ diff --git a/Full/system/etc/terminfo/s/screen b/Full/system/etc/terminfo/s/screen new file mode 100644 index 00000000..895f0f67 Binary files /dev/null and b/Full/system/etc/terminfo/s/screen differ diff --git a/Full/system/etc/terminfo/s/screen-256color b/Full/system/etc/terminfo/s/screen-256color new file mode 100644 index 00000000..11fbb23a Binary files /dev/null and b/Full/system/etc/terminfo/s/screen-256color differ diff --git a/Full/system/etc/terminfo/s/screen-256color-bce b/Full/system/etc/terminfo/s/screen-256color-bce new file mode 100644 index 00000000..ad6b3167 Binary files /dev/null and b/Full/system/etc/terminfo/s/screen-256color-bce differ diff --git a/Full/system/etc/terminfo/s/screen-bce b/Full/system/etc/terminfo/s/screen-bce new file mode 100644 index 00000000..bf8eda02 Binary files /dev/null and b/Full/system/etc/terminfo/s/screen-bce differ diff --git a/Full/system/etc/terminfo/s/screen-s b/Full/system/etc/terminfo/s/screen-s new file mode 100644 index 00000000..c9fffe29 Binary files /dev/null and b/Full/system/etc/terminfo/s/screen-s differ diff --git a/Full/system/etc/terminfo/s/screen-w b/Full/system/etc/terminfo/s/screen-w new file mode 100644 index 00000000..e5a13869 Binary files /dev/null and b/Full/system/etc/terminfo/s/screen-w differ diff --git a/Full/system/etc/terminfo/s/sun b/Full/system/etc/terminfo/s/sun new file mode 100644 index 00000000..52a27310 Binary files /dev/null and b/Full/system/etc/terminfo/s/sun differ diff --git a/Full/system/etc/terminfo/v/vt100 b/Full/system/etc/terminfo/v/vt100 new file mode 100644 index 00000000..1a7176dd Binary files /dev/null and b/Full/system/etc/terminfo/v/vt100 differ diff --git a/Full/system/etc/terminfo/v/vt102 b/Full/system/etc/terminfo/v/vt102 new file mode 100644 index 00000000..b9a393c5 Binary files /dev/null and b/Full/system/etc/terminfo/v/vt102 differ diff --git a/Full/system/etc/terminfo/v/vt220 b/Full/system/etc/terminfo/v/vt220 new file mode 100644 index 00000000..36a6e2f7 Binary files /dev/null and b/Full/system/etc/terminfo/v/vt220 differ diff --git a/Full/system/etc/terminfo/v/vt52 b/Full/system/etc/terminfo/v/vt52 new file mode 100644 index 00000000..8137caf3 Binary files /dev/null and b/Full/system/etc/terminfo/v/vt52 differ diff --git a/Full/system/etc/terminfo/w/wsvt25 b/Full/system/etc/terminfo/w/wsvt25 new file mode 100644 index 00000000..29a825ee Binary files /dev/null and b/Full/system/etc/terminfo/w/wsvt25 differ diff --git a/Full/system/etc/terminfo/w/wsvt25m b/Full/system/etc/terminfo/w/wsvt25m new file mode 100644 index 00000000..d95ae91d Binary files /dev/null and b/Full/system/etc/terminfo/w/wsvt25m differ diff --git a/Full/system/etc/terminfo/x/xterm b/Full/system/etc/terminfo/x/xterm new file mode 100644 index 00000000..12ad5b33 Binary files /dev/null and b/Full/system/etc/terminfo/x/xterm differ diff --git a/Full/system/etc/terminfo/x/xterm-256color b/Full/system/etc/terminfo/x/xterm-256color new file mode 100644 index 00000000..80f0a347 Binary files /dev/null and b/Full/system/etc/terminfo/x/xterm-256color differ diff --git a/Full/system/etc/terminfo/x/xterm-color b/Full/system/etc/terminfo/x/xterm-color new file mode 100644 index 00000000..10bf2e1a Binary files /dev/null and b/Full/system/etc/terminfo/x/xterm-color differ diff --git a/Full/system/etc/terminfo/x/xterm-r5 b/Full/system/etc/terminfo/x/xterm-r5 new file mode 100644 index 00000000..64449b81 Binary files /dev/null and b/Full/system/etc/terminfo/x/xterm-r5 differ diff --git a/Full/system/etc/terminfo/x/xterm-r6 b/Full/system/etc/terminfo/x/xterm-r6 new file mode 100644 index 00000000..16fd56e9 Binary files /dev/null and b/Full/system/etc/terminfo/x/xterm-r6 differ diff --git a/Full/system/etc/terminfo/x/xterm-vt220 b/Full/system/etc/terminfo/x/xterm-vt220 new file mode 100644 index 00000000..f7abb320 Binary files /dev/null and b/Full/system/etc/terminfo/x/xterm-vt220 differ diff --git a/Full/system/etc/terminfo/x/xterm-xfree86 b/Full/system/etc/terminfo/x/xterm-xfree86 new file mode 100644 index 00000000..0b72f454 Binary files /dev/null and b/Full/system/etc/terminfo/x/xterm-xfree86 differ diff --git a/Full/system/framework/com.google.android.maps.jar b/Full/system/framework/com.google.android.maps.jar new file mode 100644 index 00000000..3779c776 Binary files /dev/null and b/Full/system/framework/com.google.android.maps.jar differ diff --git a/Full/system/media/audio/notifications/The_Legend_of_Zelda_Flute.ogg b/Full/system/media/audio/notifications/The_Legend_of_Zelda_Flute.ogg new file mode 100644 index 00000000..aaaafbdb Binary files /dev/null and b/Full/system/media/audio/notifications/The_Legend_of_Zelda_Flute.ogg differ diff --git a/Full/system/media/audio/notifications/The_Legend_of_Zelda_Golden_Bug_Catch.ogg b/Full/system/media/audio/notifications/The_Legend_of_Zelda_Golden_Bug_Catch.ogg new file mode 100644 index 00000000..04a22093 Binary files /dev/null and b/Full/system/media/audio/notifications/The_Legend_of_Zelda_Golden_Bug_Catch.ogg differ diff --git a/Full/system/media/audio/notifications/The_Legend_of_Zelda_Hey_Listen.ogg b/Full/system/media/audio/notifications/The_Legend_of_Zelda_Hey_Listen.ogg new file mode 100644 index 00000000..5145b0bc Binary files /dev/null and b/Full/system/media/audio/notifications/The_Legend_of_Zelda_Hey_Listen.ogg differ diff --git a/Full/system/media/audio/notifications/The_Legend_of_Zelda_Intro.ogg b/Full/system/media/audio/notifications/The_Legend_of_Zelda_Intro.ogg new file mode 100644 index 00000000..aacce149 Binary files /dev/null and b/Full/system/media/audio/notifications/The_Legend_of_Zelda_Intro.ogg differ diff --git a/Full/system/media/audio/notifications/The_Legend_of_Zelda_Midna_Alert.ogg b/Full/system/media/audio/notifications/The_Legend_of_Zelda_Midna_Alert.ogg new file mode 100644 index 00000000..2f159ae3 Binary files /dev/null and b/Full/system/media/audio/notifications/The_Legend_of_Zelda_Midna_Alert.ogg differ diff --git a/Full/system/media/audio/notifications/The_Legend_of_Zelda_Secret.mp3 b/Full/system/media/audio/notifications/The_Legend_of_Zelda_Secret.mp3 new file mode 100644 index 00000000..bd047b79 Binary files /dev/null and b/Full/system/media/audio/notifications/The_Legend_of_Zelda_Secret.mp3 differ diff --git a/Full/system/media/audio/notifications/The_Legend_of_Zelda_Start.ogg b/Full/system/media/audio/notifications/The_Legend_of_Zelda_Start.ogg new file mode 100644 index 00000000..3a74e6ca Binary files /dev/null and b/Full/system/media/audio/notifications/The_Legend_of_Zelda_Start.ogg differ diff --git a/Full/system/media/audio/notifications/The_Legend_of_Zelda_Vessel.ogg b/Full/system/media/audio/notifications/The_Legend_of_Zelda_Vessel.ogg new file mode 100644 index 00000000..0b632252 Binary files /dev/null and b/Full/system/media/audio/notifications/The_Legend_of_Zelda_Vessel.ogg differ diff --git a/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Bolero_of_Fire.mp3 b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Bolero_of_Fire.mp3 new file mode 100644 index 00000000..fc6586a2 Binary files /dev/null and b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Bolero_of_Fire.mp3 differ diff --git a/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Gerudo_Valley.mp3 b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Gerudo_Valley.mp3 new file mode 100644 index 00000000..3e055b47 Binary files /dev/null and b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Gerudo_Valley.mp3 differ diff --git a/Full/system/media/audio/ringtones/The_Legend_of_Zelda_House_Remix.mp3 b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_House_Remix.mp3 new file mode 100644 index 00000000..ccb92eb2 Binary files /dev/null and b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_House_Remix.mp3 differ diff --git a/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Lost_Woods.ogg b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Lost_Woods.ogg new file mode 100644 index 00000000..0959b48e Binary files /dev/null and b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Lost_Woods.ogg differ diff --git a/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Lost_Woods_Dubstep.ogg b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Lost_Woods_Dubstep.ogg new file mode 100644 index 00000000..19cff8a1 Binary files /dev/null and b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Lost_Woods_Dubstep.ogg differ diff --git a/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Market_Theme.ogg b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Market_Theme.ogg new file mode 100644 index 00000000..49c468a0 Binary files /dev/null and b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Market_Theme.ogg differ diff --git a/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Minuet_of_Forest.ogg b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Minuet_of_Forest.ogg new file mode 100644 index 00000000..71c2a953 Binary files /dev/null and b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Minuet_of_Forest.ogg differ diff --git a/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Nocturne_of_Shadows.mp3 b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Nocturne_of_Shadows.mp3 new file mode 100644 index 00000000..a57afd91 Binary files /dev/null and b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Nocturne_of_Shadows.mp3 differ diff --git a/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Prelude_of_Light.mp3 b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Prelude_of_Light.mp3 new file mode 100644 index 00000000..6107b70d Binary files /dev/null and b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Prelude_of_Light.mp3 differ diff --git a/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Requiem_of_Spirits.ogg b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Requiem_of_Spirits.ogg new file mode 100644 index 00000000..24a88bbc Binary files /dev/null and b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Requiem_of_Spirits.ogg differ diff --git a/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Sarias_Song.mp3 b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Sarias_Song.mp3 new file mode 100644 index 00000000..912eab82 Binary files /dev/null and b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Sarias_Song.mp3 differ diff --git a/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Serenade_of_Water.mp3 b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Serenade_of_Water.mp3 new file mode 100644 index 00000000..2e8f5ce8 Binary files /dev/null and b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Serenade_of_Water.mp3 differ diff --git a/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Shadow_World.mp3 b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Shadow_World.mp3 new file mode 100644 index 00000000..603d3ad2 Binary files /dev/null and b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Shadow_World.mp3 differ diff --git a/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Song_of_Storms.mp3 b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Song_of_Storms.mp3 new file mode 100644 index 00000000..8af8c58d Binary files /dev/null and b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Song_of_Storms.mp3 differ diff --git a/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Song_of_Time.mp3 b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Song_of_Time.mp3 new file mode 100644 index 00000000..55a240f6 Binary files /dev/null and b/Full/system/media/audio/ringtones/The_Legend_of_Zelda_Song_of_Time.mp3 differ diff --git a/Full/system/media/audio/ui/Lock.ogg b/Full/system/media/audio/ui/Lock.ogg new file mode 100644 index 00000000..960ea8a9 Binary files /dev/null and b/Full/system/media/audio/ui/Lock.ogg differ diff --git a/Full/system/media/audio/ui/LowBattery.ogg b/Full/system/media/audio/ui/LowBattery.ogg new file mode 100644 index 00000000..d4bb2b7b Binary files /dev/null and b/Full/system/media/audio/ui/LowBattery.ogg differ diff --git a/Full/system/media/audio/ui/Unlock.ogg b/Full/system/media/audio/ui/Unlock.ogg new file mode 100644 index 00000000..68852d94 Binary files /dev/null and b/Full/system/media/audio/ui/Unlock.ogg differ diff --git a/Full/system/xbin/aapt.arm b/Full/system/xbin/aapt.arm new file mode 100755 index 00000000..f04c43ec Binary files /dev/null and b/Full/system/xbin/aapt.arm differ diff --git a/Full/system/xbin/aapt.x86 b/Full/system/xbin/aapt.x86 new file mode 100755 index 00000000..915a0442 Binary files /dev/null and b/Full/system/xbin/aapt.x86 differ diff --git a/Full/system/xbin/bash b/Full/system/xbin/bash new file mode 100755 index 00000000..2ffa01a6 --- /dev/null +++ b/Full/system/xbin/bash @@ -0,0 +1,21 @@ +#!/system/bin/sh +# bash: wrapper to set up and run bash from terminal +# osm0sis @ xda-developers +# adopted to GNU Bash setialpha @ xda-developers + +dir="$(cd "$(dirname "$0")"; pwd)" + +if [ "$1" == "--term" ]; then + term=$2; + shift 2; +else + term=xterm +fi + +clear # empty the buffer + +# correct the terminal size ; +# some OS' don't ship `resize` +resize >/dev/null + +${dir}/bash.bin --rcfile /system/etc/bashrc $* diff --git a/Full/system/xbin/bash.bin.arm b/Full/system/xbin/bash.bin.arm new file mode 100755 index 00000000..808a68b8 Binary files /dev/null and b/Full/system/xbin/bash.bin.arm differ diff --git a/Full/system/xbin/bash.bin.x86 b/Full/system/xbin/bash.bin.x86 new file mode 100755 index 00000000..6b4d514a Binary files /dev/null and b/Full/system/xbin/bash.bin.x86 differ diff --git a/Full/system/xbin/bashbug.arm b/Full/system/xbin/bashbug.arm new file mode 100755 index 00000000..e434049c --- /dev/null +++ b/Full/system/xbin/bashbug.arm @@ -0,0 +1,272 @@ +#!/system/bin/sh - +# +# bashbug - create a bug report and mail it to the bug address +# +# The bug address depends on the release status of the shell. Versions +# with status `devel', `alpha', `beta', or `rc' mail bug reports to +# chet@cwru.edu and, optionally, to bash-testers@cwru.edu. +# Other versions send mail to bug-bash@gnu.org. +# +# Copyright (C) 1996-2004 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# +# configuration section: +# these variables are filled in by the make target in Makefile +# +MACHINE="arm" +OS="linux-androideabi" +CC="arm-linux-androideabi-gcc" +CFLAGS=" -DPROGRAM='bash' -DCONF_HOSTTYPE='arm' -DCONF_OSTYPE='linux-androideabi' -DCONF_MACHTYPE='arm-unknown-linux-androideabi' -DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/local/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I/storage/projects/NanoMod/bash-on-android/bash-4.4 -I/storage/projects/NanoMod/bash-on-android/bash-4.4/include -I/storage/projects/NanoMod/bash-on-android/bash-4.4/lib -g -O2 -Wno-parentheses -Wno-format-security" +RELEASE="4.4" +PATCHLEVEL="12" +RELSTATUS="release" +MACHTYPE="arm-unknown-linux-androideabi" + +PATH=/bin:/usr/bin:/usr/local/bin:$PATH +export PATH + +# Check if TMPDIR is set, default to /tmp +: ${TMPDIR:=/tmp} + +#Securely create a temporary directory for the temporary files +TEMPDIR=$TMPDIR/bbug.$$ +(umask 077 && mkdir $TEMPDIR) || { + echo "$0: could not create temporary directory" >&2 + exit 1 +} + +TEMPFILE1=$TEMPDIR/bbug1 +TEMPFILE2=$TEMPDIR/bbug2 + +USAGE="Usage: $0 [--help] [--version] [bug-report-email-address]" +VERSTR="GNU bashbug, version ${RELEASE}.${PATCHLEVEL}-${RELSTATUS}" + +do_help= do_version= + +while [ $# -gt 0 ]; do + case "$1" in + --help) shift ; do_help=y ;; + --version) shift ; do_version=y ;; + --) shift ; break ;; + -*) echo "bashbug: ${1}: invalid option" >&2 + echo "$USAGE" >&2 + exit 2 ;; + *) break ;; + esac +done + +if [ -n "$do_version" ]; then + echo "${VERSTR}" + exit 0 +fi + +if [ -n "$do_help" ]; then + echo "${VERSTR}" + echo "${USAGE}" + echo + cat << HERE_EOF +Bashbug is used to send mail to the Bash maintainers +for when Bash doesn't behave like you'd like, or expect. + +Bashbug will start up your editor (as defined by the shell's +EDITOR environment variable) with a preformatted bug report +template for you to fill in. The report will be mailed to the +bug-bash mailing list by default. See the manual for details. + +If you invoke bashbug by accident, just quit your editor without +saving any changes to the template, and no bug report will be sent. +HERE_EOF + exit 0 +fi + +# Figure out how to echo a string without a trailing newline +N=`echo 'hi there\c'` +case "$N" in +*c) n=-n c= ;; +*) n= c='\c' ;; +esac + +BASHTESTERS="bash-testers@cwru.edu" + +case "$RELSTATUS" in +alpha*|beta*|devel*|rc*) BUGBASH=chet@cwru.edu ;; +*) BUGBASH=bug-bash@gnu.org ;; +esac + +case "$RELSTATUS" in +alpha*|beta*|devel*|rc*) + echo "$0: This is a testing release. Would you like your bug report" + echo "$0: to be sent to the bash-testers mailing list?" + echo $n "$0: Send to bash-testers? $c" + read ans + case "$ans" in + y*|Y*) BUGBASH="${BUGBASH},${BASHTESTERS}" ;; + esac ;; +esac + +BUGADDR="${1-$BUGBASH}" + +if [ -z "$DEFEDITOR" ] && [ -z "$EDITOR" ]; then + if [ -x /usr/bin/editor ]; then + DEFEDITOR=editor + elif [ -x /usr/local/bin/ce ]; then + DEFEDITOR=ce + elif [ -x /usr/local/bin/emacs ]; then + DEFEDITOR=emacs + elif [ -x /usr/contrib/bin/emacs ]; then + DEFEDITOR=emacs + elif [ -x /usr/bin/emacs ]; then + DEFEDITOR=emacs + elif [ -x /usr/bin/xemacs ]; then + DEFEDITOR=xemacs + elif [ -x /usr/contrib/bin/jove ]; then + DEFEDITOR=jove + elif [ -x /usr/local/bin/jove ]; then + DEFEDITOR=jove + elif [ -x /usr/bin/vi ]; then + DEFEDITOR=vi + else + echo "$0: No default editor found: attempting to use vi" >&2 + DEFEDITOR=vi + fi +fi + + +: ${EDITOR=$DEFEDITOR} + +: ${USER=${LOGNAME-`whoami`}} + +trap 'rm -rf "$TEMPDIR"; exit 1' 1 2 3 13 15 +trap 'rm -rf "$TEMPDIR"' 0 + +UN= +if (uname) >/dev/null 2>&1; then + UN=`uname -a` +fi + +if [ -f /usr/lib/sendmail ] ; then + RMAIL="/usr/lib/sendmail" + SMARGS="-i -t" +elif [ -f /usr/sbin/sendmail ] ; then + RMAIL="/usr/sbin/sendmail" + SMARGS="-i -t" +else + RMAIL=rmail + SMARGS="$BUGADDR" +fi + +INITIAL_SUBJECT='[50 character or so descriptive subject here (for reference)]' + +cat > "$TEMPFILE1" <> $HOME/dead.bashbug + echo "$0: mail to ${BUGADDR} failed: report saved in $HOME/dead.bashbug" >&2 + echo "$0: please send it manually to ${BUGADDR}" >&2 +} + +exit 0 diff --git a/Full/system/xbin/bashbug.x86 b/Full/system/xbin/bashbug.x86 new file mode 100755 index 00000000..b650f22e --- /dev/null +++ b/Full/system/xbin/bashbug.x86 @@ -0,0 +1,272 @@ +#!/bin/sh - +# +# bashbug - create a bug report and mail it to the bug address +# +# The bug address depends on the release status of the shell. Versions +# with status `devel', `alpha', `beta', or `rc' mail bug reports to +# chet@cwru.edu and, optionally, to bash-testers@cwru.edu. +# Other versions send mail to bug-bash@gnu.org. +# +# Copyright (C) 1996-2004 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# +# configuration section: +# these variables are filled in by the make target in Makefile +# +MACHINE="i686" +OS="linux-android" +CC="i686-linux-android-gcc" +CFLAGS=" -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-android' -DCONF_MACHTYPE='i686-pc-linux-android' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/local/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I/storage/projects/bash-on-android/bash-4.4 -I/storage/projects/bash-on-android/bash-4.4/include -I/storage/projects/bash-on-android/bash-4.4/lib -g -O2 -Wno-parentheses -Wno-format-security" +RELEASE="4.4" +PATCHLEVEL="12" +RELSTATUS="release" +MACHTYPE="i686-pc-linux-android" + +PATH=/bin:/usr/bin:/usr/local/bin:$PATH +export PATH + +# Check if TMPDIR is set, default to /tmp +: ${TMPDIR:=/tmp} + +#Securely create a temporary directory for the temporary files +TEMPDIR=$TMPDIR/bbug.$$ +(umask 077 && mkdir $TEMPDIR) || { + echo "$0: could not create temporary directory" >&2 + exit 1 +} + +TEMPFILE1=$TEMPDIR/bbug1 +TEMPFILE2=$TEMPDIR/bbug2 + +USAGE="Usage: $0 [--help] [--version] [bug-report-email-address]" +VERSTR="GNU bashbug, version ${RELEASE}.${PATCHLEVEL}-${RELSTATUS}" + +do_help= do_version= + +while [ $# -gt 0 ]; do + case "$1" in + --help) shift ; do_help=y ;; + --version) shift ; do_version=y ;; + --) shift ; break ;; + -*) echo "bashbug: ${1}: invalid option" >&2 + echo "$USAGE" >&2 + exit 2 ;; + *) break ;; + esac +done + +if [ -n "$do_version" ]; then + echo "${VERSTR}" + exit 0 +fi + +if [ -n "$do_help" ]; then + echo "${VERSTR}" + echo "${USAGE}" + echo + cat << HERE_EOF +Bashbug is used to send mail to the Bash maintainers +for when Bash doesn't behave like you'd like, or expect. + +Bashbug will start up your editor (as defined by the shell's +EDITOR environment variable) with a preformatted bug report +template for you to fill in. The report will be mailed to the +bug-bash mailing list by default. See the manual for details. + +If you invoke bashbug by accident, just quit your editor without +saving any changes to the template, and no bug report will be sent. +HERE_EOF + exit 0 +fi + +# Figure out how to echo a string without a trailing newline +N=`echo 'hi there\c'` +case "$N" in +*c) n=-n c= ;; +*) n= c='\c' ;; +esac + +BASHTESTERS="bash-testers@cwru.edu" + +case "$RELSTATUS" in +alpha*|beta*|devel*|rc*) BUGBASH=chet@cwru.edu ;; +*) BUGBASH=bug-bash@gnu.org ;; +esac + +case "$RELSTATUS" in +alpha*|beta*|devel*|rc*) + echo "$0: This is a testing release. Would you like your bug report" + echo "$0: to be sent to the bash-testers mailing list?" + echo $n "$0: Send to bash-testers? $c" + read ans + case "$ans" in + y*|Y*) BUGBASH="${BUGBASH},${BASHTESTERS}" ;; + esac ;; +esac + +BUGADDR="${1-$BUGBASH}" + +if [ -z "$DEFEDITOR" ] && [ -z "$EDITOR" ]; then + if [ -x /usr/bin/editor ]; then + DEFEDITOR=editor + elif [ -x /usr/local/bin/ce ]; then + DEFEDITOR=ce + elif [ -x /usr/local/bin/emacs ]; then + DEFEDITOR=emacs + elif [ -x /usr/contrib/bin/emacs ]; then + DEFEDITOR=emacs + elif [ -x /usr/bin/emacs ]; then + DEFEDITOR=emacs + elif [ -x /usr/bin/xemacs ]; then + DEFEDITOR=xemacs + elif [ -x /usr/contrib/bin/jove ]; then + DEFEDITOR=jove + elif [ -x /usr/local/bin/jove ]; then + DEFEDITOR=jove + elif [ -x /usr/bin/vi ]; then + DEFEDITOR=vi + else + echo "$0: No default editor found: attempting to use vi" >&2 + DEFEDITOR=vi + fi +fi + + +: ${EDITOR=$DEFEDITOR} + +: ${USER=${LOGNAME-`whoami`}} + +trap 'rm -rf "$TEMPDIR"; exit 1' 1 2 3 13 15 +trap 'rm -rf "$TEMPDIR"' 0 + +UN= +if (uname) >/dev/null 2>&1; then + UN=`uname -a` +fi + +if [ -f /usr/lib/sendmail ] ; then + RMAIL="/usr/lib/sendmail" + SMARGS="-i -t" +elif [ -f /usr/sbin/sendmail ] ; then + RMAIL="/usr/sbin/sendmail" + SMARGS="-i -t" +else + RMAIL=rmail + SMARGS="$BUGADDR" +fi + +INITIAL_SUBJECT='[50 character or so descriptive subject here (for reference)]' + +cat > "$TEMPFILE1" <> $HOME/dead.bashbug + echo "$0: mail to ${BUGADDR} failed: report saved in $HOME/dead.bashbug" >&2 + echo "$0: please send it manually to ${BUGADDR}" >&2 +} + +exit 0 diff --git a/Full/system/xbin/col.arm b/Full/system/xbin/col.arm new file mode 100755 index 00000000..2c5297f7 Binary files /dev/null and b/Full/system/xbin/col.arm differ diff --git a/Full/system/xbin/col.x86 b/Full/system/xbin/col.x86 new file mode 100755 index 00000000..aed585ec Binary files /dev/null and b/Full/system/xbin/col.x86 differ diff --git a/Full/system/xbin/colcrt.arm b/Full/system/xbin/colcrt.arm new file mode 100755 index 00000000..3fe41ede Binary files /dev/null and b/Full/system/xbin/colcrt.arm differ diff --git a/Full/system/xbin/colcrt.x86 b/Full/system/xbin/colcrt.x86 new file mode 100755 index 00000000..d613b7e5 Binary files /dev/null and b/Full/system/xbin/colcrt.x86 differ diff --git a/Full/system/xbin/colrm.arm b/Full/system/xbin/colrm.arm new file mode 100755 index 00000000..17b7a989 Binary files /dev/null and b/Full/system/xbin/colrm.arm differ diff --git a/Full/system/xbin/colrm.x86 b/Full/system/xbin/colrm.x86 new file mode 100755 index 00000000..c574dd4d Binary files /dev/null and b/Full/system/xbin/colrm.x86 differ diff --git a/Full/system/xbin/column.arm b/Full/system/xbin/column.arm new file mode 100755 index 00000000..b298018b Binary files /dev/null and b/Full/system/xbin/column.arm differ diff --git a/Full/system/xbin/column.x86 b/Full/system/xbin/column.x86 new file mode 100755 index 00000000..3f7d6e51 Binary files /dev/null and b/Full/system/xbin/column.x86 differ diff --git a/Full/system/xbin/findfs.arm b/Full/system/xbin/findfs.arm new file mode 100755 index 00000000..716f0f6e Binary files /dev/null and b/Full/system/xbin/findfs.arm differ diff --git a/Full/system/xbin/findfs.x86 b/Full/system/xbin/findfs.x86 new file mode 100755 index 00000000..716f0f6e Binary files /dev/null and b/Full/system/xbin/findfs.x86 differ diff --git a/Full/system/xbin/findmnt.arm b/Full/system/xbin/findmnt.arm new file mode 100755 index 00000000..8f12e030 Binary files /dev/null and b/Full/system/xbin/findmnt.arm differ diff --git a/Full/system/xbin/findmnt.x86 b/Full/system/xbin/findmnt.x86 new file mode 100755 index 00000000..8f12e030 Binary files /dev/null and b/Full/system/xbin/findmnt.x86 differ diff --git a/Full/system/xbin/hexdump.arm b/Full/system/xbin/hexdump.arm new file mode 100755 index 00000000..49edc581 Binary files /dev/null and b/Full/system/xbin/hexdump.arm differ diff --git a/Full/system/xbin/hexdump.x86 b/Full/system/xbin/hexdump.x86 new file mode 100755 index 00000000..fbbb7bcf Binary files /dev/null and b/Full/system/xbin/hexdump.x86 differ diff --git a/Full/system/xbin/less b/Full/system/xbin/less new file mode 100755 index 00000000..990f550d --- /dev/null +++ b/Full/system/xbin/less @@ -0,0 +1,23 @@ +#!/system/bin/sh +# less: wrapper to set up and run less from terminal +# osm0sis @ xda-developers +# adopted to less setialpha @ xda-developers + +dir="$(cd "$(dirname "$0")"; pwd)" + +if [ "$1" == "--term" ]; then + term=$2 + shift 2 +else + term=xterm +fi + +clear # empty the buffer + +# correct the terminal size ; +# some OS' don't ship `resize` +resize &>/dev/null + +[[ -d /system/etc/terminfo ]] && \ + export TERMINFO=/system/etc/terminfo +TERM=$term ${dir}/less.bin $* diff --git a/Full/system/xbin/less.bin.arm b/Full/system/xbin/less.bin.arm new file mode 100755 index 00000000..9acf32ed Binary files /dev/null and b/Full/system/xbin/less.bin.arm differ diff --git a/Full/system/xbin/less.bin.x86 b/Full/system/xbin/less.bin.x86 new file mode 100755 index 00000000..9f6b8eaa Binary files /dev/null and b/Full/system/xbin/less.bin.x86 differ diff --git a/Full/system/xbin/lessecho.arm b/Full/system/xbin/lessecho.arm new file mode 100755 index 00000000..6f3be64f Binary files /dev/null and b/Full/system/xbin/lessecho.arm differ diff --git a/Full/system/xbin/lessecho.x86 b/Full/system/xbin/lessecho.x86 new file mode 100755 index 00000000..8a2be7e1 Binary files /dev/null and b/Full/system/xbin/lessecho.x86 differ diff --git a/Full/system/xbin/lesskey.arm b/Full/system/xbin/lesskey.arm new file mode 100755 index 00000000..52bde552 Binary files /dev/null and b/Full/system/xbin/lesskey.arm differ diff --git a/Full/system/xbin/lesskey.x86 b/Full/system/xbin/lesskey.x86 new file mode 100755 index 00000000..3b4002e1 Binary files /dev/null and b/Full/system/xbin/lesskey.x86 differ diff --git a/Full/system/xbin/look.arm b/Full/system/xbin/look.arm new file mode 100755 index 00000000..f3a00c9f Binary files /dev/null and b/Full/system/xbin/look.arm differ diff --git a/Full/system/xbin/look.x86 b/Full/system/xbin/look.x86 new file mode 100755 index 00000000..c44aa84d Binary files /dev/null and b/Full/system/xbin/look.x86 differ diff --git a/Full/system/xbin/lsblk.arm b/Full/system/xbin/lsblk.arm new file mode 100755 index 00000000..4cce3f85 Binary files /dev/null and b/Full/system/xbin/lsblk.arm differ diff --git a/Full/system/xbin/lsblk.x86 b/Full/system/xbin/lsblk.x86 new file mode 100755 index 00000000..4cce3f85 Binary files /dev/null and b/Full/system/xbin/lsblk.x86 differ diff --git a/Full/system/xbin/lscpu.arm b/Full/system/xbin/lscpu.arm new file mode 100755 index 00000000..c3e81c8a Binary files /dev/null and b/Full/system/xbin/lscpu.arm differ diff --git a/Full/system/xbin/lscpu.x86 b/Full/system/xbin/lscpu.x86 new file mode 100755 index 00000000..c3e81c8a Binary files /dev/null and b/Full/system/xbin/lscpu.x86 differ diff --git a/Full/system/xbin/lsipc.arm b/Full/system/xbin/lsipc.arm new file mode 100755 index 00000000..9115bf59 Binary files /dev/null and b/Full/system/xbin/lsipc.arm differ diff --git a/Full/system/xbin/lsipc.x86 b/Full/system/xbin/lsipc.x86 new file mode 100755 index 00000000..9115bf59 Binary files /dev/null and b/Full/system/xbin/lsipc.x86 differ diff --git a/Full/system/xbin/lslocks.arm b/Full/system/xbin/lslocks.arm new file mode 100755 index 00000000..ad731834 Binary files /dev/null and b/Full/system/xbin/lslocks.arm differ diff --git a/Full/system/xbin/lslocks.x86 b/Full/system/xbin/lslocks.x86 new file mode 100755 index 00000000..ad731834 Binary files /dev/null and b/Full/system/xbin/lslocks.x86 differ diff --git a/Full/system/xbin/lsns.arm b/Full/system/xbin/lsns.arm new file mode 100755 index 00000000..38aa4484 Binary files /dev/null and b/Full/system/xbin/lsns.arm differ diff --git a/Full/system/xbin/lsns.x86 b/Full/system/xbin/lsns.x86 new file mode 100755 index 00000000..38aa4484 Binary files /dev/null and b/Full/system/xbin/lsns.x86 differ diff --git a/Full/system/xbin/nano b/Full/system/xbin/nano new file mode 100755 index 00000000..d3805f9c --- /dev/null +++ b/Full/system/xbin/nano @@ -0,0 +1,22 @@ +#!/system/bin/sh +# nano: wrapper to set up and run nano from terminal +# osm0sis @ xda-developers + +dir="$(cd "$(dirname "$0")"; pwd)" + +if [ "$1" == "--term" ]; then + term=$2; + shift 2; +else + term=xterm +fi + +clear # empty the buffer + +# correct the terminal size ; +# some OS' don't ship `resize` +resize >/dev/null + +[[ -d /system/etc/terminfo ]] && \ + export TERMINFO=/system/etc/terminfo +TERM=$term ${dir}/nano.bin $* diff --git a/Full/system/xbin/nano.bin b/Full/system/xbin/nano.bin new file mode 100755 index 00000000..1b618e7a Binary files /dev/null and b/Full/system/xbin/nano.bin differ diff --git a/Full/system/xbin/nanodroid-overlay b/Full/system/xbin/nanodroid-overlay new file mode 100755 index 00000000..3829f11d --- /dev/null +++ b/Full/system/xbin/nanodroid-overlay @@ -0,0 +1,475 @@ +#!@MODPATH@/system/xbin/bash + +if [[ $(whoami) != "root" ]]; then + echo "not running as root, exiting" + exit 1 +fi + +export NO_MAGISK=0 +export NO_CONFIG=0 +export MODPATH=@MODPATH@ +export PATH="${PATH}:${MODPATH}/system/bin" + +if [[ -d /dev/tmp/magisk_img/$(basename ${MODPATH}) ]]; then + OVERLAY_PATH=/dev/tmp/magisk_img/$(basename ${MODPATH}) +elif [[ -d /dev/magisk_merge/$(basename ${MODPATH}) ]]; then + OVERLAY_PATH=/dev/magisk_merge/$(basename ${MODPATH}) +else + OVERLAY_PATH=${MODPATH} + [[ "${MODPATH}" != "/sbin/.core/"* ]] && NO_MAGISK=1 +fi + +# Permissions +perm_fake="android.permission.FAKE_PACKAGE_SIGNATURE" +perm_calr="android.permission.READ_CALENDAR" +perm_calw="android.permission.WRITE_CALENDAR" +perm_conr="android.permission.READ_CONTACTS" +perm_conw="android.permission.WRITE_CONTACTS" +perm_gacc="android.permission.GET_ACCOUNTS" + +# Packages +microG="com.google.android.gms" +PlayStore="com.android.vending" +GCalSync="com.google.android.syncadapters.calendar" +GConSync="com.google.android.syncadapters.contacts" + +get_config () { + config="" + config_exists=0 + for path in ${config_locations}; do + if test -r "${path}/${1}" -a -f "${path}/${1}"; then + config="${path}/${1}" + config_exists=1 + return + fi + done +} + +show_app_name () { + aapt dump badging "${1}" 2>/dev/null | \ + grep "application: label" | \ + sed -e "s/.*label='//g;s/' icon.*//g" +} + +add_override () { + echo " creating overlay: $(basename ${1})" + mkdir -p "${OVERLAY_PATH}/system/${1}" + touch "${OVERLAY_PATH}/system/${1}/.replace" +} + +rm_override () { + xapp=$(basename ${1}) + echo " removing overlay: ${xapp}" + rm -rf "${OVERLAY_PATH}/system/${1}" + sed -e "/^${xapp}$/d" -i "${config}" +} + +update_overrides () { + clear_overrides + gen_overrides +} + +gen_overrides () { + OVERLAY_APPS=$(cat "${config}") + + echo " creating Overlays in ${OVERLAY_PATH}" + + for app in ${OVERLAY_APPS}; do + if [ -d /system/app/${app} ]; then + add_override "app/${app}" ${OVERLAY_PATH} + elif [ -d /system/priv-app/${app} ]; then + add_override "priv-app/${app}" ${OVERLAY_PATH} + else echo " app \"${app}\" is not installed" + fi + done +} + +list_overrides () { + LIST_APPS=($(find "${OVERLAY_PATH}/system/app" -name "*.replace")) + for app in "${LIST_APPS[@]}"; do + APPS=(${APPS[@]} "$(basename $(dirname "${app}"))") + done + + LIST_PRIV_APPS=($(find "${OVERLAY_PATH}/system/priv-app" -name "*.replace")) + for app in "${LIST_PRIV_APPS[@]}"; do + PRIV_APPS=(${PRIV_APPS[@]} "$(basename $(dirname "${app}"))") + done + + echo "Overlays exist for following applications in /system/app: + +$(printf ' * %s\n' "${APPS[@]}") + +Overlays exist for following applications in /system/priv-app: + +$(printf ' * %s\n' "${PRIV_APPS[@]}") +" +} + +show_nooverrides () { + echo " >> processing /system/app" + + for app in /system/app/*/*.apk; do + sysname=$(basename "${app}" .apk) + if [[ ! -f ${OVERLAY_PATH}/system/app/${sysname}/.replace ]]; then + humname=$(show_app_name "${app}") + S_APPS="${S_APPS} + * ${sysname} |(${humname})" + fi + done + + echo " >> processing /system/priv-app" + + for app in /system/priv-app/*/*.apk; do + sysname=$(basename "${app}" .apk) + if [[ ! -f ${OVERLAY_PATH}/system/priv-app/${sysname}/.replace ]]; then + humname=$(show_app_name "${app}") + S_PRIV_APPS="${S_PRIV_APPS} + * ${sysname} |(${humname})" + fi + done + + echo "Non-Overlayed applications in /system/app: + +$(printf '* %s\n' "${S_APPS[@]}" | column -t -s \|) + +Non-Overlayed applications in /system/priv-app: + +$(printf '* %s\n' "${S_PRIV_APPS[@]}" | column -t -s \|) +" +} + +clear_overrides () { + echo " removing Overlays from ${OVERLAY_PATH}" + RM_APPS=($(find "${OVERLAY_PATH}/system/app" -name "*.replace")) + for app in "${RM_APPS[@]}"; do + echo " removing override: $(basename $(dirname ${app}))" + rm -rf "$(dirname "${app}")" + done + + RM_PRIV_APPS=($(find "${OVERLAY_PATH}/system/priv-app" -name "*.replace")) + for app in "${RM_PRIV_APPS[@]}"; do + echo " removing override: $(basename $(dirname ${app}))" + rm -rf "$(dirname "${app}")" + done +} + +genconfig () { + [[ ! -f "${config}" ]] && config="/data/.nanodroid-overlay" + + APPS=($(find "${OVERLAY_PATH}/system/app" -name "*.replace")) + PRIV_APPS=($(find "${OVERLAY_PATH}/system/priv-app" -name "*.replace")) + + if [[ ${APPS[*]} != "" ]]; then + for app in "${APPS[@]}"; do + xapp=$(basename $(dirname ${app})) + echo " adding ${xapp} to configuration" + echo "${xapp}" >> "${config}" + done + fi + + if [[ ${PRIV_APPS[*]} != "" ]]; then + for app in "${PRIV_APPS[@]}"; do + xapp=$(basename $(dirname ${app})) + echo " adding ${xapp} to configuration" + echo "${xapp}" >> "${config}" + done + fi +} + +check_package () { + [[ $(grep "^${1} " /data/system/packages.list) ]] && return 0 || return 1 +} + +check_permission () { + [[ $(dumpsys package ${1} | grep -Eo "^[ ]+${2}: granted=true") ]] && return 0 || return 1 +} + +grant_permission () { + pm grant ${1} ${2} 2>/dev/null +} + +permissions () { + if check_package ${1}; then + echo "package ${1} found" + if ! check_permission ${1} ${2}; then + grant_permission ${1} ${2} && \ + echo "permission ${2} granted" || \ + echo "failed to grant permission ${2}" + else echo "already has permission ${2}" + fi + fi +} + +add_prop () { + [[ ! -f ${MODPATH}/system.prop ]] && \ + touch ${MODPATH}/system.prop + + resetprop ${1} ${2} + + sed "/^${1}/d" -i ${MODPATH}/system.prop + echo "${1}=${2}" >> "${MODPATH}/system.prop" +} + +remove_prop () { + [[ -f ${MODPATH}/system.prop ]] && \ + sed "/^${1}/d" -i ${MODPATH}/system.prop +} + +list_props () { + if [[ ! -f ${MODPATH}/system.prop ]]; then + echo "no properties added by NanoDroid" + else echo "properties added by NanoDroid:" + cat ${MODPATH}/system.prop | column -t -s"=" + fi +} + +# see: https://www.xda-developers.com/broken-navigation-bar-lock-screen-ota-update/ +update_fix () { + settings put global device_provisioned 1 && \ + settings put secure user_setup_complete 1 +} + +boot_count () { + settings get global boot_count +} + +airplane_mode () { + clear + + disabled_radios="" + toggable_radios="wifi,cell,bluetooth,nfc,wimax," + + echo "enter desired radions [first column] space separated + +wifi WiFi/WLAN +cell cellular/mobile Network +bluetooth Bluetooth +nfc NFC +wimax WiMAX" + read -r user_input + + for field in ${user_input}; do + case ${field} in + wifi | cell | bluetooth | nfc | wimax ) + disabled_radios="${field},${disabled_radios}" + toggable_radios=$(echo "${toggable_radios}" | sed "s/${field},//g") + ;; + * ) + echo "${field} is unknown" + ;; + esac + done + + settings put global airplane_mode_radios ${disabled_radios} + settings put global airplane_mode_toggleable_radios ${toggable_radios} +} + +audio_focus () { + cmd appops set ${1} TAKE_AUDIO_FOCUS ignore +} + +read_clipboard () { + cmd appops set ${1} READ_CLIPBOARD ignore +} + +# check for configuration files +config_locations="/sdcard /external_sd @ZIPDIR@ /data /dev/tmp/install" +get_config .nanodroid-overlay + +if [[ ${NO_MAGISK} -eq 0 ]]; then + +if [[ -f ${config} ]]; then + export config +else + genconfig + export config="/data/.nanodroid-overlay" +fi + +case ${1} in + -l | --list ) + list_overrides + ;; + + -a | --add ) + if [ ! -z ${2} ]; then + if [[ -d /system/app/${2} ]]; then + add_override "app/${2}" + echo "${2}" >> "${config}" + elif [[ -d /system/priv-app/${2} ]]; then + add_override "priv-app/${2}" + echo "${2}" >> "${config}" + else echo "app \"${2}\" is not installed" + fi + fi + ;; + + -r | --remove ) + if [ ! -z ${2} ]; then + if [[ -f ${OVERLAY_PATH}/system/app/${2}/.replace ]]; then + rm_override "app/${2}" + elif [[ -f ${OVERLAY_PATH}/system/priv-app/${2}/.replace ]]; then + rm_override "priv-app/${2}" + else echo "No override for \"${2}\" found" + fi + fi + ;; + + -u | --update ) + update_overrides + ;; + + -s | --show ) + show_nooverrides + ;; + + -c | --clear ) + clear_overrides + ;; + + -g | --genconfig ) + rm -f ${config} + genconfig + ;; + + -x | --create ) + gen_overrides + ;; + + -p | --permission ) + # microG and Play Store + permissions ${microG} ${perm_fake} + permissions ${PlayStore} ${perm_fake} + + # Google Calendar Sync + permissions ${GCalSync} ${perm_calr} + permissions ${GCalSync} ${perm_calw} + + # Google Contacts Sync + permissions ${GConSync} ${perm_conr} + permissions ${GConSync} ${perm_conw} + permissions ${GConSync} ${perm_gacc} + ;; + + -C | --cast ) + add_prop persist.debug.wfd.enable 1 + ;; + + -A | --add-prop ) + if [ ! -z ${2} -a ! -z ${3} ]; then + add_prop "${2}" "${3}" + fi + ;; + + -R | --remove-prop ) + if [ ! -z ${2} ]; then + remove_prop "${2}" + fi + ;; + + -L | --list-props ) + list_props + ;; + + -f | --fix-update ) + update_fix + ;; + + -P | --airplane-mode ) + airplane_mode + ;; + + -b | --boot-count ) + boot_count + ;; + + -F | --audio-focus ) + audio_focus "${2}" + ;; + + -b | --read-clipboard ) + read_clipboard "${2}" + ;; + + * ) + echo "nanodroid-overlay helper script + +Options: +-a | --add [appname] add override for app [appname] +-r | --remove [appname] remove override for app [appname] +-s | --show show non-overriden /system applications +-l | --list show all overriden /system applications +-x | --create create all overrides +-u | --update update all overrides (= clear + create) +-c | --clear remove all overrides +-g | --genconfig (re-)create configuration from existing overrides +-p | --permission grant signature spoofing permission to + microG GmsCore and Play Store +-C | --cast enable cast [fix for a few custom ROMS] +-A | --add-prop [prop] [value] add system property set by NanoDroid +-R | --remove-prop [prop] remove system property set by NanoDroid +-L | --list-prop list system properties set by NanoDroid +-f | --fix-update fix navbar, lockscreen, statusbar after OTA update +-P | --airplane-mode change airplane mode settings +-F | --audio-focus prevent an app from stealing audio focus +-b | --boot-count read boot counts (Android 7+) +-B | --read-clipboard prevent an app from reading the clipboard +-h | --help this message" + ;; +esac + +else + +case ${1} in + -p | --permission ) + # microG and Play Store + permissions ${microG} ${perm_fake} + permissions ${PlayStore} ${perm_fake} + + # Google Calendar Sync + permissions ${GCalSync} ${perm_calr} + permissions ${GCalSync} ${perm_calw} + + # Google Contacts Sync + permissions ${GConSync} ${perm_conr} + permissions ${GConSync} ${perm_conw} + permissions ${GConSync} ${perm_gacc} + ;; + + -f | --fix-update ) + update_fix + ;; + + -b | --boot-count ) + boot_count + ;; + + -P | --airplane-mode ) + airplane_mode + ;; + + -F | --audio-focus ) + audio_focus "${2}" + ;; + + -b | --read-clipboard ) + read_clipboard "${2}" + ;; + + * ) + echo "nanodroid-overlay helper script + +*** SYSTEM MODE! LIMITED FUNCTIONALITY! *** + +Options: +-p | --permission grant signature spoofing permission to + microG GmsCore and Play Store +-f | --fix-update fix navbar, lockscreen, statusbar after OTA update +-P | --airplane-mode change airplane mode settings +-F | --audio-focus prevent an app from stealing audio focus +-b | --boot-count read boot counts (Android 7+) +-B | --read-clipboard prevent an app from reading the clipboard +-h | --help this message" + ;; +esac + +fi diff --git a/Full/system/xbin/ncal.arm b/Full/system/xbin/ncal.arm new file mode 100755 index 00000000..6ea737ca Binary files /dev/null and b/Full/system/xbin/ncal.arm differ diff --git a/Full/system/xbin/ncal.x86 b/Full/system/xbin/ncal.x86 new file mode 100755 index 00000000..c3675a3c Binary files /dev/null and b/Full/system/xbin/ncal.x86 differ diff --git a/Full/system/xbin/novl b/Full/system/xbin/novl new file mode 100755 index 00000000..f3934328 --- /dev/null +++ b/Full/system/xbin/novl @@ -0,0 +1,4 @@ +#!@MODPATH@/system/xbin/bash + +# just call nanodroid-overlay +nanodroid-overlay "${@}" diff --git a/Full/system/xbin/setterm.arm b/Full/system/xbin/setterm.arm new file mode 100755 index 00000000..6c1d81a3 Binary files /dev/null and b/Full/system/xbin/setterm.arm differ diff --git a/Full/system/xbin/setterm.x86 b/Full/system/xbin/setterm.x86 new file mode 100755 index 00000000..6c1d81a3 Binary files /dev/null and b/Full/system/xbin/setterm.x86 differ diff --git a/Full/system/xbin/unzip.arm b/Full/system/xbin/unzip.arm new file mode 100755 index 00000000..9dfc4f0a Binary files /dev/null and b/Full/system/xbin/unzip.arm differ diff --git a/Full/system/xbin/unzip.x86 b/Full/system/xbin/unzip.x86 new file mode 100755 index 00000000..00d6283f Binary files /dev/null and b/Full/system/xbin/unzip.x86 differ diff --git a/Full/system/xbin/whereis.arm b/Full/system/xbin/whereis.arm new file mode 100755 index 00000000..54ce6e0e Binary files /dev/null and b/Full/system/xbin/whereis.arm differ diff --git a/Full/system/xbin/whereis.x86 b/Full/system/xbin/whereis.x86 new file mode 100755 index 00000000..6817f1b1 Binary files /dev/null and b/Full/system/xbin/whereis.x86 differ diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..44325404 --- /dev/null +++ b/LICENSE @@ -0,0 +1,676 @@ + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. + diff --git a/README.md b/README.md new file mode 100644 index 00000000..2e640d40 --- /dev/null +++ b/README.md @@ -0,0 +1,427 @@ +# NanoDroid + +## Current Stable Release + +15.1.20180119 + +## Downloads + +* Stable Downloads [> Androidfilehost](https://www.androidfilehost.com/f/NanoMod_Stable) + * Archived Stable Downloads [> Androidfilehost](https://www.androidfilehost.com/f/NanoMod_StableArchive) +* Beta Downloads [> Androidfilehost](https://www.androidfilehost.com/f/NanoMod_Beta) + * Archived Beta Downloads [> Androidfilehost](https://www.androidfilehost.com/f/NanoMod_BetaArchive) +* Snapshot + * on GNU/Linux, MacOS or *BSD clone this repository and use the provided `build-package` script like + * first step: + * `build-package pull` to download all required apks for Full, microG and F-Droid package + * second step: + * `build-package full` to create the full package + * `build-package microg` to create the microG only package + * `build-package fdroid` to create the F-Droid only package + * `build-package patcher` to create the on-device framework-patcher package + * `build-package uninstaller` to create the uninstaller package + * `build-package setupwizard` to create the Setup Wizard package + * `build-package all` to create all packages at once + * third step: + * `build-package u-microg` to update microG + * `build-package u-fdroid` to update F-Droid + * `build-package u-apps` to update (most) applications + * `build-package u-swipe` to update swipe libraries + * `build-package u-gsync` to update Google Sync Adapters + * `build-package pull` to update/re-download everything + +for apks downloaded from F-Droid or microG repository or from APK Mirror, `build-package` checks the SHA256 hash. + +The `build-package` script additionally supports the following parameters: + +* `check` check if all files were properly downloaded +* `clean` remove any untracked files from the repo (e. g. from `build-package pull`) +* `dalvik [.jar]` prepare a jar file for use with DalvikVM +* `ver [version] [date]` change project version +* `bump` increment Magisk module version by 1 + +the `build-package` script does not download/update the following applications: + +* Play Store (reason: re-signed and modified to support (in-)app-purchases with microG GmsCore) +* Fake Store (reason: built with CHECK_LICENSE permission) +* MPV (reason: last F-Droid build outdated) +* OpenLauncher (reason: last F-Droid build outdated) + +those are still included in the repo itself. Also `build-package` now looks if the configuration files + +* `.nanodroid-setup` +* `.nanodroid-apps` +* `.nanodroid-overlay` + +exist in the `data` directory of the repository, if so, those files are used when creating packages instead of the default ones. + +See the documentation below for more information on those files and what they do. + +## Supported Android Versions + +NanoDroid officially supports the following Android versions: + +* 4.4 / SDK 19 (KitKat) + * System Mode only (Magisk does not support KitKat) +* 5.0 / SDK 21 (Lollipop) +* 5.1 / SDK 22 (Lollipop) +* 6.0 / SDK 23 (Marshmallow) +* 7.0 / SDK 24 (Nougat) +* 7.1 / SDK 25 (Nougat) +* 8.0 / SDK 26 (Oreo) +* 8.1 / SDK 27 (Oreo) + +earlier versions will never officially be supported (you may still report bugs, though). + +Future versions will be officially supported, eventually. + +## Support + +[> XDA](https://forum.xda-developers.com/apps/magisk/module-nanodroid-5-0-20170405-microg-t3584928) Support Thread + +## ChangeLog + +Full, user-readible [> ChangeLog](ChangeLog.md) + +## Summary + +**NanoDroid** can be installed as a Magisk Module or directly to /system, though a bit functionality is only available with Magisk. + +More information about Magisk [> XDA](https://forum.xda-developers.com/apps/magisk) + +NanoDroid includes + +* microG and it's companions + * on-device framework-patcher for microG support (signature spoofing) + * on-pc framework-patcher for microG support (signature spoofing) +* F-Droid and it's privileged extension +* modified Play Store to allow (in-)app-purchases with microG + * this required the Play Store to be modified, see the [> patch](doc/Phonesky.diff) + * alternatively Yalp Store can be installed instead +* custom init scripts +* pseudo-debloat feature (Magisk-only) + * disables applications systemless-ly + * pre-configured [> default settings](doc/PseudoDebloat.md) +* several Open Source applications + * include replacements for the pseudo-debloated applications + * full list of [> included applications](doc/Applications.md) +* additional components + * GNU Bash shell + * GNU Nano terminal editor + * several utilities from `util-linux`, `bsdmainutils` and more +* The Legend of Zelda ringtones and sounds + +## Packages + +### Modules + +Module packages, flashing through TWRP recommended, though flashing through Magisk Manager works aswell. + +* **NanoDroid**: includes + * everything mentioned in the Summary +* **NanoDroid-microG**: includes + * microG and it's companions + * GNU Bash + * pseudo-debloat feature + * app store(s) +* **NanoDroid-fdroid**: includes + * F-Droid and it's privileged extension + +### Extras + +Extra packages, always flash through TWRP. + +* **NanoDroid-patcher**: includes + * on-device framework-patcher for signature spoofing support + * optionally can patch user interface for it into Developer Settings + * creates the file `/data/adb/.nanodroid-patcher` after successful patching + * installs an addon.d script for automatic re-patching after ROM update + * addon.d support files reside in `/data/adb/nanodroid-patcher/` + * the original, unpatched `services.jar` (and optionally `Settings.apk`) are backed up to `/sdcard/` + * respectively `SecSettings.apk` on TouchWiz ROMs +* **NanoDroid-setupwizard**: includes + * **AROMA** based Setup Wizard to create the configuration files + * user can choose where to store the configuration files + * `/sdcard` + * `/external_sd` + * `/data` (fallback) + * **NOTE:** AROMA only works on `arm` and `arm64`, if your device is `x86` or `x86_64`, it won't work +* **NanoDroid-uninstaller**: includes + * uninstalls *all* NanoDroid Magisk Modules + * uninstalls NanoDroid installed in System Mode + * uninstalls NanoDroid configuration files + * uninstalls NanoDroid-Patcher addon.d environment + * if `services.jar` or `Settings.apk` backups are found they get restored + * respectively `SecSettings.apk` or `SecSettings2.apk` on TouchWiz ROMs + * if `com.qualcomm.location` backup is found it gets restored + +### Scripts + +Misc. Script for use from PC/Notebook, while device is in TWRP. + +* **framework-patcher** (clone this repository) + * on-pc framework-patcher for signature spoofing support + * creates the file `/data/adb/.nanodroid-patcher` after successful patching + * invoke like `framework-patcher [ver] [--gui]` + * where [ver] is your Android version (6.0, 7.1, ...) + * where `--gui` is an optional switch to patch a global toggle for signature spoofing into Developer Settings + * the original, unpatched `services.jar` (and optionally `Settings.apk`) are backed up to `/sdcard/` + * respectively `SecSettings.apk` on TouchWiz ROMs +* **force-debloat** (clone this repository) + * system debloater + * the list of applications resides in the script itself + * needs to be run from TWRP, requires explicit user acceptance + * supports `.nanodroid-overlay` configuration file + * uses fallback values, if none found + * which are in the script itself and can be edited + * has a test mode which prints what would be done +* **mount-magisk** (clone this repository) + * script to mount or unmount Magisk in TWRP + * script toggles mount-state (read: will mount Magisk if unmounted and unmount Magisk if mounted) + +## Details + +### NanoDroid + +This lists features unique to NanoDroid. + +#### nanodroid-overlay + +The `nanodroid-overlay` script handles the following features + +* pseudo-debloat (Magisk-only) + * show the list of pseudo-debloated apps + * add or remove apps from the list of pseudo-debloated apps +* add system properties (Magisk-only) +* grant signature spoofing permission to microG and Play Store if required + * both in Magisk and System Mode +* issue `nanodroid-overlay --help` for the full list of options + +Full details on the nanodroid-overlay Script [> Details](doc/NanoDroidOverlay.md) +Full details on the pseudo-debloat feature [> Details](doc/PseudoDebloat.md) + +#### init scripts + +The following init scripts are bundled with NanoDroid + +* external_sd + * symlink SD Card mount point to `/external_sd` + * SD Card needs to be inserted upon boot +* fstrim + * trim file systems (may increase speed) +* logscleaner + * clean up log files +* sqlite + * clean up sqlite databases + +When in Magisk Mode the init scripts create their log files in + + `/magisk/NanoDroid/.logs/${script}.log.${date}` + +When installed to /system your ROM needs to support running scripts in + + `/system/etc/init.d` + +or you can use **Kernel Adiutor's** init.d emulation. + +#### Shell Utilities + +Several utilities from `bsdmainutils` and `util-linux` + +* [> bsdmainutils Launchpad](https://launchpad.net/ubuntu/+source/bsdmainutils) +* [> util-linux GitHub](https://github.com/karelzak/util-linux) + +are included: + +* col +* colcrt +* colrm +* column +* findfs +* findmnt +* hexdump +* look +* lsblk +* lscpu +* lsipc +* lslocks +* lsns +* ncal +* setterm +* whereis + +Other shell utilities + +* aapt [> eLinux Wiki](http://elinux.org/Android_aapt) +* less [> Website](http://www.greenwoodsoftware.com/less/) + * lessecho + * lesskey +* unzip [> Website](http://www.info-zip.org/UnZip.html) + +#### GNU Bash and GNU Nano + +NanoDroid includes GNU Bash shell and the GNU Nano terminal editor. + +* [> GNU Bash Website](https://www.gnu.org/software/bash/bash.html) +* [> GNU Nano Website](https://www.nano-editor.org/) + +### microG + +microG is an Open Source replacement for Google Services, full details can be found at the microG homepage [> Website](http://microg.org/) + +NanoDroid includes microG as follows + +* microG GmsCore [> GitHub](https://github.com/microg/android_packages_apps_GmsCore) and Play Store [> APK Mirror](https://www.apkmirror.com/apk/google-inc/google-play-store/) modified to allow (in-)app purchases +* with **Déjà Vu** location provider backend [> F-Droid](https://f-droid.org/de/packages/org.fitchfamily.android.dejavu/) +* with **Mozilla** location provider backend [> F-Droid](https://f-droid.org/repository/browse/?fdfilter=mozilla&fdid=org.microg.nlp.backend.ichnaea) +* with **Nominatim** adress provider backend [> F-Droid](https://f-droid.org/repository/browse/?fdfilter=nominatim&fdid=org.microg.nlp.backend.nominatim) +* with **microG** GsfProxy [> GitHub](https://github.com/microg/android_packages_apps_GsfProxy) +* with **microG** DroidGuard Helper [> GitHub](https://github.com/microg/android_packages_apps_RemoteDroidGuard) + * required for SafetyNet support +* support for Maps API version 1 +* support for Google Calendar and Contacts Sync + * disabled by default +* optional Swipe libraries + * disabled by default +* choose between official **Play Store** or unofficial **Yalp Store** [> F-Droid](https://f-droid.org/repository/browse/?fdfilter=yalp&fdid=com.github.yeriomin.yalpstore) + * **Yalp Store** can use system permissions to install packages, so you don't need to enable `Unknown Sources` + * got to **Yalp Store** > Settings > Installation Method > `Using system permissions` + * Play Store is modified to allow (in-)app-purchases with microG +* if `com.qualcomm.location` exists it will either be + * pseudo-debloated (in Magisk Mode) + * moved to /sdcard (in System Mode) + * it conflicts with microG's location backend + +### F-Droid and Applications + +F-Droid [> Website](http://www.fdroid.org) is an app store for Open Source applications. + +NanoDroid includes both F-Droid and it's Privileged Extension [> F-Droid](https://f-droid.org/repository/browse/?fdfilter=f-droid&fdid=org.fdroid.fdroid.privileged), so you don't need to enable `Unknown Sources`. + +Additionally NanoDroid includes a variety of applications, check full details [> GitHub](doc/Applications.md) + +### The Legend of Zelda ringtones and sounds + +NanoDroid includes **The Legend of Zelda** [> Nintendo](http://www.zelda.com/) ringtones and sounds, because it's dangerous to root alone. + +Full [> Details](doc/ZeldaSounds.md) + +## Installation + +### Alter Installation + +NanoDroid supports altering the installation settings to a certain degree. + +Full [> Details](doc/AlterInstallation.md) on altering installation manually, or use the Setup Wizard (if you've got an arm/arm64 device). + +### Installation Process + +#### NanoDroid + +* Use Setup Wizard to create configuration files (if you've got an arm/arm64 device), or create manually (see above) +* Download pre-built zip or create one from this repository +* perform full wipe (/system, /data, /cache, Dalvik/ART cache) + * recommended, but not required +* install desired ROM + * make sure it does **not** include GApps if you want to use microG + * either pre-patched with signature spoofing support or **deoxeded** so you can patch yourself (instructions follow) +* install **Magisk** + * recommended, but not required + * if **Magisk** is installed, NanoDroid will be installed as Magisk-Module, else it will install into `/system` directly +* install desired Kernel (if any) +* install **NanoDroid** +* reboot into ROM + +#### microG + +##### Signature Spoofing Support + +For **microG** to work, your ROM needs to have signature spoofing enabled (or a **deodexed** ROM to patch yourself). + +If your ROM does **not** have signature spoofing support, you can manually patch it either + * flashing the on-device Patcher zip + * it also installs an addon.d script that auto re-patches the ROM upon update + * running the `framework-patcher` script + * use from your PC or laptop while your device is in TWRP. This shell script for GNU Bash (and compatible shells) works on unixoid operating systems like GNU/Linux, BSD or MacOS. It automizes the process of downloading Haystack [> GitHub](https://github.com/Lanchon/haystack), pulling files from phone, patching and installing the modified `services.jar` on the device. + +Both patchers support installing the patched `services.jar` into the following locations: + * NanoDroid Magisk Module + * NanoDroid-microG Magisk Module + * directly into `/system` + +So you can use them regardless whether you're using NanoDroid or not. + +##### microG Setup + +Once your ROM supports signature spoofing, you need to setup microG like this + * go into **microG settings** and set up everything like: + * check results in **Self-Check**, grant missing permissions (by tapping on them) + * especially the **Battery Optimization** item + * enable **Google device registration** + * enable **Google Cloud Messaging** (only if you want to receive push messages from your applications) + * enable **Google SafetyNet** (required for applications that utilize SafetyNet, for example Pokémon GO, ...) + * '...' menu > set to use the **Official Server** + * in **UnifiedNlp Settings** choose + * **Déjà Vu** or **Mozilla** as Geolocation backend + * **Nominatim** as Address lockup backend + * after everything is done, reboot + * go to **Play Store**, setup account and install your apps + +## License & Credits + +My own work (NanoDroid itself) is licensed under the GNU General Public License version 3 or newer [> GNU](https://www.gnu.org/licenses/gpl-3.0.txt) + +For more details (including authors and license) on every provided application or Software press the link next to it. + +Additional credits go to + +* Mar-V-In for microG +* topjohnwu for Magisk +* Lanchon for dexpatcher and haystack +* osm0sis for GNU Nano build + +Special Thanks to the beta testers + +* xenithorb +* ShapeShifter499 + +## Issues + +List of known issues + +* SafetyNet check fails with `Google Play Services not available` + * you did not setup microG (or did not reboot afterwards) +* Play Store lacks fake signature spoofing permission + * on ROMs like **crDroid** or **OmniROM**, that have built-in signature spoofing, in some cases the Play Store is not granted that permission automatically, to fix this either + * issue the command `nanodroid-overlay --permission` as root + * go to Settings > Apps > Gear Icon > App Permissions > `Signature Spoofing` > Enable for Play Store +* Google Sync adapters lacking permissions + * to fix this either + * issue the command `nanodroid-overlay --permission` as root + * go to Settings > Apps > Google Contacts/Calendar Sync > Permissions > grant permissions +* Battery Drain + * microG fails to register applications to GCM (Google Cloud Messaging) if they were installed **before** microG, but the apps keep trying to register and that causes the battery drain, all apps installed **after** microG are properly registered, to fix the battery drain either + * do a clean flash of your ROM (, Magisk) and NanoDroid and install your apps after microG setup + * uninstall and re-install all your applications (backup application data if required) +* microG lacks features + * if you use AppOps, PrivacyGuard or the like you have to grant microG GmsCore **all** permissions, if you prevent some permissions, some apps or features might not work as expected or not at all. Note: some APIs/features are stubs in microG GmsCore, meaning they exist that apps don't complain, but they do nothing - thus blocking microG GmsCore is pretty much of no benefit. + +Additional helpful information in the microG [> Wiki](https://github.com/microg/android_packages_apps_GmsCore/wiki/Helpful-Information). + +## TODO + +* better error handling in **on-pc** framework-patcher +* split installer code into module-specific and non-module-specific to prevent duplication + +## FAQ + +``` +Q: will there be a GApps version, instead of microG? +A: no. but you can choose not to populate microG. + +Q: what devices is this tested on? +A: Moto X Play (lux), Nexus 6 (shamu) + +Q: what ROMs was this tested on? +A: LineageOS, Resurrection Remix, AICP, AOSP Extended, crDroid, should work on any LineageOS / AOSP based ROM that is working with Magisk. +``` diff --git a/build-package b/build-package new file mode 100755 index 00000000..675cfdde --- /dev/null +++ b/build-package @@ -0,0 +1,119 @@ +#!/bin/bash + +VERSION=15.90.99999999 +CWD=$(readlink -m "${BASH_SOURCE[0]}") +CWD=$(dirname "${CWD}") + +for funcfile in pkg-full pkg-microg pkg-fdroid \ + pkg-misc update common download database; do + source "${CWD}/data/build-package.${funcfile}" || exit 1 +done + +if [[ "$OSTYPE" == "darwin"* ]]; then + if ! [ -x "$(command -v brew)" ]; then + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + fi + if ! [ -x "$(command -v gsed)" ]; then + brew install gnu-sed + fi + alias sed=gsed +fi + +[[ -z ${1} ]] && show_help + +for opt in ${@}; do + case ${opt} in + full) + mk_pkg_full + ;; + + microg ) + mk_pkg_microg + ;; + + fdroid ) + mk_pkg_fdroid + ;; + + patcher ) + mk_pkg_patcher + ;; + + uninstaller ) + mk_pkg_uninstaller + ;; + + setupwizard ) + mk_pkg_setupwizard + ;; + + all ) + mk_pkg_full + mk_pkg_microg + mk_pkg_fdroid + mk_pkg_patcher + mk_pkg_uninstaller + mk_pkg_setupwizard + ;; + + ver ) + increase_version_number "${@}" + ;; + + bump ) + increase_module_version + ;; + + dalvik ) + dalvikize_jar "${2}" + ;; + + pull ) + nanodroid_pull + check_nanodroid + ;; + + u-microg ) + update_microg + ;; + + u-fdroid ) + update_fdroid + ;; + + u-apps ) + update_apps + ;; + + u-swipe ) + update_swipe + ;; + + u-gsync ) + update_gsync + ;; + + check ) + check_nanodroid + ;; + + clean ) + echo -ne "\nAre you sure to delete all untracked files?\n >> enter [y] or [j] to continue: " + read -r user_input + + case "${user_input}" in + y | Y | j | J ) + git clean -fd + ;; + + * ) + echo "aborted" + ;; + esac + ;; + + * ) + show_help + ;; + esac +done diff --git a/data/build-package.common b/data/build-package.common new file mode 100644 index 00000000..4ceabfeb --- /dev/null +++ b/data/build-package.common @@ -0,0 +1,170 @@ +#!/bin/bash + +NANODROID_MISSING_FILES=0 +missing_database="" + +check_nanodroid () { + for file in ${files_database[@]}; do + if [[ ! -f ${CWD}/${file} ]]; then + NANODROID_MISSING_FILES=1 + missing_database=(${missing_databse[@]} ${file}) + fi + done + + if [[ ${NANODROID_MISSING_FILES} -ne 0 ]]; then + rm -f ${CWD}/.nanodroid-pull + echo -e "\nThe following files are missing:\n" + printf '%s\n' ${missing_database[@]} + else echo -e "\nNanoDroid correctly populated\n" + fi +} + +progress () { + sleep 0.5 + while [ -d "/proc/${1}" ];do + echo -ne '/\x08' ; sleep 0.05 + echo -ne '-\x08' ; sleep 0.05 + echo -ne '\\\x08' ; sleep 0.05 + echo -ne '|\x08' ; sleep 0.05 + done + + echo "Done" +} + +zip_add () { + case ${1} in + */ ) zip -qr "${ZIP}" ${1} || exit 1 ;; + "" ) zip -qr "${ZIP}" * || exit 1 ;; + * ) zip -q "${ZIP}" ${1} || exit 1 ;; + esac +} + +zip_add_config () { + if [ -f "${CWD}/data/${1}" ]; then + cd "${CWD}/data" + else cd "${CWD}/doc" + fi + + if [ "${2}" -eq 1 ]; then + sed -e 's/nanodroid_overlay=1/nanodroid_overlay=0/' -i "${1}" + zip_add "${1}" + sed -e 's/nanodroid_overlay=0/nanodroid_overlay=1/' -i "${1}" + else + zip_add "${1}" + fi + + cd "${CWD}" +} + +zip_add_doc () { + zip_add README.md + zip_add ChangeLog.md +} + +increase_version_number() { + if [ -z ${3} ]; then + ver=99999999 + else ver=${3} + fi + + sed -e "s/^VERSION=.*/VERSION=${2}.${ver}/" -i "${CWD}/build-package" + sed -e "s/^VERSION=.*/VERSION=${2}.${ver}/" -i "${CWD}/Full/nanodroid-functions" + + for module in Full microG F-Droid; do + sed -e "s/version=.*/version=v${2}.${ver}/" -i \ + "${CWD}/${module}/module.prop" + done + + for module in uninstaller patcher; do + sed -e "s/\" NanoDroid.*/\" NanoDroid ${2}.${ver} \"/" -i \ + "${CWD}/${module}/META-INF/com/google/android/update-binary" + done + + sed -e "s/rom_version\",.*/rom_version\", \"${2}\")\;/" -i \ + "${CWD}/setup-wizard/META-INF/com/google/android/aroma-config" + sed -e "s/rom_date\",.*/rom_date\", \"${ver}\")\;/" -i \ + "${CWD}/setup-wizard/META-INF/com/google/android/aroma-config" + sed -e "s/Wizard.*/Wizard ${2}.${ver}\")\;/" -i \ + "${CWD}/setup-wizard/META-INF/com/google/android/updater-script" + sed -e "s/\" NanoDroid.*/\" NanoDroid ${2}.${ver} \"/" -i \ + "${CWD}/setup-wizard/nanodroid-setup" + sed -e "s/\" addon.d.*/\" addon.d ${2}.${ver} \"/" -i \ + "${CWD}"/patcher/dexpatcher/75-nanodroidpatcher.sh + + exit 0 +} + +increase_module_version () { + for module in Full microG F-Droid; do + eval $(grep versionCode "${PWD}"/"${module}"/module.prop) + versionCode=$((versionCode+1)) + sed -e "s/versionCode.*/versionCode=${versionCode}/" \ + -i "${CWD}/${module}/module.prop" + done + + exit 0 +} + +dalvikize_jar () { + if [[ -f ${1} ]]; then + ${ANDROID_HOME}/build-tools/26.0.2/dx --dex \ + --output="$(basename "${1}" .jar).dex" \ + "${1}" + fi + + exit 0 +} + +show_help () { + echo -e " +** NanoDroid ${VERSION} helper script ** + +usage: build-package [opt] [arg] + +setup NanoDroid [! do this first !]: + pull | download all required apks for NanoDroid + || required for: Full, F-Droid, microG packages + +update contents: + u-microg | update microG and companions + || except: microG GmsCore, Play Store + u-fdroid | update F-Droid and Extension + u-apps | update applications + u-swipe | update swipe libraries + u-gsync | update Google Sync Adapters + || except: Android Oreo / SDK 26 + +create zip files: + full | create full package zip from repo + microg | create microG package zip from repo + fdroid | create F-Droid package zip from repo + patcher | create framework patcher zip from repo + uninstaller | create uninstaller zip from repo + setupwizard | create setup-wizard zip from repo + all | create all zips from repo + +misc. stuff: + check | check if all files were properly downloaded + clean | remove any untracked files from the repo + dalvik [jar] | prepare a jar file for dalvikvm usage + ver [ver] [date] | bump version + bump | bump versionCode in Magisk Modules +" + + exit 0 +} + +print_package () { + echo " +Creating Package + + Type ${1} + Name $(basename ${ZIP}) + Directory $(dirname ${ZIP}) +" +} + +error () { + echo -e "${@}" + exit 1 +} diff --git a/data/build-package.database b/data/build-package.database new file mode 100644 index 00000000..0b424064 --- /dev/null +++ b/data/build-package.database @@ -0,0 +1,139 @@ +#!/bin/bash + +### +# NanoDroid self-provided apks +### + +nlx_FAKESTORE=(https://www.nanolx.org/apk/FakeStore.apk priv-app FakeStore) +nlx_MPV=(https://www.nanolx.org/apk/MPV.apk app MPV) +nlx_OPENLAUNCHER=(https://www.nanolx.org/apk/OpenLauncher.apk app OpenLauncher) +nlx_PHONESKY=(https://www.nanolx.org/apk/Phonesky.apk priv-app Phonesky) + +### +# microG +### + +uG_GMSCORE=(microg com.google.android.gms priv-app GmsCore) +uG_GSFPROXY=(microg com.google.android.gsf priv-app GsfProxy) +uG_DROIDGUARD=(microg org.microg.gms.droidguard priv-app DroidGuard) +uG_FAKESTORE=(microg com.android.vending priv-app FakeStore) +fd_NLPDEJAVU=(fdroid org.fitchfamily.android.dejavu app nlpBackendDejavu) +fd_NLPMOZILLA=(fdroid org.microg.nlp.backend.ichnaea app nlpBackendIchnaea) +fd_NLPNOMINATIM=(fdroid org.microg.nlp.backend.nominatim app nlpBackendNominatim) +fd_YALPSTORE=(fdroid com.github.yeriomin.yalpstore priv-app YalpStore) + +### +# F-Droid +### + +fd_FDROID=(fdroid org.fdroid.fdroid app FDroid) +fd_FDROID_PE=(fdroid org.fdroid.fdroid.privileged priv-app FDroidPrivileged) + +### +# Apps +### + +fd_ADAWAY=(fdroid org.adaway app Adaway) +fd_AMAZE=(fdroid com.amaze.filemanager app Amaze) +fd_ANYSOFTKEYBOARD=(fdroid com.menny.android.anysoftkeyboard app AnysoftKeyboard) +fd_BEHEKEYBOARD=(fdroid com.vlath.keyboard app BeHeKeyboard) +fd_FACESLIM=(fdroid org.indywidualni.fblite app FaceSlim) +fd_LIGHTNING=(fdroid acr.browser.lightning app Lightning) +fd_NEWPIPE=(fdroid org.schabi.newpipe app NewPipe) +fd_OANDBACKUP=(fdroid dk.jens.backup app Oandbackup) +fd_ODYSSEY=(fdroid org.gateshipone.odyssey app Odyssey) +fd_OPENCAMERA=(fdroid net.sourceforge.opencamera app OpenCamera) +fd_OPENKEYCHAIN=(fdroid org.sufficientlysecure.keychain app OpenKeyChain) +fd_OPENLAUNCHER=(fdroid com.benny.openlauncher app OpenLauncher) +fd_OPENVPN=(fdroid de.blinkt.openvpn app OpenVPN) +fd_QKSMS=(fdroid com.moez.QKSMS app QKSMS) +fd_SIMPLECALENDAR=(fdroid com.simplemobiletools.calendar app SimpleCalendar) +fd_SIMPLEGALLERY=(fdroid com.simplemobiletools.gallery app SimpleGallery) +fd_TERMUX=(fdroid com.termux app Termux) + +gd_ORBOT=(https://guardianproject.info/releases/orbot-latest.apk app Orbot) +gd_ORFOX=(https://guardianproject.info/releases/Orfox-v1.4-RC-3.apk app Orfox) + +gh_K9MAIL=(k9mail/k-9 app K9Mail) +gh_KEEPASSDROID=(bpellin/keepassdroid app KeePassDroid) +gh_MPV=(mpv-android/mpv-android app MPV) +gh_TWIDERE=(TwidereProject/Twidere-Android app Twidere) + +### +# Google Sync Adapters +### + +og_CALSYNC=(com.google.android.syncadapters.calendar app GoogleCalendarSync) +og_CONSYNC=(com.google.android.syncadapters.contacts app GoogleContactsSync) +og_BTRANSP=(com.google.android.backuptransport priv-app GoogleBackupTransport) + +### +# APK Mirror +### + +am_KERNELADIUTOR=(willi-ye kernel-adiutor app KernelAdiutor kernel-adiutor-root) +am_SUBSTRATUM=(projekt substratum-theme-engine app Substratum substratum-theme-engine) +am_OPENWEATHER=(lineageos openweathermap app OpenWeatherMapProvider openweathermap) +am_YAHOOWEATHER=(lineageos yahoo-weather-2 app YahooWeatherProvider yahoo-weather) +am_XDALABS=(xda xda-labs app XDALabs xda-labs) + +### +# Files Database (for consistency check) +### + +files_database=( Full/gsync/K/app/GoogleCalendarSync/GoogleCalendarSync.apk + Full/gsync/K/app/GoogleContactsSync/GoogleContactsSync.apk + Full/gsync/K/priv-app/GoogleBackupTransport/GoogleBackupTransport.apk + Full/gsync/L/app/GoogleCalendarSync/GoogleCalendarSync.apk + Full/gsync/L/app/GoogleContactsSync/GoogleContactsSync.apk + Full/gsync/L/priv-app/GoogleBackupTransport/GoogleBackupTransport.apk + Full/gsync/M/app/GoogleCalendarSync/GoogleCalendarSync.apk + Full/gsync/M/app/GoogleContactsSync/GoogleContactsSync.apk + Full/gsync/M/priv-app/GoogleBackupTransport/GoogleBackupTransport.apk + Full/gsync/N/app/GoogleCalendarSync/GoogleCalendarSync.apk + Full/gsync/N/app/GoogleContactsSync/GoogleContactsSync.apk + Full/gsync/N/priv-app/GoogleBackupTransport/GoogleBackupTransport.apk + Full/swipe/arm/libjni_keyboarddecoder.so + Full/swipe/arm/libjni_latinimegoogle.so + Full/swipe/arm64/libjni_keyboarddecoder.so + Full/swipe/arm64/libjni_latinimegoogle.so + Full/swipe/x86/libjni_keyboarddecoder.so + Full/swipe/x86/libjni_latinimegoogle.so + Full/swipe/x86_64/libjni_keyboarddecoder.so + Full/swipe/x86_64/libjni_latinimegoogle.so + Full/system/app/Adaway/Adaway.apk + Full/system/app/Amaze/Amaze.apk + Full/system/app/AnysoftKeyboard/AnysoftKeyboard.apk + Full/system/app/BeHeKeyboard/BeHeKeyboard.apk + Full/system/app/FDroid/FDroid.apk + Full/system/app/FaceSlim/FaceSlim.apk + Full/system/app/K9Mail/K9Mail.apk + Full/system/app/KeePassDroid/KeePassDroid.apk + Full/system/app/KernelAdiutor/KernelAdiutor.apk + Full/system/app/Lightning/Lightning.apk + Full/system/app/MPV/MPV.apk + Full/system/app/NewPipe/NewPipe.apk + Full/system/app/Oandbackup/Oandbackup.apk + Full/system/app/Odyssey/Odyssey.apk + Full/system/app/OpenCamera/OpenCamera.apk + Full/system/app/OpenKeyChain/OpenKeyChain.apk + Full/system/app/OpenLauncher/OpenLauncher.apk + Full/system/app/OpenVPN/OpenVPN.apk + Full/system/app/OpenWeatherMapProvider/OpenWeatherMapProvider.apk + Full/system/app/Orbot/Orbot.apk + Full/system/app/Orfox/Orfox.apk + Full/system/app/QKSMS/QKSMS.apk + Full/system/app/SimpleCalendar/SimpleCalendar.apk + Full/system/app/SimpleGallery/SimpleGallery.apk + Full/system/app/Substratum/Substratum.apk + Full/system/app/Termux/Termux.apk + Full/system/app/Twidere/Twidere.apk + Full/system/app/XDALabs/XDALabs.apk + Full/system/app/YahooWeatherProvider/YahooWeatherProvider.apk + Full/system/app/nlpBackendIchnaea/nlpBackendIchnaea.apk + Full/system/app/nlpBackendNominatim/nlpBackendNominatim.apk + Full/system/priv-app/DroidGuard/DroidGuard.apk + Full/system/priv-app/FDroidPrivileged/FDroidPrivileged.apk + Full/system/priv-app/FakeStore/FakeStore.apk + Full/system/priv-app/GsfProxy/GsfProxy.apk + Full/system/priv-app/YalpStore/YalpStore.apk ) diff --git a/data/build-package.download b/data/build-package.download new file mode 100644 index 00000000..895d1086 --- /dev/null +++ b/data/build-package.download @@ -0,0 +1,216 @@ +#!/bin/bash + +# Functions borrowed or derived from +# Michael Bryant / Shadow53 +# https://gitlab.com/Shadow53/android-zip-builder + +REPO_FDROID="https://f-droid.org/repo" +REPO_GUARDIAN="https://guardianproject.info/fdroid/repo/" +REPO_MICROG="https://microg.org/fdroid/repo" + +# check dependencies +for dep in xmllint gawk wget curl sha256sum; do + if ! which ${dep} &>/dev/null; then + echo "${dep} is not installed!" + exit 1 + fi +done + +grab_apk_from_repo () { + case "${1}" in + fdroid ) + REPO=${REPO_FDROID} + REPO_P="F-Droid" + ;; + + guardian ) + REPO=${REPO_GUARDIAN} + REPO_P="Guardian Project" + ;; + + microg ) + REPO=${REPO_MICROG} + REPO_P="microG" + ;; + esac + + DOMAIN="$(awk -F/ '{print $3}' <<< ${REPO})" + INDEX_FILE="${CWD}/data/${DOMAIN}.index.xml" + + wget -q -O "${INDEX_FILE}" "${REPO}/index.xml" + + PKG_NAME="${2}" + APK_NAME="$(xmllint --xpath "/fdroid/application[id=\"${PKG_NAME}\"]/package[1]/apkname/text()" ${INDEX_FILE})" + SHA_SUM="$(xmllint --xpath "/fdroid/application[id=\"${PKG_NAME}\"]/package[1]/hash/text()" ${INDEX_FILE})" + + APK_URL="${REPO}/${APK_NAME}" + APK_DEST="${CWD}/Full/system/${3}/${4}" + + if [[ -f "${APK_DEST}/${4}.apk" ]]; then + TMP_SUM="$(sha256sum "${APK_DEST}/${4}.apk")" + + if [[ "${SHA_SUM}" == "${TMP_SUM/ */}" ]]; then + echo -e "\nUp-to-Date from ${REPO_P} : ${4}.apk" + else echo -e "\nUpdating from ${REPO_P} : ${4}.apk" + rm -f "${APK_DEST}/${4}.apk" + wget -q -O "${APK_DEST}/${4}.apk" "${APK_URL}" + fi + else + echo -e "\nDownloading from ${REPO_P}: ${4}.apk" + mkdir -p "${APK_DEST}" + wget -q -O "${APK_DEST}/${4}.apk" "${APK_URL}" + fi + + TMP_SUM="$(sha256sum "${APK_DEST}/${4}.apk")" + + if [[ "${SHA_SUM}" == "${TMP_SUM/ */}" ]]; then + echo " SHA256 hash of ${4}.apk is correct" + else echo -e " SHA256 hash of ${4}.apk is wrong!\ + \n expected : ${SHA_SUM}\ + \n got : ${TMP_SUM/ *}" + rm -f "${APK_DEST}/${4}.apk" + fi +} + +grab_apk_from_url () { + APK_URL="${1}" + APK_DEST="${CWD}/Full/system/${2}/${3}" + + if [[ -f "${APK_DEST}/${3}.apk" ]]; then + echo -e "\nUpdating from URL : ${3}.apk" + else echo -e "\nDownloading from URL : ${3}.apk" + mkdir -p "${APK_DEST}" + fi + + echo " Checking SHA256 hash not (yet) supported" + + wget -q -O "${APK_DEST}/${3}.apk" "${APK_URL}" || \ + rm -f "${APK_DEST}/${3}.apk" +} + +# XXX +# I've never used curl, nor whatever, I suck at +# automated HTML parsing, so you'll get eyesore +# from looking at his code, you've been warned. + +USER_AGENT="Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0" +grab_apk_from_apkmirror () { + VERSION=$(curl -s https://www.apkmirror.com/apk/${1}/${2}/ | \ + gawk -F\" '/apk.*release/{print $4 ; exit}' | \ + sed -e "s,.*${2}-,,g;s,-release/,,g") + + URL_STRING="https://www.apkmirror.com/apk/\ +${1}/${2}/${2}-${VERSION}-release/\ +${5}-${VERSION}-android-apk-download" + + URL_WP=$(curl -s "${URL_STRING}/download/" | \ + gawk -F\" '/If not, please click/{print $16}') + + SHA_SUM=$(curl -s "${URL_STRING}/" | \ + grep "SHA-256.*[^>]" | \ + sed -e 's,.*\">,,;s,,,') + + APK_URL="https://www.apkmirror.com${URL_WP}" + APK_DEST="${CWD}/Full/system/${3}/${4}" + + if [[ -f "${APK_DEST}/${4}.apk" ]]; then + TMP_SUM="$(sha256sum "${APK_DEST}/${4}.apk")" + + if [[ "${SHA_SUM}" == "${TMP_SUM/ */}" ]]; then + echo -e "\nUp-to-Date from APK Mirror: ${4}.apk" + else echo -e "\nUpdating from APK Mirror : ${4}.apk" + rm -f "${APK_DEST}/${4}.apk" + wget --user-agent="${USER_AGENT}" -q \ + "${APK_URL}" -O "${APK_DEST}/${4}.apk" + fi + else + echo -e "\nDownloading from APK Mirror: ${4}.apk" + mkdir -p "${APK_DEST}" + wget --user-agent="${USER_AGENT}" -q \ + "${APK_URL}" -O "${APK_DEST}/${4}.apk" + fi + + TMP_SUM="$(sha256sum "${APK_DEST}/${4}.apk")" + + if [[ "${SHA_SUM}" == "${TMP_SUM/ */}" ]]; then + echo " SHA256 hash of ${4}.apk is correct" + else echo -e " SHA256 hash of ${4}.apk is wrong!\ + \n expected : ${SHA_SUM}\ + \n got : ${TMP_SUM/ *}" + rm -f "${APK_DEST}/${4}.apk" + fi +} + + +grab_apk_from_github () { + TAG_NAME="$(curl -s https://api.github.com/repos/${1}/releases | gawk -F\" '/tag_name/{print $4; exit}')" + APK_NAME="$(curl -s https://api.github.com/repos/${1}/releases | gawk -F\" '/name.*.apk/{print $4; exit}')" + + APK_URL="https://github.com/${1}/releases/download/${TAG_NAME}/${APK_NAME}" + APK_DEST="${CWD}/Full/system/${2}/${3}" + + if [[ -f "${APK_DEST}/${3}.apk" ]]; then + echo -e "\nUpdating from GitHub : ${3}.apk" + else echo -e "\nDownloading from GitHub : ${3}.apk" + mkdir -p "${APK_DEST}" + fi + + echo " Checking SHA256 hash not (yet) supported" + + wget -q -O "${APK_DEST}/${3}.apk" "${APK_URL}" || \ + rm -f "${APK_DEST}/${3}.apk" +} + +grab_apk_from_ogapps () { + case "${1}" in + "com.google.android.syncadapters.calendar" ) + APK_URL="https://github.com/opengapps/all/blob/master/${2}/${1}/15/nodpi/2015080710.apk?raw=true" + ;; + + * ) + APK_URL="https://github.com/opengapps/all/blob/master/${2}/${1}/${4}/nodpi/${4}.apk?raw=true" + ;; + esac + + case "${4}" in + 19 ) API_LETTER=K ;; + 21 ) API_LETTER=L ;; + 23 ) API_LETTER=M ;; + 24 ) API_LETTER=N ;; + 26 ) API_LETTER=O ;; + esac + + APK_DEST="${CWD}/Full/gsync/${API_LETTER}/${2}/${3}" + + if [[ -f "${APK_DEST}/${3}.apk" ]]; then + echo -e "\nUpdating from OpenGApps : ${3}.apk [${API_LETTER}]" + else echo -e "\nDownloading from OpenGApps: ${3}.apk [${API_LETTER}]" + mkdir -p "${APK_DEST}" + fi + + echo " Checking SHA256 hash not (yet) supported" + + wget -q -O "${APK_DEST}/${3}.apk" "${APK_URL}" || \ + rm -f "${APK_DEST}/${3}.apk" +} + +grab_lib_from_ogapps () { + case "${3}" in + arm | x86 ) LIBD=lib ;; + arm64 | x86_64 ) LIBD=lib64 ;; + esac + + APK_URL="https://github.com/opengapps/${3}/blob/master/${LIBD}/${2}/${1}?raw=true" + APK_DEST="${CWD}/Full/swipe/${3}" + + if [[ -f "${APK_DEST}/${1}" ]]; then + echo -e "\nUpdating from OpenGApps : ${1} [${3}]" + else echo -e "\nDownloading from OpenGApps: ${1} [${3}]" + mkdir -p "${APK_DEST}" + fi + + echo " Checking SHA256 hash not (yet) supported" + + wget -q -O "${APK_DEST}/${1}" "${APK_URL}" || \ + rm -f "${APK_DEST}/${1}" +} diff --git a/data/build-package.pkg-fdroid b/data/build-package.pkg-fdroid new file mode 100644 index 00000000..7039ae7d --- /dev/null +++ b/data/build-package.pkg-fdroid @@ -0,0 +1,30 @@ +#!/bin/bash + +create_fdroid_package() { + [[ ! -f "${CWD}/.nanodroid-pull" ]] && \ + error "run \"build-package pull\" first!" + + ZIP="${CWD}/NanoDroid-fdroid-${VERSION}".zip + rm -f "${ZIP}" + + print_package "F-Droid" + + cd "${CWD}/Full" + zip_add "nanodroid-functions" + zip_add "system/app/FDroid/" + zip_add "system/priv-app/FDroidPrivileged/" + zip_add "system/xbin/unzip*" + cd "${CWD}" + + cd "${CWD}/F-Droid" + zip_add + cd "${CWD}" + + zip_add_doc + zip_add_config .nanodroid-setup 0 +} + +mk_pkg_fdroid () { + create_fdroid_package & + progress $! +} diff --git a/data/build-package.pkg-full b/data/build-package.pkg-full new file mode 100644 index 00000000..8b89a1a4 --- /dev/null +++ b/data/build-package.pkg-full @@ -0,0 +1,25 @@ +#!/bin/bash + +create_full_package () { + [[ ! -f "${CWD}/.nanodroid-pull" ]] && \ + error "run \"build-package pull\" first!" + + ZIP="${CWD}/NanoDroid-${VERSION}".zip + rm -f "${ZIP}" + + print_package "Full" + + cd "${CWD}/Full" + zip_add + cd "${CWD}" + + zip_add_doc + zip_add_config .nanodroid-overlay 0 + zip_add_config .nanodroid-setup 0 + zip_add_config .nanodroid-apps 0 +} + +mk_pkg_full () { + create_full_package & + progress $! +} diff --git a/data/build-package.pkg-microg b/data/build-package.pkg-microg new file mode 100644 index 00000000..fdc6b8fd --- /dev/null +++ b/data/build-package.pkg-microg @@ -0,0 +1,45 @@ +#!/bin/bash + +create_microg_package() { + [[ ! -f "${CWD}/.nanodroid-pull" ]] && \ + error "run \"build-package pull\" first!" + + ZIP="${CWD}/NanoDroid-microG-${VERSION}".zip + rm -f "${ZIP}" + + print_package "microG" + + cd "${CWD}/Full" + + zip_add "nanodroid-functions" + + for app in nlpBackendDejavu nlpBackendIchnaea nlpBackendNominatim; do + zip_add "system/app/${app}/" + done + + for app in DroidGuard FakeStore GmsCore GsfProxy Phonesky YalpStore; do + zip_add "system/priv-app/${app}/" + done + + for input in "system/xbin/nanodroid-overlay" "system/xbin/novl" \ + "system/xbin/bash*" "system/xbin/aapt*" "system/xbin/column*" \ + "system/xbin/unzip*" "system/framework/" "gsync/" \ + "system/etc/permissions/" "system/etc/bash*" "swipe/"; do + zip_add "${input}" + done + + cd "${CWD}" + + cd "${CWD}/microG" + zip_add + cd "${CWD}" + + zip_add_doc + zip_add_config .nanodroid-overlay 0 + zip_add_config .nanodroid-setup 1 +} + +mk_pkg_microg () { + create_microg_package & + progress $! +} diff --git a/data/build-package.pkg-misc b/data/build-package.pkg-misc new file mode 100644 index 00000000..a7fd0d7c --- /dev/null +++ b/data/build-package.pkg-misc @@ -0,0 +1,56 @@ +#!/bin/bash + +create_patcher_package() { + ZIP="${CWD}/NanoDroid-patcher-${VERSION}".zip + rm -f "${ZIP}" + + print_package "Framework Patcher" + + cd "${CWD}/patcher" + zip_add + cd "${CWD}" + + zip_add_doc +} + +mk_pkg_patcher () { + create_patcher_package & + progress $! +} + + +create_setupwizard_package() { + ZIP="${CWD}/NanoDroid-setupwizard-${VERSION}".zip + rm -f "${ZIP}" + + print_package "Setup Wizard" + + cd "${CWD}/setup-wizard" + zip_add + cd "${CWD}" + + zip_add_doc +} + +mk_pkg_setupwizard () { + create_setupwizard_package & + progress $! +} + +create_uninstaller_package() { + ZIP="${CWD}/NanoDroid-uninstaller-${VERSION}".zip + rm -f "${ZIP}" + + print_package "Uninstaller" + + cd "${CWD}/uninstaller" + zip_add + cd "${CWD}" + + zip_add_doc +} + +mk_pkg_uninstaller () { + create_uninstaller_package & + progress $! +} diff --git a/data/build-package.update b/data/build-package.update new file mode 100644 index 00000000..8d7bdb45 --- /dev/null +++ b/data/build-package.update @@ -0,0 +1,88 @@ +#!/bin/bash + +nanodroid_pull () { + update_microg + update_fdroid + update_apps + update_swipe + update_gsync + + touch "${CWD}/.nanodroid-pull" +} + +update_swipe () { + for LIB in libjni_keyboarddecoder.so libjni_latinimegoogle.so; do + for ARCH in arm arm64 x86 x86_64; do + grab_lib_from_ogapps ${LIB} 23 ${ARCH} + done + done +} + +update_microg () { + grab_apk_from_repo ${uG_GMSCORE[@]} + grab_apk_from_repo ${uG_GSFPROXY[@]} + grab_apk_from_repo ${uG_DROIDGUARD[@]} + #grab_apk_from_repo ${uG_FAKESTORE[@]} + grab_apk_from_repo ${fd_NLPDEJAVU[@]} + grab_apk_from_repo ${fd_NLPMOZILLA[@]} + grab_apk_from_repo ${fd_NLPNOMINATIM[@]} + grab_apk_from_repo ${fd_YALPSTORE[@]} + + grab_apk_from_url ${nlx_PHONESKY[@]} + grab_apk_from_url ${nlx_FAKESTORE[@]} +} + +update_gsync () { + # KK LL M N O + for API in 19 21 23 24 26; do + grab_apk_from_ogapps ${og_CALSYNC[@]} ${API} + grab_apk_from_ogapps ${og_CONSYNC[@]} ${API} + grab_apk_from_ogapps ${og_BTRANSP[@]} ${API} + done +} + +update_fdroid () { + grab_apk_from_repo ${fd_FDROID[@]} + grab_apk_from_repo ${fd_FDROID_PE[@]} +} + +update_apps () { + # applications managed in repositories + grab_apk_from_repo ${fd_ADAWAY[@]} + grab_apk_from_repo ${fd_AMAZE[@]} + grab_apk_from_repo ${fd_ANYSOFTKEYBOARD[@]} + grab_apk_from_repo ${fd_BEHEKEYBOARD[@]} + grab_apk_from_repo ${fd_FACESLIM[@]} + grab_apk_from_repo ${fd_LIGHTNING[@]} + grab_apk_from_repo ${fd_NEWPIPE[@]} + grab_apk_from_repo ${fd_OANDBACKUP[@]} + grab_apk_from_repo ${fd_ODYSSEY[@]} + grab_apk_from_repo ${fd_OPENCAMERA[@]} + grab_apk_from_repo ${fd_OPENKEYCHAIN[@]} + #grab_apk_from_repo ${fd_OPENLAUNCHER[@]} + grab_apk_from_repo ${fd_OPENVPN[@]} + grab_apk_from_repo ${fd_QKSMS[@]} + grab_apk_from_repo ${fd_SIMPLECALENDAR[@]} + grab_apk_from_repo ${fd_SIMPLEGALLERY[@]} + grab_apk_from_repo ${fd_TERMUX[@]} + + # applications not managed in repositories + # plain URL + grab_apk_from_url ${gd_ORBOT[@]} + grab_apk_from_url ${gd_ORFOX[@]} + grab_apk_from_url ${nlx_OPENLAUNCHER[@]} + grab_apk_from_url ${nlx_MPV[@]} + + # GitHub + grab_apk_from_github ${gh_K9MAIL[@]} + grab_apk_from_github ${gh_KEEPASSDROID[@]} + #grab_apk_from_github ${gh_MPV[@]} + grab_apk_from_github ${gh_TWIDERE[@]} + + # APK Mirror + grab_apk_from_apkmirror ${am_KERNELADIUTOR[@]} + grab_apk_from_apkmirror ${am_OPENWEATHER[@]} + grab_apk_from_apkmirror ${am_SUBSTRATUM[@]} + grab_apk_from_apkmirror ${am_YAHOOWEATHER[@]} + grab_apk_from_apkmirror ${am_XDALABS[@]} +} diff --git a/doc/.nanodroid-apps b/doc/.nanodroid-apps new file mode 100644 index 00000000..954e67c1 --- /dev/null +++ b/doc/.nanodroid-apps @@ -0,0 +1,28 @@ +Adaway +Amaze +AnysoftKeyboard +BeHeKeyboard +FaceSlim +K9Mail +KeePassDroid +KernelAdiutor +Lightning +MPV +NewPipe +Oandbackup +Odyssey +OpenCamera +OpenKeyChain +OpenLauncher +OpenWeatherMapProvider +OpenVPN +Orbot +Orfox +QKSMS +SimpleCalendar +SimpleGallery +Substratum +Termux +Twidere +XDALabs +YahooWeatherProvider diff --git a/doc/.nanodroid-overlay b/doc/.nanodroid-overlay new file mode 100644 index 00000000..5185a3f8 --- /dev/null +++ b/doc/.nanodroid-overlay @@ -0,0 +1,31 @@ +BasicDreams +Browser +Calendar +Camera2 +CMFileManager +crDroidFileManager +crDroidMusic +Eleven +Email +Exchange2 +FMRadio +Gallery2 +Gello +Jelly +messaging +mGerrit +OmniSwitch +Phonograph +PhotoTable +Recorder +ResurrectionStats +Screencast +Slimperience +Snap +SnapdragonCamera +SoundRecorder +Stk +ViaBrowser +Wallpaper +WallpaperBackup +WallpaperPickerGoogle diff --git a/doc/.nanodroid-setup b/doc/.nanodroid-setup new file mode 100644 index 00000000..4b587104 --- /dev/null +++ b/doc/.nanodroid-setup @@ -0,0 +1,13 @@ +nanodroid_microg=1 +nanodroid_fdroid=1 +nanodroid_apps=1 +nanodroid_play=1 +nanodroid_overlay=1 +nanodroid_zelda=1 +nanodroid_mapsv1=1 +nanodroid_init=1 +nanodroid_gsync=0 +nanodroid_swipe=0 +nanodroid_forcesystem=0 +nanodroid_sigspoofui=0 +nanodroid_nlpbackend=1 diff --git a/doc/AlterInstallation.md b/doc/AlterInstallation.md new file mode 100644 index 00000000..1cce864a --- /dev/null +++ b/doc/AlterInstallation.md @@ -0,0 +1,120 @@ +# Alter Installation + +## Configuration File + +To alter the installation you can create the file + +`.nanodroid-setup` + +on your device, in one of the following directories + +* `/sdcard` (internal storage) +* `/external_sd` (TWRP path to SD Card (if any)) +* directory containing the zip file +* `/data` (fallback) + +create it manually with the following content for the **full** package + +``` +nanodroid_microg=1 +nanodroid_fdroid=1 +nanodroid_apps=1 +nanodroid_play=1 +nanodroid_overlay=1 +nanodroid_zelda=1 +nanodroid_mapsv1=1 +nanodroid_init=1 +nanodroid_gsync=0 +nanodroid_swipe=0 +nanodroid_forcesystem=0 +nanodroid_nlpbackend=1 +``` + +the **microG** package supports the following options + +``` +nanodroid_play=1 +nanodroid_overlay=0 +nanodroid_mapsv1=1 +nanodroid_gsync=0 +nanodroid_swipe=0 +nanodroid_forcesystem=0 +nanodroid_nlpbackend=1 +``` + +the **F-Droid** package supports the following options + +``` +nanodroid_forcesystem=0 +``` + +the **Patcher** package supports the following options + +``` +nanodroid_sigspoofui=0 +``` + +where `1` means `on` and `0` means `off`. If no `.nanodroid-setup` is found, the [default settings](.nanodroid-setup) will be used (equals to the example above), if your `.nanodroid-setup` file exists, but is missing entries, those entries will be added, using the default values. + +Alternatively you can also use the NanoDroid-SetupWizard package instead of manual creation of the configuration file. + +## Detailed Description + +`nanodroid_microg=[0|1]` + +whether to provide **microG** + +`nanodroid_fdroid=[0|1]` + +whether to provide **F-Droid** + +`nanodroid_apps=[0|1]` + +whether to provide included applications [> Details](doc/Applications.md) + +`nanodroid_play=[0|1|2]` + +what app store to use: +* `0` will not provide any app store +* `1` will provide **Play Store** +* `2` will provide **Yalp Store** and **Fake Store** + +`nanodroid_overlay=[0|1]` + +whether to populate the overlay to pseudo-debloat `/system` applications (Magisk-only) + +`nanodroid_zelda=[0|1]` + +whether to provide The Legend of Zelda ringtones and sounds + +`nanodroid_mapsv1=[0|1]` + +whether to provide **microG** Maps API v1 + +`nanodroid_init=[0|1]` + +whether to provide init scripts + +`nanodroid_gsync=[0|1]` + +whether to provide Google Sync Adapters + +`nanodroid_swipe=[0|1]` + +whether to provide Swipe libraries + +`nanodroid_forcesystem=[0|1]` + +whether to force system mode installation, regardless whether Magisk is installed + +`nanodroid_nlpbackend=[0|1|2]` + +what location backend for microG to install +* 0 = no location backend +* 1 = Déjà Vu location backend +* 2 = Ichnaea (Mozilla) location backend +* 3 = Déjà Vu and Ichnaea location backends + +`nanodroid_sigspoofui=[0|1]` + +whether to patch `Settings.apk` to feature a user interface for enabling and disabling signature spoofing feature globally on **non-prepatched** ROMs. This patch is not applied on Android 7.1 (SDK 25) or later. diff --git a/doc/Applications.md b/doc/Applications.md new file mode 100644 index 00000000..79dd62de --- /dev/null +++ b/doc/Applications.md @@ -0,0 +1,62 @@ +# Applications + +## Provided Applications + +The applications provided by NanoDroid will be +* magic-mounted as system applications when installed as Magisk Module +* directly installed as system applications when installed in System Mode + +Full list of provided applications +* Adaway [> F-Droid](https://f-droid.org/packages/org.adaway) +* Amaze (File Manager) [> F-Droid](https://f-droid.org/packages/com.amaze.filemanager) +* AnySoftKeyboard [> F-Droid](https://f-droid.org//packages/com.menny.android.anysoftkeyboard) +* BeHe Keybarod [> F-Droid](https://f-droid.org/packages/com.vlath.keyboard/) +* (Simple) Calendar [> F-Droid](https://f-droid.org/packages/com.simplemobiletools.calendar) +* Face Slim (Facebook client) [> F-Droid](https://f-droid.org/packages/org.indywidualni.fblite) +* (Simple) Gallery [> F-Droid](https://f-droid.org/packages/com.simplemobiletools.gallery) +* K-9 Mail [> F-Droid](https://f-droid.org/packages/com.fsck.k9) +* Kernel Adiutor [> GitHub](https://github.com/Grarak/KernelAdiutor) +* KeyPassDroid (Password Safe) [> F-Droid](https://f-droid.org/packages/com.android.keepass) +* Lightning (Browser) [> F-Droid](https://f-droid.org/packages/acr.browser.lightning) +* MPV (Video Player) [> GitHub](https://github.com/mpv-android/mpv-android) +* New Pipe (YouTube client) [> F-Droid](https://f-droid.org/packages/org.schabi.newpipe) +* Oandbackup (App backup and restore) [> F-Droid](https://f-droid.org/packages/dk.jens.backup) +* Odyssey (Audio player) [> F-Droid](https://f-droid.org/packages/org.gateshipone.odyssey) +* OpenCamera [> F-Droid](https://f-droid.org/packages/net.sourceforge.opencamera) +* OpenKeyChain [> F-Droid](https://f-droid.org/packages/org.sufficientlysecure.keychain) +* OpenLauncher [> F-Droid](https://f-droid.org/packages/com.benny.openlauncher) +* OpenWeatherMap Weather Provider [> GitHub](https://github.com/LineageOS/android_packages_apps_OpenWeatherMapProvider) +* OpenVPN [> F-Droid](https://f-droid.org/packages/de.blinkt.openvpn) +* Orbot [> Guardian Project](https://guardianproject.info/apps/orbot/) +* Orfox [> Guardian Project](https://guardianproject.info/apps/orfox/) +* QKSMS [> F-Droid](https://f-droid.org/packages/com.moez.QKSMS) +* Substratum (App) [> GitHub](https://github.com/substratum/substratum) +* Termux [> F-Droid](https://f-droid.org/packages/com.termux) +* Twidere (Twitter client) [> F-Droid](https://f-droid.org/packages/org.mariotaku.twidere) +* XDA Labs [> XDA](https://forum.xda-developers.com/android/apps-games/labs-t3241866) + * source not (yet) available +* Yahoo Weather Provider [> GitHub](https://github.com/LineageOS/android_packages_apps_YahooWeatherProvider) + +## Alter provided Applications + +You can control what applications to install using the file + +`.nanodroid-apps` + +on your device, in one of the following directories + +* `/sdcard` (internal storage) +* `/external_sd` (TWRP path to SD Card (if any)) +* directory containing the zip file +* `/data` (fallabck) + +All applications listed in that file will be installed. See the [default settings](.nanodroid-apps), which are used when no `.nanodroid-apps` configuration file was found. + +Alternatively you can also use the Setup Wizard instead of manual creation of the configuration file (if you've got an arm/arm64 device). + +The syntax is pretty simple: + +* one app per line +* name must be an exact match + +applications managed by other setup variables (F-Droid, microG, PlayStore) are not effected by this file. diff --git a/doc/NanoDroidOverlay.md b/doc/NanoDroidOverlay.md new file mode 100644 index 00000000..63452bbf --- /dev/null +++ b/doc/NanoDroidOverlay.md @@ -0,0 +1,128 @@ +# nanodroid-overlay Script + +## Purpose + +The `nanodroid-overlay` Script, respectively it's shortcut `novl` is used by NanoDroid to perform various actions. + +### Magisk-Only Features + +The following features are **only** available, when NanoDroid is installed as Magisk Module: + +* Pseudo-Debloat Feature +* utilize Magisk's `resetprop` feature for on-the-fly and permanently adjusting system properties + +### General Features + +The following features are available in **both** Magisk and System Mode: + +* grant signature spoofing permissions to microG GmsCore / Play Store + * on pre-patched ROMs that is +* grant required permissions to Google Sync Adapters +* fix navigation bar, status bar or lock screen issues after OTA update +* change Airplane Mode radio settings +* prevent applications from stealing audio focus +* prevent applications from reading the clipboard +* display device's boot count + * requires Android 7.0 or newer + +## Invocation + +From within a terminal on your device, for example `adb shell` or `Termux` invoke the script using either + +`nanodroid-overlay [switch] [parameter(s)]` + +or + +`novl [switch] [parameter(s)]` + +## Feature overview + +### Pseudo-Debloat feature (Magisk-Only) + +`-a`, `--add` [app] + +add Overlay for **app** (if it exists) and add it to the config file; [app] is the name of the app's directory in `/system/app` or `/system/priv-app` + +`-r`, `--remove` [app] + +remove Overlay for **app** (if it exists) and remove it from the config file; [app] is the name of the app's directory in `/system/app` or `/system/priv-app` + +`-s`, `--show` + +show all apps that **don't** have an Overlay (slow) + +`-l`, `--list` + +show all apps that **do** have an Overlay + +`-x`, `--create` + +create Overlays from config file + +`-u`, `--update` + +remove existing Overlays and re-create them from the config file + +`-c`, `--clear` + +remove existing Overlays + +`-g`, `--genconfig` + +(re-)create config file from existing Overlays + +### Utilize resetprop (Magisk-Only) + +`-C`, `--cast` + +set properties required to enable the cast feature on some custom ROMs + +`-A`, `--add-prop` [prop] [value] + +add a system property both on-the-fly and permanently by adding it to NanoDroid's `system.prop` file + +`-R`, `--remove-prop` [prop] + +remove a system property from NanoDroid's `system.prop` file + +`-L`, `--list-prop` + +list all properties from NanoDroid's `system.prop` file + +### Grant signature spoofing permission + +`-p`, `--permission` + +grant signature spoofing permission to microG GmsCore and Play Store; grant permission to Google Sync Adapters (if they are installed) + +### Fix OTA-Update issues + +`-f`, `--fix-update` + +fix issues with the navigation bar, status bar or lock screen after applying an OTA update; for a detailed description about this check [> XDA](https://www.xda-developers.com/broken-navigation-bar-lock-screen-ota-update/) + +### Airplane Mode settings + +`-P`, `--airplane-mode` + +change Airplane Mode settings, this is interactive, user will be given instructions what to do. This allows to change which radios are disabled by Airplane Mode **and additionally** it instructs Android that it does **not** allow re-activation of **those** radios until Airplane Mode is switched off + +### Prevent audio focus stealing + +`-F`, `--audio-focus` [app] + +some apps stop audio playback of other apps, when you bring them in foreground (or activate them in multi window mode), with this you can prevent Android from allowing this; [app] is the application name in `com.organisation.application` format, for example `com.xda.labs` + +### Prevent clipboard reading + +`-B`, `--read-clipboard` [app] + +many apps have the permission to read the clipboard for no reason, with this you can prevent Android from allowing this; [app] is the application name in `com.organisation.application` format, for example `com.xda.labs` + +**Note:** don't do this in applications like Browsers or the-like, as you'll disable the whole copy-paste feature for those app(s) with this feature + +### Read boot count + +`-b`, `--boot-count` + +show how often the device was booted; requires Anroid 7.0 or newer diff --git a/doc/Phonesky.diff b/doc/Phonesky.diff new file mode 100644 index 00000000..b64ac542 --- /dev/null +++ b/doc/Phonesky.diff @@ -0,0 +1,51 @@ +diff -Nupr PS_8341U.orig/AndroidManifest.xml PS_8341U/AndroidManifest.xml +--- PS_8341U.orig/AndroidManifest.xml 2017-10-04 18:36:14.626046215 +0200 ++++ PS_8341U/AndroidManifest.xml 2017-10-04 18:37:49.536606698 +0200 +@@ -1,4 +1,5 @@ + ++ + + + +@@ -99,6 +100,7 @@ + + + ++ + + + +@@ -801,4 +803,4 @@ + + + +- +\ Kein Zeilenumbruch am Dateiende. ++ +diff -Nupr PS_8341U.orig/res/values/public.xml PS_8341U/res/values/public.xml +--- PS_8341U.orig/res/values/public.xml 2017-10-04 18:36:13.897067289 +0200 ++++ PS_8341U/res/values/public.xml 2017-10-04 18:38:12.345086938 +0200 +@@ -7854,6 +7854,7 @@ + + + ++ + + + +@@ -8601,4 +8602,4 @@ + + + +- +\ Kein Zeilenumbruch am Dateiende. ++ +diff -Nupr PS_8341U.orig/res/values/strings.xml PS_8341U/res/values/strings.xml +--- PS_8341U.orig/res/values/strings.xml 2017-10-04 18:36:13.896067318 +0200 ++++ PS_8341U/res/values/strings.xml 2017-10-04 18:38:42.511425925 +0200 +@@ -1714,4 +1714,5 @@ First turn on NFC in your settings, then + Year + Yes + "Yes, I'm In" ++ 308204433082032ba003020102020900c2e08746644a308d300d06092a864886f70d01010405003074310b3009060355040613025553311330110603550408130a43616c69666f726e6961311630140603550407130d4d6f756e7461696e205669657731143012060355040a130b476f6f676c6520496e632e3110300e060355040b1307416e64726f69643110300e06035504031307416e64726f6964301e170d3038303832313233313333345a170d3336303130373233313333345a3074310b3009060355040613025553311330110603550408130a43616c69666f726e6961311630140603550407130d4d6f756e7461696e205669657731143012060355040a130b476f6f676c6520496e632e3110300e060355040b1307416e64726f69643110300e06035504031307416e64726f696430820120300d06092a864886f70d01010105000382010d00308201080282010100ab562e00d83ba208ae0a966f124e29da11f2ab56d08f58e2cca91303e9b754d372f640a71b1dcb130967624e4656a7776a92193db2e5bfb724a91e77188b0e6a47a43b33d9609b77183145ccdf7b2e586674c9e1565b1f4c6a5955bff251a63dabf9c55c27222252e875e4f8154a645f897168c0b1bfc612eabf785769bb34aa7984dc7e2ea2764cae8307d8c17154d7ee5f64a51a44a602c249054157dc02cd5f5c0e55fbef8519fbe327f0b1511692c5a06f19d18385f5c4dbc2d6b93f68cc2979c70e18ab93866b3bd5db8999552a0e3b4c99df58fb918bedc182ba35e003c1b4b10dd244a8ee24fffd333872ab5221985edab0fc0d0b145b6aa192858e79020103a381d93081d6301d0603551d0e04160414c77d8cc2211756259a7fd382df6be398e4d786a53081a60603551d2304819e30819b8014c77d8cc2211756259a7fd382df6be398e4d786a5a178a4763074310b3009060355040613025553311330110603550408130a43616c69666f726e6961311630140603550407130d4d6f756e7461696e205669657731143012060355040a130b476f6f676c6520496e632e3110300e060355040b1307416e64726f69643110300e06035504031307416e64726f6964820900c2e08746644a308d300c0603551d13040530030101ff300d06092a864886f70d010104050003820101006dd252ceef85302c360aaace939bcff2cca904bb5d7a1661f8ae46b2994204d0ff4a68c7ed1a531ec4595a623ce60763b167297a7ae35712c407f208f0cb109429124d7b106219c084ca3eb3f9ad5fb871ef92269a8be28bf16d44c8d9a08e6cb2f005bb3fe2cb96447e868e731076ad45b33f6009ea19c161e62641aa99271dfd5228c5c587875ddb7f452758d661f6cc0cccb7352e424cc4365c523532f7325137593c4ae341f4db41edda0d0b1071a7c440f0fe9ea01cb627ca674369d084bd2fd911ff06cdbf2cfa10dc0f893ae35762919048c7efc64c7144178342f70581c9de573af55b390dd7fdb9418631895d5f759f30112687ff621410c069308a + diff --git a/doc/PseudoDebloat.md b/doc/PseudoDebloat.md new file mode 100644 index 00000000..18458ec2 --- /dev/null +++ b/doc/PseudoDebloat.md @@ -0,0 +1,62 @@ +# Pseudo-Debloated applications + +Magisk allows for apps to be magically removed upon runtime, they don't get actually removed from `/system` but they are pseudo-removed during runtime. The pseudo-debloat feature is not available when NanoDroid is installed in System Mode + +## Default Settings + +The following applications are pseudo-debloated by default + +* Basic Dreams +* Calendar +* CM File Manager +* crDroid Filemanager and Music Player +* Eleven, Phonograph (Audio Player) +* E-Mail + Exchange2 +* Browser, Gello, Slimperience, Via Browser, Jelly (Browser) +* PhotoTable +* Sound Recorder, Recorder +* messaging (SMS & MMS) +* Wallpaper, WallpaperPickerGoogle (Google Wallpaper application) +* Wallpaper Backup +* mGerrit +* FM Radio +* Gallery2 +* OmniSwitch +* Screencast +* Snap, Snapdragon Camera (Camera) +* Resurrection Remix Statistics +* Sim Toolkit + +## Alter the list of pseudo-debloated applications + +**This feature is only available when installing as Magisk Module!** + +You can pseudo-debloat applications by adding them to configuration file + +`.nanodroid-overlay` + +on your device, in one of the following directories + +* `/sdcard` (internal storage) +* `/external_sd` (TWRP path to SD Card (if any)) +* directory containing the zip file +* `/data` (fallabck) + +See the [default settings](.nanodroid-overlay). + +Alternatively you can also use the NanoDroid Setup Wizard package instead of manual creation of the configuration file. + +The syntax is pretty simple: + +* one app per line +* name must be an exact match + +After you've made your changes, issue the following command on your device, either using `adb shell` or **Termux** as root: + +`nanodroid-overlay --update` + +This needs to be done in normal environment. If you're in **TWRP** you'll have to manually mount `/magisk` (you may use the `mount-magisk` script from the git repo for this purpose). + +## Additional options + +The `nanodroid-overlay` script has more options available, see [> nanodroid-overlay](NanoDroidOverlay). diff --git a/doc/ZeldaSounds.md b/doc/ZeldaSounds.md new file mode 100644 index 00000000..54a21a28 --- /dev/null +++ b/doc/ZeldaSounds.md @@ -0,0 +1,38 @@ +# Zelda ringtones and sounds + +The following **The Legend of Zelda** ringtones and sounds are included in NanoDroid + +## Notification sounds + +* Flute +* Gold Bug Catch +* Hey Listen +* Intro +* Midna Alert +* Secret +* Start +* Vessel + +## Ringtones + +* Bolero of Fire +* Gerudo Valley +* House Remix (original title theme) +* Lost Woods Dubstep +* Lost Woods +* Market Theme +* Minuet of Forest +* Nocturne of Shadows +* Prelude of Light +* Requiem of Spirits +* Sarias Song +* Serenade of Water +* Shadow World +* Song of Storms +* Song of Time + +## User Interface Sounds + +* Lock +* LowBattery +* Unlock diff --git a/force-debloat b/force-debloat new file mode 100755 index 00000000..0f621d14 --- /dev/null +++ b/force-debloat @@ -0,0 +1,165 @@ +#!/sbin/sh + +# check for configuration files +config_locations="/sdcard /external_sd /tmp /data" + +get_config () { + config="" + config_exists=0 + for path in ${config_locations}; do + if test -r "${path}/${1}" -a -f "${path}/${1}"; then + config="${path}/${1}" + config_exists=1 + return + fi + done +} + +# check whether '.nanodroid-overlay' has new format +# and update if required +check_nanodroidoverlay () { + if grep -q "APPS=(" "${config}"; then + ui_print " ++ migrating ${config} to new format" + sed -e 's/^.*APPS=//;s/(//g;s/)//g' -i "${config}" + sed '/^\s*$/d' -i "${config}" + fi +} + +# check whether '.nanodroid-overlay' exists, +# if not, use fallback ${APPS} +get_config .nanodroid-overlay +if [ "$config_exists" -eq 1 ]; then + APPS="$(cat "${config}")" + NO_NANODROIDOVERLAY=0 + check_nanodroidoverlay +else NO_NANODROIDOVERLAY=1 +APPS="BasicDreams +Browser +Calendar +Camera2 +CMFileManager +Eleven +Email +Exchange2 +FMRadio +Gallery2 +Gello +Jelly +messaging +mGerrit +OmniSwitch +Phonograph +PhotoTable +Recorder +ResurrectionStats +Screencast +Slimperience +Snap +SnapdragonCamera +SoundRecorder +Stk +ViaBrowser +Wallpaper +WallpaperBackup +WallpaperPickerGoogle" +fi + +is_mounted() { + if [ ! -z "$2" ]; then + cat /proc/mounts | grep $1 | grep $2, >/dev/null + else + cat /proc/mounts | grep $1 >/dev/null + fi + return $? +} + +debloat_system () { + if (is_mounted /system); then + mount -orw,remount /system || error "!! failed to remount system read-write" + else mount -orw /system || error "!! failed to mount system read-write" + fi + + for app in ${APPS}; do + if [[ -d /system/app/${app} ]]; then + rm -rf /system/app/${app} + echo "${app} removed from /system/app" + elif [[ -d /system/priv-app/${app} ]]; then + rm -rf /system/priv-app/${app} + echo "${app} removed from /system/priv-app" + fi + done + + umount /system +} + +test_debloat_system () { + if (is_mounted /system); then + mount -orw,remount /system || error "!! failed to remount system read-write" + else mount -orw /system || error "!! failed to mount system read-write" + fi + + echo "***** TEST MODE *****" + + for app in ${APPS}; do + if [[ -d /system/app/${app} ]]; then + echo "${app} would be removed from /system/app" + elif [[ -d /system/priv-app/${app} ]]; then + rm -rf /system/priv-app/${app} + echo "${app} would be removed from /system/priv-app" + fi + done + + echo "***** END TEST MODE ***** + +if that looks good to you, re-run the Script, else +edit the Script or your '.nanodroid-overlay' file" + + umount /system +} + +error () { + echo "${@}" + exit 1 +} + +[[ ! -d /twres ]] && error "Not running from TWRP, exiting" +is_mounted /data || mount /data + +echo "NanoDroid force-debloat script + +This script will actually remove apps from your ROM +" + +if [[ ${NO_NANODROIDOVERLAY} -eq 0 ]]; then + echo "using \"${nanodroidoverlay}\" file for values" +else echo "using fallback values" +fi + +[[ -f /data/adb/magisk/magisk ]] && echo "Magisk is installed! + +instead of using this Script, consider using Magisk +to pseudo-debloat your ROM instead. NanoDroid includes +the 'nanodroid-overlay' Script to ease doing so." + +echo " +Are you sure you want to proceed? + +Enter [y] / [j] to remove applications +Enter [t] / [d] to test what would be done +" + +read -r USER_INPUT + +case ${USER_INPUT} in + y | Y | j | J ) + debloat_system + ;; + + t | T | d | D ) + debloat_system --test + ;; + + *) + error "Exiting" + ;; +esac diff --git a/framework-patcher b/framework-patcher new file mode 100755 index 00000000..288171a9 --- /dev/null +++ b/framework-patcher @@ -0,0 +1,130 @@ +#!/bin/bash + +GITHUB_URL="https://github.com/Lanchon/haystack.git" +PATCH_CORE="sigspoof-core" +CWD=$(readlink -m "${BASH_SOURCE[0]}") +CWD=$(dirname "${CWD}") + +error () { + echo -e "${@}" + exit 1 +} + +help () { + +echo -e "haystack framework patcher helper + +provide Android Version like: + framework-patcher.sh [version] [--gui] + +there version is one of: + 4.1 [JB] + 4.2 [JB] + 4.3 [JB] + 4.4 [KK] + 5.0 [LL] + 5.1 [LL] + 6.0 [MM] + 7.0 [N] + 7.1 [N] + 8.0 [O] + 8.1 [O] + +--gui enables Signature Spoofing toggle in Developer Settings. + +your device must be in TWRP and connected to PC." + +exit 0 + +} + +case "${1}" in + 4.1 ) API=16 ;; + 4.2 ) API=17 ;; + 4.3 ) API=18 ;; + 4.4 ) API=19 ;; + 5.0 ) API=21 ;; + 5.1 ) API=22 ;; + 6.0 ) API=23 ;; + 7.0 ) API=24 ;; + 7.1 ) API=25 ;; + 8.0 ) API=26 ;; + 8.1 ) API=27 ;; + * ) help ;; +esac + +[[ "${2}" == "--gui" && ${API} -lt 25 ]] && WITH_UI=1 + +if [[ ${API} -lt 24 ]]; then + PATCH_HOOK="sigspoof-hook-4.1-6.0" + PATCH_UI="sigspoof-ui-global-4.1-6.0" +else + PATCH_HOOK="sigspoof-hook-7.0-7.1" + PATCH_UI="sigspoof-ui-global-7.0-7.1" +fi + +adb shell "[[ -d /twres ]] && exit 0" || error "Device is not in TWRP!" + +if [[ -d ${CWD}/haystack/.git ]]; then + cd "${CWD}/haystack" + rm -rf mydevice* + git pull +else + rm -rf "${CWD}/haystack" + git clone "${GITHUB_URL}" || error "Failed to down haystack!" + cd "${CWD}/haystack" +fi + +if [[ "$OSTYPE" == "darwin"* ]]; then + if ! [ -x "$(command -v brew)" ]; then + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + fi + if ! [ -x "$(command -v greadlink)" ]; then + brew install coreutils + fi + alias readlink=greadlink + alias cp=gcp +fi + +adb shell "umount /system" +adb shell "mount -orw /system" || error "Failed to mount /system read-write" + +rm -rf "${CWD}/haystack/mydevice*" +"${CWD}/haystack/pull-fileset" mydevice || error "Failed to pull files from device!" + +"${CWD}/haystack/patch-fileset" "${CWD}/haystack/patches/${PATCH_HOOK}" \ + "${API}" "${CWD}/haystack/mydevice" || \ + error "Failed applying sigspoof hook patch!" + +"${CWD}/haystack/patch-fileset" "${CWD}/haystack/patches/${PATCH_CORE}" "${API}" \ + "${CWD}/haystack/mydevice__${PATCH_HOOK}" \ + || error "Failed applying sigspoof core patch!" + +if [[ ${WITH_UI} -eq 1 ]]; then + "${CWD}/haystack/patch-fileset" "${CWD}/haystack/patches/${PATCH_UI}" "${API}" \ + "${CWD}/haystack/mydevice__${PATCH_HOOK}__${PATCH_CORE}" \ + || error "Failed applying sigspoof ui patch!" + + adb push "${CWD}/haystack/mydevice__${PATCH_HOOK}__${PATCH_CORE}__${PATCH_UI}/services.jar" \ + /tmp/services.jar || error "Failed to push services.jar to device" + + adb push "${CWD}/haystack/mydevice__${PATCH_HOOK}__${PATCH_CORE}__${PATCH_UI}/Settings.apk" \ + /tmp/Settings.apk || error "Failed to push services.jar to device" + +else + adb push "${CWD}/haystack/mydevice__${PATCH_HOOK}__${PATCH_CORE}/services.jar" \ + /tmp/services.jar || error "Failed to push services.jar to device" +fi + +adb push "${CWD}/framework-patcher-remote" /tmp/ || \ + error "Failed to push helper script to device" + +adb shell "chmod 0755 /tmp/framework-patcher-remote" || \ + error "Failed to set permissions for helper script" + +adb shell "/tmp/framework-patcher-remote" || \ + error "Failed to install services.jar" + +echo -e "\nNow reboot device and enjoy microG!" + +cd "${CWD}" diff --git a/framework-patcher-remote b/framework-patcher-remote new file mode 100755 index 00000000..58f78411 --- /dev/null +++ b/framework-patcher-remote @@ -0,0 +1,135 @@ +#!/sbin/sh + +is_mounted() { + if [ ! -z "$2" ]; then + cat /proc/mounts | grep $1 | grep $2, >/dev/null + else + cat /proc/mounts | grep $1 >/dev/null + fi + return $? +} + +request_size_check() { + reqSizeM=`unzip -l "$1" 2>/dev/null | tail -n 1 | awk '{ print $1 }'` + reqSizeM=$((reqSizeM / 1048576 + 1)) +} + +image_size_check() { + e2fsck -yf $1 + curBlocks=`e2fsck -n $1 2>/dev/null | grep $1 | cut -d, -f3 | cut -d\ -f2`; + curUsedM=`echo "$curBlocks" | cut -d/ -f1` + curSizeM=`echo "$curBlocks" | cut -d/ -f1` + curFreeM=$(((curSizeM - curUsedM) * 4 / 1024)) + curUsedM=$((curUsedM * 4 / 1024 + 1)) + curSizeM=$((curSizeM * 4 / 1024)) +} + +grow_magisk_img () { + request_size_check /tmp/services.jar + image_size_check ${MAGISK_IMG} + if [ "$reqSizeM" -gt "$curFreeM" ]; then + SIZE=$(((reqSizeM + curUsedM) / 32 * 32 + 64)) + resize2fs ${MAGISK_IMG} ${SIZE}M + fi +} + +shrink_magisk_img () { + image_size_check ${MAGISK_IMG} + NEWDATASIZE=$((curUsedM / 32 * 32 + 32)) + if [ "$curSizeM" -gt "$NEWDATASIZE" ]; then + resize2fs $IMG ${NEWDATASIZE}M + fi +} + +mount_image() { + if [ ! -d "$2" ]; then + mount -o rw,remount rootfs / + mkdir -p "$2" 2>/dev/null + $BOOTMODE && mount -o ro,remount rootfs / + [ ! -d "$2" ] && return 1 + fi + + if ! is_mounted "$2"; then + LOOPDEVICE= + for LOOP in 0 1 2 3 4 5 6 7; do + if ! is_mounted "$2"; then + LOOPDEVICE=/dev/block/loop$LOOP + [ -e $LOOPDEVICE ] || mknod $LOOPDEVICE b 7 $LOOP 2>/dev/null + losetup $LOOPDEVICE "$1" && mount -t ext4 -o loop $LOOPDEVICE "$2" + if is_mounted "$2"; then + echo "$LOOPDEVICE" > /tmp/loopdevice + break; + fi + fi + done + fi +} + +mount_magisk () { + mount /data &>/dev/null + mount_image ${MAGISK_IMG} /magisk +} + +umount_magisk () { + umount /magisk + losetup -d $(cat /tmp/loopdevice) + rm /tmp/loopdevice +} + + +if [[ -f /data/adb/magisk.img ]]; then + MAGISK_IMG=/data/adb/magisk.img +elif [[ -f /data/magisk.img ]]; then + MAGISK_IMG=/data/magisk.img +fi + +if [[ -f ${MAGISK_IMG} ]]; then + grow_magisk_img + echo "magisk found: mount to /magisk" + mount_magisk +fi + +if [[ -f /data/adb/.nanodroid-patcher ]]; then + echo " ++ /system/.nanodroid-patcher exists" + echo " ++ assuming ROM is already patched" + exit 0 +fi + +install_path="" + +if [[ -d /magisk/NanoDroid ]]; then + echo "NanoDroid detected" + install_path="/magisk/NanoDroid/system" + mkdir -p "${install_path}" +elif [[ -d /magisk/NanoDroid_microG ]]; then + echo "NanoDroid microG detected" + install_path="/magisk/NanoDroid_microG/system" + mkdir -p "${install_path}" +else + echo "backing up services.jar to /sdcard" + cp /tmp/services.jar /sdcard + + echo "using ROM as destination" + install_path="/system" + + echo /system/framework/services.jar >> \ + /system/.nanodroid-list +fi + +echo "install to \"${install_path}\"" +cp /tmp/services.jar "${install_path}/framework" || exit 1 + +if [[ -f /tmp/Settings.apk ]]; then + cp /tmp/Settings.apk "${install_path}/priv-app/Settings/Settings.apk" || exit 1 +fi + +touch /data/adb/.nanodroid-patcher + +if (is_mounted /magisk); then + echo "unmount /magisk" + umount_magisk + shrink_magisk_img +fi + +echo "unmount /system" +umount /system diff --git a/microG/META-INF/com/google/android/update-binary b/microG/META-INF/com/google/android/update-binary new file mode 100644 index 00000000..dcb0dcd2 --- /dev/null +++ b/microG/META-INF/com/google/android/update-binary @@ -0,0 +1,39 @@ +#!/sbin/sh + +umask 022 +OUTFD=${2} +ZIP=${3} + +ZIPDIR=$(dirname "${ZIP}") +MODID=NanoDroid_microG + +unzip -o "${ZIP}" nanodroid-functions -d "/tmp" || \ + error " !! failed to load Common Installer" +source "/tmp/nanodroid-functions" || \ + error " !! failed to load Common Installer" + +detect_bootmode +detect_outfd + +show_banner + +check_system +unpack_zip +detect_arch + +get_cfg_setup +get_cfg_overlay + +detect_mode + +install_microg +install_mapsv1 +install_gsync +install_store +install_swipe +install_bash +install_novl + +nanodroid_finalize + +exit 0 diff --git a/microG/META-INF/com/google/android/updater-script b/microG/META-INF/com/google/android/updater-script new file mode 100644 index 00000000..11d5c96e --- /dev/null +++ b/microG/META-INF/com/google/android/updater-script @@ -0,0 +1 @@ +#MAGISK diff --git a/microG/module.prop b/microG/module.prop new file mode 100644 index 00000000..4e1948d1 --- /dev/null +++ b/microG/module.prop @@ -0,0 +1,7 @@ +id=NanoDroid_microG +name=NanoDroid (microG sub module) +version=v15.90.99999999 +versionCode=34 +author=Nanolx +description=NanoDroid (microG sub module) for LineageOS/AOSP based ROMs +minMagisk=1500 diff --git a/mount-magisk b/mount-magisk new file mode 100755 index 00000000..89ac021b --- /dev/null +++ b/mount-magisk @@ -0,0 +1,58 @@ +#!/sbin/sh + +is_mounted() { + if [ ! -z "$2" ]; then + cat /proc/mounts | grep $1 | grep $2, >/dev/null + else + cat /proc/mounts | grep $1 >/dev/null + fi + return $? +} + +mount_image() { + if [ ! -d "$2" ]; then + mount -o rw,remount rootfs / + mkdir -p "$2" 2>/dev/null + [ ! -d "$2" ] && return 1 + fi + + if ! is_mounted "$2"; then + LOOPDEVICE= + for LOOP in 0 1 2 3 4 5 6 7; do + if ! is_mounted "$2"; then + LOOPDEVICE=/dev/block/loop$LOOP + [ -e $LOOPDEVICE ] || mknod $LOOPDEVICE b 7 $LOOP 2>/dev/null + losetup $LOOPDEVICE "$1" && mount -t ext4 -o loop $LOOPDEVICE "$2" + if is_mounted "$2"; then + echo "$LOOPDEVICE" > /tmp/loopdevice + break; + fi + fi + done + fi +} + +mount_magisk () { + mount /data &>/dev/null + + if [ -f /data/adb/magisk.img ]; then + mount_image /data/adb/magisk.img /magisk + elif [ -f /data/magisk.img ]; then + mount_image /data/magisk.img /magisk + fi +} + +umount_magisk () { + umount /magisk + losetup -d $(cat /tmp/loopdevice) + rm /tmp/loopdevice +} + +if (is_mounted /magisk); then + if [ -f /tmp/loopdevice ]; then + umount_magisk + else echo "Magisk is mounted, but not using mount-magisk" + echo "not unmounting Magisk" + fi +else mount_magisk +fi diff --git a/patcher/META-INF/com/google/android/update-binary b/patcher/META-INF/com/google/android/update-binary new file mode 100644 index 00000000..0e3a5fc9 --- /dev/null +++ b/patcher/META-INF/com/google/android/update-binary @@ -0,0 +1,495 @@ +#!/sbin/sh + +OUTFD=$2 +ZIP=$3 + +# Detect whether in boot mode +ps | grep zygote | grep -v grep >/dev/null && BOOTMODE=true || BOOTMODE=false +$BOOTMODE || ps -A 2>/dev/null | grep zygote | grep -v grep >/dev/null && BOOTMODE=true + +# This path should work in any cases +TMPDIR=/dev/tmp/install + +BASEDIR="${TMPDIR}/dexpatcher" +export ANDROID_DATA="${BASEDIR}" +PATH="${PATH}:/system/bin:/system/xbin" +PATCH_CORE="${BASEDIR}/core_services.jar.dex" + +MAGISK_IMG=/data/adb/magisk.img +MAGISK_PATH=/dev/tmp/magisk_img + +########################################################################################## +# Generic Functions +########################################################################################## + +detect_outfd () { + readlink /proc/$$/fd/$OUTFD 2>/dev/null | grep /tmp >/dev/null + if [ "$?" -eq "0" ]; then + OUTFD=0 + + for FD in `ls /proc/$$/fd`; do + readlink /proc/$$/fd/$FD 2>/dev/null | grep pipe >/dev/null + if [ "$?" -eq "0" ]; then + ps | grep " 3 $FD " | grep -v grep >/dev/null + if [ "$?" -eq "0" ]; then + OUTFD=$FD + break + fi + fi + done + fi +} + +ui_print() { + if $BOOTMODE; then + echo "$1" + else + echo -n -e "ui_print $1\n" >> /proc/self/fd/$OUTFD + echo -n -e "ui_print\n" >> /proc/self/fd/$OUTFD + fi +} + +is_mounted() { + if [ ! -z "$2" ]; then + cat /proc/mounts | grep $1 | grep $2, >/dev/null + else + cat /proc/mounts | grep $1 >/dev/null + fi + return $? +} + +mount_image() { + if [ ! -d "$2" ]; then + mount -o rw,remount rootfs / + mkdir -p "$2" 2>/dev/null + $BOOTMODE && mount -o ro,remount rootfs / + [ ! -d "$2" ] && return 1 + fi + + if ! is_mounted "$2"; then + LOOPDEVICE= + for LOOP in 0 1 2 3 4 5 6 7; do + if ! is_mounted "$2"; then + LOOPDEVICE=/dev/block/loop$LOOP + [ -e $LOOPDEVICE ] || mknod $LOOPDEVICE b 7 $LOOP 2>/dev/null + losetup $LOOPDEVICE "$1" && mount -t ext4 -o loop $LOOPDEVICE "$2" + if is_mounted "$2"; then + break; + fi + fi + done + fi +} + +error () { + ui_print "${@}" + magisk_cleanup + exit 1 +} + +grep_prop() { + REGEX="s/^$1=//p" + shift + FILES=$@ + if [ -z "$FILES" ]; then + FILES='/system/build.prop' + fi + cat $FILES 2>/dev/null | sed -n "$REGEX" | head -n 1 +} + +detect_odex () { + [ -n "$(find '/system/framework/' -name '*.odex')" ] && \ + error " !! odexed ROMs are not supported" +} + +detect_arch () { + ABI=$(grep_prop ro.product.cpu.abi | cut -c-3) + ABI2=$(grep_prop ro.product.cpu.abi2 | cut -c-3) + ABILONG=$(grep_prop ro.product.cpu.abi) + + ARCH=arm + + [ "$ABI" = "x86" ] && ARCH=x86 + [ "$ABI2" = "x86" ] && ARCH=x86 + [ "$ABILONG" = "arm64-v8a" ] && ARCH=arm64 + [ "$ABILONG" = "x86_64" ] && ARCH=x86_64 + + case ${ARCH} in + arm | arm64 ) + FILE=${BASEDIR}/file.arm + ZIPB=${BASEDIR}/zip.arm + ;; + x86 | x86_64 ) + FILE=${BASEDIR}/file.x86 + ZIPB=${BASEDIR}/zip.x86 + ;; + esac + + case ${ARCH} in + arm | x86 ) + C_LD="/system/lib:/system/vendor/lib" + ;; + + arm64 | x86_64 ) + C_LD="/system/lib64:/system/vendor/lib64" + ;; + esac + + ui_print " > device architecture: ${ARCH}" +} + +detect_sdk () { + SDK_VERSION=$(awk -F= '/^ro.build.version.sdk/{print $2}' /system/build.prop) + + [ "${SDK_VERSION}" -gt 27 ] && \ + error " !! Android versions beyond Oreo are not yet supported" + + [ "${SDK_VERSION}" -ge 25 ] && \ + nanodroid_sigspoofui=0 + + [ "${SDK_VERSION}" -lt 16 ] && \ + error " !! Android versions before Jelly Bean are not supported" + + if [ "${SDK_VERSION}" -lt 24 ]; then + ui_print " > Android 4.1 - 6.0 (SDK ${SDK_VERSION}) detected" + PATCH_HOOK="${BASEDIR}/hook_4.1-6.0_services.jar.dex" + PATCH_UI_SERVICES="${BASEDIR}/ui_4.1-6.0_services.jar.dex" + PATCH_UI_SETTINGS="${BASEDIR}/ui_4.1-6.0_Settings.apk.dex" + else + ui_print " > Android 7.0 - 8.1 (SDK ${SDK_VERSION}) detected" + PATCH_HOOK="${BASEDIR}/hook_7.0-8.0_services.jar.dex" + PATCH_UI_SERVICES="${BASEDIR}/ui_7.0-8.0_services.jar.dex" + PATCH_UI_SETTINGS="${BASEDIR}/ui_7.0-8.0_Settings.apk.dex" + fi + + [ "${SDK_VERSION}" -gt 21 ] && DEX_OPTS="--multi-dex-threaded" +} + +########################################################################################## +# Patcher Functions +########################################################################################## + +setup_patcher () { + ui_print " > preparing environment" + + rm -rf ${TMPDIR} + mkdir -p ${TMPDIR} + + unzip -o "${ZIP}" -d ${TMPDIR} || \ + error " !! failed to prepare environment" + + for bin in zip.arm zip.x86 file.arm file.x86; do + chmod 0755 "${BASEDIR}/${bin}" || \ + error " !! failed to prepare environment" + done +} + +########################################################################################## +# Patcher Functions +########################################################################################## + +patch_services () { + ui_print " " + ui_print " > patching signature spoofing support" + ui_print " " + + for jar in /system/framework/*.jar ; do + BOOTCLASSES=${BOOTCLASSES}:${jar} + done + + cp /system/framework/services.jar \ + ${BASEDIR}/services.jar || \ + error " !! failed to copy services.jar" + + [ "${SDK_VERSION}" -gt 21 ] && \ + mkdir -p "${BASEDIR}/services.jar-mod" + + if [ "${nanodroid_sigspoofui}" -eq 1 ]; then + PATCHES="${PATCH_HOOK} ${PATCH_CORE} ${PATCH_UI_SERVICES}" + else PATCHES="${PATCH_HOOK} ${PATCH_CORE}" + fi + + ui_print " >> patching services.jar" + LD_LIBRARY_PATH=${C_LD} \ + /system/bin/dalvikvm \ + -Xbootclasspath:"${BOOTCLASSES}" \ + -classpath "${BASEDIR}/dexpatcher.dex" \ + lanchon.dexpatcher.Main \ + ${DEX_OPTS} --api-level "${SDK_VERSION}" \ + --debug --stats --verbose \ + --output ${BASEDIR}/services.jar-mod \ + ${BASEDIR}/services.jar ${PATCHES} || \ + error " !! failed to apply patches" + + LD_LIBRARY_PATH=${C_LD} \ + ${ZIPB} -d "${BASEDIR}/services.jar" \ + 'classes*.dex' || \ + error " !! zip failed" + + LD_LIBRARY_PATH=${C_LD} \ + ${ZIPB} -j "${BASEDIR}/services.jar" \ + "${BASEDIR}/services.jar-mod"/classes*.dex || \ + error " !! zip failed" + + [ "${nanodroid_sigspoofui}" -eq 1 ] && patch_services_ui +} + +patch_services_ui () { + ui_print " " + ui_print " > patching signature spoofing user interface" + ui_print " " + + if [[ -f /system/priv-app/Settings/Settings.apk ]]; then + SETTINGS_APK_PATH=/system/priv-app/Settings/Settings.apk + elif [[ -f /system/priv-app/SecSettings/SecSettings.apk ]]; then + SETTINGS_APK_PATH=/system/priv-app/SecSettings/SecSettings.apk + elif [[ -f /system/priv-app/SecSettings2/SecSettings2.apk ]]; then + SETTINGS_APK_PATH=/system/priv-app/SecSettings2/SecSettings2.apk + else error " !! neither Settings.apk nor SecSettings[2].apk found" + fi + + SETTINGS_APK_NAME=$(basename ${SETTINGS_APK_PATH}) + SETTINGS_APK_DIR=$(basename ${SETTINGS_APK_NAME} .apk) + + cp ${SETTINGS_APK_PATH} ${BASEDIR}/${SETTINGS_APK_NAME} || \ + error " !! failed to copy ${SETTINGS_APK_NAME}" + + [ "${SDK_VERSION}" -gt 21 ] && \ + mkdir -p "${BASEDIR}/Settings.apk-mod" + + ui_print " >> patching ${SETTINGS_APK_NAME}" + LD_LIBRARY_PATH=${C_LD} \ + /system/bin/dalvikvm \ + -Xbootclasspath:"${BOOTCLASSES}" \ + -classpath "${BASEDIR}/dexpatcher.dex" \ + lanchon.dexpatcher.Main \ + ${DEX_OPTS} --api-level "${SDK_VERSION}" \ + --verbose --output ${BASEDIR}/Settings.apk-mod \ + ${BASEDIR}/${SETTINGS_APK_NAME} ${PATCH_UI_SETTINGS} || \ + error " !! failed to patch ${SETTINGS_APK_NAME}" + + LD_LIBRARY_PATH=${C_LD} \ + ${ZIPB} -d "${BASEDIR}/${SETTINGS_APK_NAME}" \ + 'classes*.dex' || \ + error " !! zip failed" + + LD_LIBRARY_PATH=${C_LD} \ + ${ZIPB} -j "${BASEDIR}/${SETTINGS_APK_NAME}" \ + "${BASEDIR}/Settings.apk-mod"/classes*.dex || \ + error " !! zip failed" +} + +backup_services_jar () { + ui_print " << backing up services.jar to: /sdcard" + cp /system/framework/services.jar /sdcard || \ + error " !! failed to backup services.jar" +} + +backup_settings_ui () { + if [ "${nanodroid_sigspoofui}" -eq 1 ]; then + ui_print " << backing up ${SETTINGS_APK_NAME} to: /sdcard" + cp ${SETTINGS_APK_PATH} /sdcard || \ + error " !! failed to backup ${SETTINS_APK_NAME}" + fi +} + +install_services () { + ui_print " " + + for destination in /dev/tmp/magisk_img/NanoDroid /dev/tmp/magisk_img/NanoDroid_microG \ + /dev/magisk_merge/NanoDroid /dev/magisk_merge/NanoDroid_microG \ + /sbin/.core/img/NanoDroid /sbin/.core/img/NanoDroid_microG /; do + if [ -d ${destination} ]; then + install_path="${destination}" + break + fi + done + + if [ "${install_path}" = "/" ]; then + mount -orw,remount /system || \ + error " !! failed to mount /system read-write" + backup_services_jar + backup_settings_ui + fi + + ui_print " << installing patched files to: ${install_path}/system" + + mkdir -p "${install_path}/system/framework" + cp ${BASEDIR}/services.jar "${install_path}/system/framework" \ + || error " !! failed to install services.jar" + + if [ "${nanodroid_sigspoofui}" -eq 1 ]; then + mkdir -p "${install_path}/system/priv-app/${SETTINGS_APK_DIR}" + cp ${BASEDIR}/${SETTINGS_APK_NAME} \ + "${install_path}/system/priv-app/${SETTINGS_APK_DIR}/${SETTINGS_APK_NAME}" \ + || error " !! failed to install ${SETTINGS_APK_NAME}" + + fi + + if [ "${install_path}" = "/" ]; then + echo /system/framework/services.jar >> /data/adb/.nanodroid-list + + [ "${nanodroid_sigspoofui}" -eq 1 ] && + echo /system/priv-app/${SETTINGS_APK_DIR}/${SETTINGS_APK_NAME} >> \ + /data/adb/.nanodroid-list + fi + + touch /data/adb/.nanodroid-patcher +} + +########################################################################################## +# addon.d +########################################################################################## + +install_addond () { + ui_print " " + ui_print " Installing addon.d restoration setup" + + mkdir -p /data/adb/nanodroid_patcher + + for file in core_services.jar.dex dexpatcher.dex file.arm file.x86 \ + hook_4.1-6.0_services.jar.dex hook_7.0-8.0_services.jar.dex \ + ui_4.1-6.0_Settings.apk.dex ui_4.1-6.0_services.jar.dex \ + ui_7.0-8.0_Settings.apk.dex ui_7.0-8.0_services.jar.dex \ + zip.arm zip.x86 magic.mgc; do + cp "${BASEDIR}/${file}" /data/adb/nanodroid_patcher/ + done + + cp "${BASEDIR}/75-nanodroidpatcher.sh" "/system/addon.d/" + chmod 0755 "/system/addon.d/75-nanodroidpatcher.sh" +} + +########################################################################################## +# Magisk Functions +########################################################################################## + +grow_magisk_img () { + request_size_check /tmp/services.jar + image_size_check ${MAGISK_IMG} + if [ "$reqSizeM" -gt "$curFreeM" ]; then + SIZE=$(((reqSizeM + curUsedM) / 32 * 32 + 64)) + resize2fs -f ${MAGISK_IMG} ${SIZE}M + e2fsck -yf ${MAGISK_IMG} + fi +} + +shrink_magisk_img () { + image_size_check ${MAGISK_IMG} + NEWDATASIZE=$((curUsedM / 32 * 32 + 32)) + if [ "$curSizeM" -gt "$NEWDATASIZE" ]; then + resize2fs -f ${MAGISK_IMG} ${NEWDATASIZE}M + e2fsck -yf ${MAGISK_IMG} + fi +} + +request_size_check() { + reqSizeM=`unzip -l "$1" 2>/dev/null | tail -n 1 | awk '{ print $1 }'` + reqSizeM=$((reqSizeM / 1048576 + 1)) +} + +image_size_check() { + e2fsck -yf $1 + curBlocks=`e2fsck -n $1 2>/dev/null | grep $1 | cut -d, -f3 | cut -d\ -f2`; + curUsedM=`echo "$curBlocks" | cut -d/ -f1` + curSizeM=`echo "$curBlocks" | cut -d/ -f1` + curFreeM=$(((curSizeM - curUsedM) * 4 / 1024)) + curUsedM=$((curUsedM * 4 / 1024 + 1)) + curSizeM=$((curSizeM * 4 / 1024)) +} + +magisk_setup () { + if [ -f ${MAGISK_IMG} ]; then + grow_magisk_img || \ + error " !! failed to grow magisk.img" + mount_image ${MAGISK_IMG} ${MAGISK_PATH} || \ + error " !! failed to mount ${MAGISK_PATH}" + fi +} + +magisk_cleanup () { + if (is_mounted ${MAGISK_PATH}); then + umount ${MAGISK_PATH} + losetup -d $LOOPDEVICE + rmdir ${MAGISK_PATH} + shrink_magisk_img || \ + error " !! failed to shrink magisk.img" + fi +} + +########################################################################################## +# Configuration File +########################################################################################## + +# check for configuration files +config_locations="/sdcard /external_sd $(dirname ${ZIP})) /data" + +get_config () { + config="" + config_exists=0 + for path in ${config_locations}; do + if test -r "${path}/${1}" -a -f "${path}/${1}"; then + config="${path}/${1}" + config_exists=1 + return + fi + done +} + +detect_outfd + +ui_print " " +ui_print "********************************" +ui_print " NanoDroid 15.90.99999999 " +ui_print " created by @Nanolx " +ui_print " Framework Patcher " +ui_print "Powered by DexPatcher (@lanchon)" +ui_print "********************************" +ui_print " " + +# fallback value +nanodroid_sigspoofui=0 + +get_config .nanodroid-setup +[ "$config_exists" -eq 1 ] && source ${config} + +if ! (is_mounted /data); then + mount -orw /data || error " !! failed to mount /data" +else mount -orw,remount /data || \ + error " !! failed to remount /data read-write" +fi + +if [ -f /data/adb/.nanodroid-patcher ]; then + ui_print " !! /data/adb/.nanodroid-patcher exists" + ui_print " !! if you want to force patching, then" + error " !! remove this file and try again" +fi + +if ! (is_mounted /system); then + mount -oro /system || error " !! failed to mount /system" +fi + +setup_patcher + +detect_sdk +detect_arch +detect_odex + +[ -f ${MAGISK_IMG} ] && magisk_setup + +patch_services +install_services +install_addond + +ui_print " " +ui_print " >> clean up" + +magisk_cleanup +${BOOTMODE} || umount /system 2>/dev/null + +ui_print " " +ui_print " > Done!" +ui_print " " +ui_print "Thanks for using NanoDroid" +ui_print " " + +exit 0 diff --git a/patcher/META-INF/com/google/android/updater-script b/patcher/META-INF/com/google/android/updater-script new file mode 100644 index 00000000..11d5c96e --- /dev/null +++ b/patcher/META-INF/com/google/android/updater-script @@ -0,0 +1 @@ +#MAGISK diff --git a/patcher/dexpatcher/75-nanodroidpatcher.sh b/patcher/dexpatcher/75-nanodroidpatcher.sh new file mode 100644 index 00000000..937c66c7 --- /dev/null +++ b/patcher/dexpatcher/75-nanodroidpatcher.sh @@ -0,0 +1,475 @@ +#!/sbin/sh +########################################################################################## +# +# NanoDroid Patcher survival script +# by Nanolx +# +# Inspired by 99-flashafterupdate.sh of osm0sis @ xda-developers +# Forked from 99-magisk.sh of topjohnwu @ xda-developers +# +########################################################################################## + +. /tmp/backuptool.functions + +# This path should work in any cases +BASEDIR=/data/adb/nanodroid_patcher +TMPDIR=/dev/tmp/install +export ANDROID_DATA="${TMPDIR}" +PATH="${PATH}:/system/bin:/system/xbin" +PATCH_CORE="${BASEDIR}/core_services.jar.dex" + +MAGISK_IMG=/data/adb/magisk.img +MAGISK_PATH=/dev/tmp/magisk_img + +# remove our own, temporary dalvik-cache +rm -rf "${TMPDIR}" +mkdir -p ${TMPDIR} + +# fallback value +nanodroid_sigspoofui=0 + +########################################################################################## +# Generic Functions +########################################################################################## + +ui_print () { + echo -n -e "ui_print $1\n" >> /proc/self/fd/$OUTFD + echo -n -e "ui_print\n" >> /proc/self/fd/$OUTFD +} + +is_mounted () { + if [ ! -z "$2" ]; then + cat /proc/mounts | grep $1 | grep $2, >/dev/null + else + cat /proc/mounts | grep $1 >/dev/null + fi + return $? +} + +mount_image() { + if [ ! -d "$2" ]; then + mount -o rw,remount rootfs / + mkdir -p "$2" 2>/dev/null + [ ! -d "$2" ] && return 1 + fi + + if ! is_mounted "$2"; then + LOOPDEVICE= + for LOOP in 0 1 2 3 4 5 6 7; do + if ! is_mounted "$2"; then + LOOPDEVICE=/dev/block/loop$LOOP + [ -e $LOOPDEVICE ] || mknod $LOOPDEVICE b 7 $LOOP 2>/dev/null + losetup $LOOPDEVICE "$1" && mount -t ext4 -o loop $LOOPDEVICE "$2" + if is_mounted "$2"; then + break; + fi + fi + done + fi +} + +error () { + ui_print "${@}" + magisk_cleanup + exit 1 +} + + +grep_prop() { + REGEX="s/^$1=//p" + shift + FILES=$@ + if [ -z "$FILES" ]; then + FILES='/system/build.prop' + fi + cat $FILES 2>/dev/null | sed -n "$REGEX" | head -n 1 +} + +detect_odex () { + [ -n "$(find '/system/framework/' -name '*.odex')" ] && \ + error " !! odexed ROMs are not supported" +} + +detect_arch () { + ABI=$(grep_prop ro.product.cpu.abi | cut -c-3) + ABI2=$(grep_prop ro.product.cpu.abi2 | cut -c-3) + ABILONG=$(grep_prop ro.product.cpu.abi) + + ARCH=arm + + [ "$ABI" = "x86" ] && ARCH=x86 + [ "$ABI2" = "x86" ] && ARCH=x86 + [ "$ABILONG" = "arm64-v8a" ] && ARCH=arm64 + [ "$ABILONG" = "x86_64" ] && ARCH=x86_64 + + case ${ARCH} in + arm | arm64 ) + FILE=${BASEDIR}/file.arm + ZIPB=${BASEDIR}/zip.arm + ;; + x86 | x86_64 ) + FILE=${BASEDIR}/file.x86 + ZIPB=${BASEDIR}/zip.x86 + ;; + esac + + case ${ARCH} in + arm | x86 ) + C_LD="/system/lib:/system/vendor/lib" + ;; + + arm64 | x86_64 ) + C_LD="/system/lib64:/system/vendor/lib64" + ;; + esac + + ui_print " > device architecture: ${ARCH}" +} + +detect_sdk () { + SDK_VERSION=$(awk -F= '/^ro.build.version.sdk/{print $2}' /system/build.prop) + + [ "${SDK_VERSION}" -gt 27 ] && \ + error " !! Android versions beyond Oreo are not yet supported" + + [ "${SDK_VERSION}" -ge 25 ] && \ + nanodroid_sigspoofui=0 + + [ "${SDK_VERSION}" -lt 16 ] && \ + error " !! Android versions before Jelly Bean are not supported" + + if [ "${SDK_VERSION}" -lt 24 ]; then + ui_print " > Android 4.1 - 6.0 (SDK ${SDK_VERSION}) detected" + PATCH_HOOK="${BASEDIR}/hook_4.1-6.0_services.jar.dex" + PATCH_UI_SERVICES="${BASEDIR}/ui_4.1-6.0_services.jar.dex" + PATCH_UI_SETTINGS="${BASEDIR}/ui_4.1-6.0_Settings.apk.dex" + else + ui_print " > Android 7.0 - 8.1 (SDK ${SDK_VERSION}) detected" + PATCH_HOOK="${BASEDIR}/hook_7.0-8.0_services.jar.dex" + PATCH_UI_SERVICES="${BASEDIR}/ui_7.0-8.0_services.jar.dex" + PATCH_UI_SETTINGS="${BASEDIR}/ui_7.0-8.0_Settings.apk.dex" + fi + + [ "${SDK_VERSION}" -gt 21 ] && DEX_OPTS="--multi-dex-threaded" +} + +########################################################################################## +# Patcher Functions +########################################################################################## + +patch_services () { + ui_print " " + ui_print " > patching signature spoofing support" + ui_print " " + + for jar in /system/framework/*.jar ; do + BOOTCLASSES=${BOOTCLASSES}:${jar} + done + + cp /system/framework/services.jar \ + ${BASEDIR}/services.jar || \ + error " !! failed to copy services.jar" + + [ "${SDK_VERSION}" -gt 21 ] && \ + mkdir -p "${BASEDIR}/services.jar-mod" + + if [ "${nanodroid_sigspoofui}" -eq 1 ]; then + PATCHES="${PATCH_HOOK} ${PATCH_CORE} ${PATCH_UI_SERVICES}" + else PATCHES="${PATCH_HOOK} ${PATCH_CORE}" + fi + + ui_print " >> patching services.jar" + LD_LIBRARY_PATH=${C_LD} \ + /system/bin/dalvikvm \ + -Xbootclasspath:"${BOOTCLASSES}" \ + -classpath "${BASEDIR}/dexpatcher.dex" \ + lanchon.dexpatcher.Main \ + ${DEX_OPTS} --api-level "${SDK_VERSION}" \ + --verbose --output ${BASEDIR}/services.jar-mod \ + ${BASEDIR}/services.jar ${PATCHES} || \ + error " !! failed to apply patches" + + LD_LIBRARY_PATH=${C_LD} \ + ${ZIPB} -d "${BASEDIR}/services.jar" \ + 'classes*.dex' || \ + error " !! zip failed" + + LD_LIBRARY_PATH=${C_LD} \ + ${ZIPB} -j "${BASEDIR}/services.jar" \ + "${BASEDIR}/services.jar-mod"/classes*.dex || \ + error " !! zip failed" + + [ "${nanodroid_sigspoofui}" -eq 1 ] && patch_services_ui +} + +patch_services_ui () { + ui_print " " + ui_print " > patching signature spoofing user interface" + ui_print " " + + if [[ -f /system/priv-app/Settings/Settings.apk ]]; then + SETTINGS_APK_PATH=/system/priv-app/Settings/Settings.apk + elif [[ -f /system/priv-app/SecSettings/SecSettings.apk ]]; then + SETTINGS_APK_PATH=/system/priv-app/SecSettings/SecSettings.apk + elif [[ -f /system/priv-app/SecSettings2/SecSettings2.apk ]]; then + SETTINGS_APK_PATH=/system/priv-app/SecSettings2/SecSettings2.apk + else error " !! neither Settings.apk nor SecSettings[2].apk found" + fi + + SETTINGS_APK_NAME=$(basename ${SETTINGS_APK_PATH}) + SETTINGS_APK_DIR=$(basename ${SETTINGS_APK_NAME} .apk) + + cp ${SETTINGS_APK_PATH} ${BASEDIR}/${SETTINGS_APK_NAME} || \ + error " !! failed to copy ${SETTINGS_APK_NAME}" + + [ "${SDK_VERSION}" -gt 21 ] && \ + mkdir -p "${BASEDIR}/Settings.apk-mod" + + ui_print " >> patching ${SETTINGS_APK_NAME}" + LD_LIBRARY_PATH=${C_LD} \ + /system/bin/dalvikvm \ + -Xbootclasspath:"${BOOTCLASSES}" \ + -classpath "${BASEDIR}/dexpatcher.dex" \ + lanchon.dexpatcher.Main \ + ${DEX_OPTS} --api-level "${SDK_VERSION}" \ + --verbose --output ${BASEDIR}/Settings.apk-mod \ + ${BASEDIR}/${SETTINGS_APK_NAME} ${PATCH_UI_SETTINGS} || \ + error " !! failed to patch ${SETTINGS_APK_NAME}" + + LD_LIBRARY_PATH=${C_LD} \ + ${ZIPB} -d "${BASEDIR}/${SETTINGS_APK_NAME}" \ + 'classes*.dex' || \ + error " !! zip failed" + + LD_LIBRARY_PATH=${C_LD} \ + ${ZIPB} -j "${BASEDIR}/${SETTINGS_APK_NAME}" \ + "${BASEDIR}/Settings.apk-mod"/classes*.dex || \ + error " !! zip failed" +} + +backup_services_jar () { + ui_print " << backing up services.jar to: /sdcard" + cp /system/framework/services.jar /sdcard || \ + error " !! failed to backup services.jar" +} + +backup_settings_ui () { + if [ "${nanodroid_sigspoofui}" -eq 1 ]; then + ui_print " << backing up ${SETTINGS_APK_NAME} to: /sdcard" + cp ${SETTINGS_APK_PATH} /sdcard || \ + error " !! failed to backup ${SETTINS_APK_NAME}" + fi +} + +install_services () { + ui_print " " + for destination in /dev/tmp/magisk_img/NanoDroid /dev/tmp/magisk_img/NanoDroid_microG \ + /sbin/.core/img/NanoDroid /sbin/.core/img/NanoDroid_microG /; do + if [ -d ${destination} ]; then + install_path="${destination}" + break + fi + done + + if [ "${install_path}" = "/" ]; then + mount -orw,remount /system || \ + error " !! failed to mount /system read-write" + backup_services_jar + backup_settings_ui + fi + + ui_print " << installing patched files to: ${install_path}" + + mkdir -p "${install_path}/system/framework" + cp ${BASEDIR}/services.jar "${install_path}/system/framework" \ + || error " !! failed to install services.jar" + + if [ "${nanodroid_sigspoofui}" -eq 1 ]; then + mkdir -p "${install_path}/system/priv-app/${SETTINGS_APK_DIR}" + cp ${BASEDIR}/${SETTINGS_APK_NAME} \ + "${install_path}/system/priv-app/${SETTINGS_APK_DIR}/${SETTINGS_APK_NAME}" \ + || error " !! failed to install ${SETTINGS_APK_NAME}" + + fi + + if [ "${install_path}" = "/" ]; then + echo /system/framework/services.jar >> /data/adb/.nanodroid-list + + [ "${nanodroid_sigspoofui}" -eq 1 ] && + echo /system/priv-app/${SETTINGS_APK_DIR}/${SETTINGS_APK_NAME} >> \ + /data/adb/.nanodroid-list + fi + + touch /data/adb/.nanodroid-patcher +} + +########################################################################################## +# Magisk Functions +########################################################################################## + +grow_magisk_img () { + request_size_check /tmp/services.jar + image_size_check ${MAGISK_IMG} + if [ "$reqSizeM" -gt "$curFreeM" ]; then + SIZE=$(((reqSizeM + curUsedM) / 32 * 32 + 64)) + resize2fs -f ${MAGISK_IMG} ${SIZE}M + e2fsck -yf ${MAGISK_IMG} + fi +} + +shrink_magisk_img () { + image_size_check ${MAGISK_IMG} + NEWDATASIZE=$((curUsedM / 32 * 32 + 32)) + if [ "$curSizeM" -gt "$NEWDATASIZE" ]; then + resize2fs -f ${MAGISK_IMG} ${NEWDATASIZE}M + e2fsck -yf ${MAGISK_IMG} + fi +} + +request_size_check() { + reqSizeM=`unzip -l "$1" 2>/dev/null | tail -n 1 | awk '{ print $1 }'` + reqSizeM=$((reqSizeM / 1048576 + 1)) +} + +image_size_check() { + e2fsck -yf $1 + curBlocks=`e2fsck -n $1 2>/dev/null | grep $1 | cut -d, -f3 | cut -d\ -f2`; + curUsedM=`echo "$curBlocks" | cut -d/ -f1` + curSizeM=`echo "$curBlocks" | cut -d/ -f1` + curFreeM=$(((curSizeM - curUsedM) * 4 / 1024)) + curUsedM=$((curUsedM * 4 / 1024 + 1)) + curSizeM=$((curSizeM * 4 / 1024)) +} + +magisk_setup () { + if [ -f ${MAGISK_IMG} ]; then + grow_magisk_img || \ + error " !! failed to grow magisk.img" + mount_image ${MAGISK_IMG} ${MAGISK_PATH} || \ + error " !! failed to mount ${MAGISK_PATH}" + fi +} + +magisk_cleanup () { + if (is_mounted ${MAGISK_PATH}); then + umount ${MAGISK_PATH} + losetup -d $LOOPDEVICE + rmdir ${MAGISK_PATH} + shrink_magisk_img || \ + error " !! failed to shrink magisk.img" + fi +} + +########################################################################################## +# Configuration File +########################################################################################## + +# check for configuration files +config_locations="/sdcard /external_sd $(dirname ${ZIP})) /data" + +get_config () { + config="" + config_exists=0 + for path in ${config_locations}; do + if test -r "${path}/${1}" -a -f "${path}/${1}"; then + config="${path}/${1}" + config_exists=1 + return + fi + done +} + +main () { + ui_print " " + ui_print "*******************************" + ui_print " NanoDroid Framework Patcher " + ui_print " addon.d 15.90.99999999 " + ui_print " created by @Nanolx " + ui_print " Utilizing DexPatcher @lanchon " + ui_print "*******************************" + ui_print " " + + [ -f /data/adb/.nanodroid-patcher ] && \ + rm -f /data/adb/.nanodroid-patcher + + if ! (is_mounted /data); then + mount -orw /data || error " !! failed to mount /data" + else mount -orw,remount /data || error " !! failed to remount /data read-write" + fi + + if ! (is_mounted /system); then + mount -oro /system || error " !! failed to mount /system" + fi + + get_config .nanodroid-setup + [ "$config_exists" -eq 1 ] && source ${config} + + for bin in zip.arm zip.x86 file.arm file.x86; do + chmod 0755 "${BASEDIR}/${bin}" || \ + error " !! failed to prepare environment" + done + + detect_sdk + detect_arch + detect_odex + + [ -f ${MAGISK_IMG} ] && magisk_setup + + patch_services + install_services + + ui_print " " + ui_print " >> clean up" + + magisk_cleanup + + ui_print " " + ui_print " > Done!" + ui_print " " + ui_print "Thanks for using NanoDroid" + ui_print " " + + exit 0 +} + +########################################################################################## +# Check environment +########################################################################################## + +if [[ ! -d /data/adb/nanodroid_patcher ]]; then + ui_print " " + ui_print " !! NanoDroid-Patcher environment missing" + ui_print " !! guessing, you've wiped /data ?" + ui_print " !! re-flash the NanoDroid-Patcher zip" + ui_print " " + exit 0 +fi + +########################################################################################## +# Stuffz +########################################################################################## + +case "$1" in + backup) + # Stub + ;; + restore) + # Stub + ;; + pre-backup) + # Stub + ;; + post-backup) + # Stub + ;; + pre-restore) + # Stub + ;; + post-restore) + # Get the FD for ui_print + OUTFD=`ps | grep -v grep | grep -oE "update(.*)" | cut -d" " -f3` + # Run the main function in a parallel subshell + main + ;; +esac + diff --git a/patcher/dexpatcher/core_services.jar.dex b/patcher/dexpatcher/core_services.jar.dex new file mode 100644 index 00000000..e4c4dd4b Binary files /dev/null and b/patcher/dexpatcher/core_services.jar.dex differ diff --git a/patcher/dexpatcher/dexpatcher.dex b/patcher/dexpatcher/dexpatcher.dex new file mode 100644 index 00000000..ab2f9d9d Binary files /dev/null and b/patcher/dexpatcher/dexpatcher.dex differ diff --git a/patcher/dexpatcher/file.arm b/patcher/dexpatcher/file.arm new file mode 100755 index 00000000..2a4d9fd7 Binary files /dev/null and b/patcher/dexpatcher/file.arm differ diff --git a/patcher/dexpatcher/file.x86 b/patcher/dexpatcher/file.x86 new file mode 100755 index 00000000..7e6e4819 Binary files /dev/null and b/patcher/dexpatcher/file.x86 differ diff --git a/patcher/dexpatcher/hook_4.1-6.0_services.jar.dex b/patcher/dexpatcher/hook_4.1-6.0_services.jar.dex new file mode 100644 index 00000000..63111282 Binary files /dev/null and b/patcher/dexpatcher/hook_4.1-6.0_services.jar.dex differ diff --git a/patcher/dexpatcher/hook_7.0-8.0_services.jar.dex b/patcher/dexpatcher/hook_7.0-8.0_services.jar.dex new file mode 100644 index 00000000..d2c8731b Binary files /dev/null and b/patcher/dexpatcher/hook_7.0-8.0_services.jar.dex differ diff --git a/patcher/dexpatcher/magic.mgc b/patcher/dexpatcher/magic.mgc new file mode 100644 index 00000000..39eae52e Binary files /dev/null and b/patcher/dexpatcher/magic.mgc differ diff --git a/patcher/dexpatcher/ui_4.1-6.0_Settings.apk.dex b/patcher/dexpatcher/ui_4.1-6.0_Settings.apk.dex new file mode 100644 index 00000000..7846c2e5 Binary files /dev/null and b/patcher/dexpatcher/ui_4.1-6.0_Settings.apk.dex differ diff --git a/patcher/dexpatcher/ui_4.1-6.0_services.jar.dex b/patcher/dexpatcher/ui_4.1-6.0_services.jar.dex new file mode 100644 index 00000000..da304e91 Binary files /dev/null and b/patcher/dexpatcher/ui_4.1-6.0_services.jar.dex differ diff --git a/patcher/dexpatcher/ui_7.0-8.0_Settings.apk.dex b/patcher/dexpatcher/ui_7.0-8.0_Settings.apk.dex new file mode 100644 index 00000000..0cd517ef Binary files /dev/null and b/patcher/dexpatcher/ui_7.0-8.0_Settings.apk.dex differ diff --git a/patcher/dexpatcher/ui_7.0-8.0_services.jar.dex b/patcher/dexpatcher/ui_7.0-8.0_services.jar.dex new file mode 100644 index 00000000..da304e91 Binary files /dev/null and b/patcher/dexpatcher/ui_7.0-8.0_services.jar.dex differ diff --git a/patcher/dexpatcher/zip.arm b/patcher/dexpatcher/zip.arm new file mode 100755 index 00000000..8cdfb36f Binary files /dev/null and b/patcher/dexpatcher/zip.arm differ diff --git a/patcher/dexpatcher/zip.x86 b/patcher/dexpatcher/zip.x86 new file mode 100755 index 00000000..0a78be20 Binary files /dev/null and b/patcher/dexpatcher/zip.x86 differ diff --git a/setup-wizard/META-INF/com/google/android/aroma-config b/setup-wizard/META-INF/com/google/android/aroma-config new file mode 100644 index 00000000..180f80d3 --- /dev/null +++ b/setup-wizard/META-INF/com/google/android/aroma-config @@ -0,0 +1,204 @@ +ini_set("rom_name", "NanoDroid Setup Wizard"); +ini_set("rom_version", "15.90"); +ini_set("rom_author", "Nanolx"); +ini_set("rom_device", "Generic (LOS/AOSP)"); +ini_set("rom_date", "99999999"); + +anisplash( + 0, "splash/nanolx.png", 1500 +); + +fontresload( "0", "ttf/DroidSans.ttf;", "12" ); +theme("touchwiz"); + +viewbox( + "Welcome", + "Relevant information of the Package:\n\n"+ + " Rom\t <#selectbg_g>"+ini_get("rom_name")+"\n"+ + " Version\t <#selectbg_g>"+ini_get("rom_version")+"\n"+ + " Date\t <#selectbg_g>"+ini_get("rom_date")+"\n\n"+ + "<#f00>"+ini_get("rom_device")+"\n\n\n", + "@welcome" +); + +agreebox( + #-- Title + "READ THIS", + + #-- Subtitle / Description + "Please read before going further", + + #-- Icon + "@license", + + #-- Text Content ( Read from /license.txt ) + resread("license.txt"), + + #-- Checkbox Text + "I Agree with this", + + #-- Unchecked Alert Message + "Please check the Agree box first" +); + +selectbox( + "Configuration Location", + "Configuration Location", + "icons/update", + "location.prop", + + "Where to store configuration", "", 2, #-- Group 1. key = "selected.1" + "/sdcard", "Internal Storage (wipe-safe)", 0, #-- selected.1 = 1 + "/external_sd", "External SD Card (if any)", 0, #-- selected.1 = 2 + "/data", "Data Storage (not wipe-safe) ", 1 #-- selected.1 = 3 +); + +checkbox( + "Generic Setup", + "Generic Setup", + "icons/update", + "setup.prop", + + "Adjust the basic settings", "", 2, #-- Group 1 + "microG", "Install microG OSS GApps re-implementation", 1, + "F-Droid", "Install F-Droid FOSS App Store", 1, + "Apps", "Install Apps (customized later)", 1, + "Overlay", "[Magisk] Pseudo-Debloat Apps (customized later)", 1, + "Zelda Tunes", "Install The Legend of Zelda rintones and sounds", 1, + "Maps API v1", "Install Google Maps API version 1", 1, + "Init Scripts", "Install init scripts", 1, + "Google Sync", "Install Google Contacts & Calendar Sync", 0, + "Swipe", "Install Swipe libraries", 0, + "Force System", "Force System Mode Installation", 0, + "Sigspoof UI", "[Patcher, SDK <25] Sigspoof UI in Developer Options", 0 +); + +selectbox( + "Google App Store", + "Google App Store", + "icons/update", + "store.prop", + + "Select the Google App Store you want", "", 2, #-- Group 1. key = "selected.1" + "None", "Install no Google App Store", 0, #-- selected.1 = 1 + "Play Store", "Install official Play Store", 1, #-- selected.1 = 2 + "Yalp Store", "Install unofficial Yalp Store (+ Fake Store)", 0 #-- selected.1 = 3 +); + +selectbox( + "nlpBackends", + "nlpBackends", + "icons/update", + "nlp.prop", + + "Select the location backends for microG", "", 2, #-- Group 1. key = "selected.1" + "None", "Install no nlp backend", 0, #-- selected.1 = 1 + "Déjà Vu", "Install Déjà Vu backend", 1, #-- selected.1 = 2 + "Ichnaea", "Install Mozilla backend", 0, #-- selected.1 = 3 + "Both", "Install both backends", 0 #-- selected.1 = 4 +); + +checkbox( + "App Setup", + "App Setup", + "icons/update", + "apps.prop", + + "Select which Apps to install (if enabled)", "", 2, #-- Group 1 + "AdAway", "Powerful ad blocker (requires root)", 1, + "Amaze", "Amazing File Manager", 1, + "AnysoftKeyboard", "Powerful Keyboard", 1, + "FaceSlim", "Facebook client", 1, + "BeHe Keyboard", "Full-fletched PC-like Keyboard", 1, + "K9Mail", "Powerful Mail client", 1, + "KeePassDroid", "Password Safe", 1, + "KernelAdiutor", "Customize Kernel Settings", 1, + "Lightning", "Blazing fast Web Browser", 1, + "MPV", "Video Player", 1, + "NewPipe", "YouTube frontend and downloader", 1, + "Oandbackup", "Backup and Restore Apps", 1, + "Odyssey", "Feature-Rich Music Player", 1, + "OpenCamera", "Feature-Rich Camera", 1, + "OpenKeyChain", "Encrypt or Sign E-Mails", 1, + "OpenLauncher", "Customizable Launcher", 1, + "OpenWeatherMapProvider", "Use OpenWeatherMap for Wheather Data", 1, + "OpenVPN", "Connect to VPNs", 1, + "Orbot", "Connect to The Onion Router (TOR)", 1, + "Orfox", "Orfox, modified Firefox for TOR", 1, + "QKSMS", "Great SMS / MMS messenger", 1, + "SimpleCalendar", "Easy to use Calendar", 1, + "SimpleGallery", "Easy to use Gallery", 1, + "Substratum", "Substratum theme engine App", 1, + "Termux", "Powerful Terminal Emulator", 1, + "Twidere", "Customizable Twitter Client", 1, + "XDALabs", "XDA at the palm of your hands", 1, + "YahooWeatherProvider", "Use Yahoo! for Wheather Data", 1 +); + +checkbox( + "Pseudo-Debloat Setup", + "Pseudo-Debloat Setup", + "icons/update", + "debloat.prop", + + "Select which Apps to Pseudo-Debloat [Magisk] (if enabled)", "", 2, #-- Group 1 + "BasicDreams", "Screensaver", 1, + "Browser", "Standard Browser", 1, + "Calendar", "Standard Calendar", 1, + "Camera2", "Standard Camera", 1, + "CMFileManager", "Cyanogen File Manager", 1, + "Eleven", "Standard Music Player", 1, + "Email", "Standard Mail Program", 1, + "Exchange2", "Exchange Services (Email)", 1, + "FMRadio", "FM Radio/Tuner", 1, + "Gallery2", "Standard Gallery", 1, + "Gello", "Cyanogen Browser", 1, + "Jelly", "LineAge Browser", 1, + "messaging", "Standard SMS/MMS Program", 1, + "mGerrit", "Bug Tracker", 1, + "OmniSwitch", "OmniROM App Switcher", 1, + "Phonograph", "Music Player", 1, + "PhotoTable", "Screensaver", 1, + "Recorder", "Sound Recorder", 1, + "ResurrectionStats", "RR Statistics", 1, + "Screencast", "Screen Recorder", 1, + "Slimperience", "Web Browser", 1, + "Snap", "Camera", 1, + "SnapdragonCamera", "Snapdragon optmized Camera", 1, + "SoundRecorder", "Sound Recorder", 1, + "Stk", "SIM Card ToolKit", 1, + "ViaBrowser", "Web Browser", 1, + "Wallpaper", "Wallpaper App (Google)", 1, + "WallpaperBackup", "Wallpaper Backup (Google)", 1, + "WallpaperPickerGoogle", "Wallpaper App (Google)", 1 +); + +viewbox( + "Ready", + "The wizard is ready to begin the process.\n\n"+ + "Press Next to begin the process.\n\n"+ + "If you want to review or change any of your selection, press Back.", + "@install" +); + +setvar("retstatus", + install( + #-- Title + "Please Wait...", + + #-- Installation Process message + ""+ini_get("rom_name")+"\n\n"+ + "Please wait while processing your selection.", + + #-- Installation Icon + "@install", + + #-- Installation Finish Message + "The process has successfully ended. + Press Next to continue." + ) +); + +ini_set("text_next", "Finish"); + +#---- FINISH diff --git a/setup-wizard/META-INF/com/google/android/aroma/changelog.txt b/setup-wizard/META-INF/com/google/android/aroma/changelog.txt new file mode 100644 index 00000000..ebe1dd0b --- /dev/null +++ b/setup-wizard/META-INF/com/google/android/aroma/changelog.txt @@ -0,0 +1 @@ +onzin \ No newline at end of file diff --git a/setup-wizard/META-INF/com/google/android/aroma/icons/agreement.png b/setup-wizard/META-INF/com/google/android/aroma/icons/agreement.png new file mode 100644 index 00000000..e3bbe5ef Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/icons/agreement.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/icons/alert.png b/setup-wizard/META-INF/com/google/android/aroma/icons/alert.png new file mode 100644 index 00000000..155906f8 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/icons/alert.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/icons/alliance.png b/setup-wizard/META-INF/com/google/android/aroma/icons/alliance.png new file mode 100644 index 00000000..b811ec1c Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/icons/alliance.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/icons/apps.png b/setup-wizard/META-INF/com/google/android/aroma/icons/apps.png new file mode 100644 index 00000000..ca75fff1 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/icons/apps.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/icons/back.png b/setup-wizard/META-INF/com/google/android/aroma/icons/back.png new file mode 100644 index 00000000..d88e36fb Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/icons/back.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/icons/confirm.png b/setup-wizard/META-INF/com/google/android/aroma/icons/confirm.png new file mode 100644 index 00000000..1fdb5d0f Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/icons/confirm.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/icons/customize.png b/setup-wizard/META-INF/com/google/android/aroma/icons/customize.png new file mode 100644 index 00000000..b8726909 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/icons/customize.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/icons/default.png b/setup-wizard/META-INF/com/google/android/aroma/icons/default.png new file mode 100644 index 00000000..1c728449 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/icons/default.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/icons/finish.png b/setup-wizard/META-INF/com/google/android/aroma/icons/finish.png new file mode 100644 index 00000000..2b82c65d Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/icons/finish.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/icons/info.png b/setup-wizard/META-INF/com/google/android/aroma/icons/info.png new file mode 100644 index 00000000..90384fe4 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/icons/info.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/icons/install.png b/setup-wizard/META-INF/com/google/android/aroma/icons/install.png new file mode 100644 index 00000000..44caaf5d Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/icons/install.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/icons/installbutton.png b/setup-wizard/META-INF/com/google/android/aroma/icons/installbutton.png new file mode 100644 index 00000000..450808e0 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/icons/installbutton.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/icons/license.png b/setup-wizard/META-INF/com/google/android/aroma/icons/license.png new file mode 100644 index 00000000..2f063553 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/icons/license.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/icons/menu.png b/setup-wizard/META-INF/com/google/android/aroma/icons/menu.png new file mode 100644 index 00000000..ce48992b Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/icons/menu.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/icons/next.png b/setup-wizard/META-INF/com/google/android/aroma/icons/next.png new file mode 100644 index 00000000..8c9656f6 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/icons/next.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/icons/personalize.png b/setup-wizard/META-INF/com/google/android/aroma/icons/personalize.png new file mode 100644 index 00000000..c6f67980 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/icons/personalize.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/icons/update.png b/setup-wizard/META-INF/com/google/android/aroma/icons/update.png new file mode 100644 index 00000000..29b18ee2 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/icons/update.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/icons/welcome.png b/setup-wizard/META-INF/com/google/android/aroma/icons/welcome.png new file mode 100644 index 00000000..1b5e27fc Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/icons/welcome.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/license.txt b/setup-wizard/META-INF/com/google/android/aroma/license.txt new file mode 100644 index 00000000..2455e98a --- /dev/null +++ b/setup-wizard/META-INF/com/google/android/aroma/license.txt @@ -0,0 +1,13 @@ +<@center><#selectbg_g>Terms of Service + +By using this package, you take full responsibility of it's use, I (setialpha/Nanolx) am not responsible of any damage this package may cause to your device. + +<@center><#selectbg_g>Read before installation +<@left> +Welcome to the NanoDroid Setup Wizard. + +With this AROMA installer you will create NanoDroid configuration files. + +You need to flash any of the modules afterwards! + +Check "I Agree with this" and press Next. diff --git a/setup-wizard/META-INF/com/google/android/aroma/splash/nanolx.png b/setup-wizard/META-INF/com/google/android/aroma/splash/nanolx.png new file mode 100644 index 00000000..9ca096fd Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/splash/nanolx.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/bg.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/bg.png new file mode 100644 index 00000000..dfb3a283 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/bg.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/button.9.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/button.9.png new file mode 100644 index 00000000..cca7f95f Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/button.9.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/button_focus.9.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/button_focus.9.png new file mode 100644 index 00000000..ff932bd8 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/button_focus.9.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/button_press.9.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/button_press.9.png new file mode 100644 index 00000000..b1cb208c Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/button_press.9.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/cb.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/cb.png new file mode 100644 index 00000000..cd5a8c79 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/cb.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/cb_focus.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/cb_focus.png new file mode 100644 index 00000000..c3e627e8 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/cb_focus.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/cb_on.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/cb_on.png new file mode 100644 index 00000000..d44c1c2b Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/cb_on.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/cb_on_focus.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/cb_on_focus.png new file mode 100644 index 00000000..f5d669e6 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/cb_on_focus.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/cb_on_press.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/cb_on_press.png new file mode 100644 index 00000000..1bcf3005 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/cb_on_press.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/cb_press.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/cb_press.png new file mode 100644 index 00000000..c5924d59 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/cb_press.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/dialog.9.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/dialog.9.png new file mode 100644 index 00000000..901f20e3 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/dialog.9.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/dialog_titlebar.9.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/dialog_titlebar.9.png new file mode 100644 index 00000000..34546701 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/dialog_titlebar.9.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/font.roboto.big.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/font.roboto.big.png new file mode 100644 index 00000000..d7d805c3 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/font.roboto.big.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/font.roboto.small.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/font.roboto.small.png new file mode 100644 index 00000000..94f6b5dd Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/font.roboto.small.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.agreement.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.agreement.png new file mode 100644 index 00000000..6bb78f91 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.agreement.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.alert.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.alert.png new file mode 100644 index 00000000..328c55b7 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.alert.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.apps.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.apps.png new file mode 100644 index 00000000..ed463c2e Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.apps.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.back.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.back.png new file mode 100644 index 00000000..5254feef Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.back.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.confirm.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.confirm.png new file mode 100644 index 00000000..4450193f Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.confirm.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.customize.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.customize.png new file mode 100644 index 00000000..733b3684 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.customize.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.default.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.default.png new file mode 100644 index 00000000..dc9bcb37 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.default.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.exit.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.exit.png new file mode 100644 index 00000000..a9b03764 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.exit.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.info.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.info.png new file mode 100644 index 00000000..aaca3515 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.info.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.install.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.install.png new file mode 100644 index 00000000..9f44623b Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.install.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.installbutton.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.installbutton.png new file mode 100644 index 00000000..5d63ed2a Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.installbutton.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.license.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.license.png new file mode 100644 index 00000000..e0796591 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.license.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.menu.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.menu.png new file mode 100644 index 00000000..532dd66e Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.menu.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.modem.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.modem.png new file mode 100644 index 00000000..413a801f Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.modem.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.next.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.next.png new file mode 100644 index 00000000..11f2d3ea Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.next.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.personalize.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.personalize.png new file mode 100644 index 00000000..c95e0028 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.personalize.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.reboot.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.reboot.png new file mode 100644 index 00000000..363449bd Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.reboot.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.recovery.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.recovery.png new file mode 100644 index 00000000..6aa43ba2 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.recovery.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.update.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.update.png new file mode 100644 index 00000000..58da527a Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.update.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.welcome.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.welcome.png new file mode 100644 index 00000000..5d510ca8 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/icon.welcome.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/list.9.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/list.9.png new file mode 100644 index 00000000..68f0b631 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/list.9.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/navbar.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/navbar.png new file mode 100644 index 00000000..b3c7f73b Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/navbar.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/radio.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/radio.png new file mode 100644 index 00000000..fa6fec23 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/radio.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/radio_focus.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/radio_focus.png new file mode 100644 index 00000000..f45d676e Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/radio_focus.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/radio_on.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/radio_on.png new file mode 100644 index 00000000..86c499f4 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/radio_on.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/radio_on_focus.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/radio_on_focus.png new file mode 100644 index 00000000..eedc4dff Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/radio_on_focus.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/radio_on_press.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/radio_on_press.png new file mode 100644 index 00000000..8cfe1d96 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/radio_on_press.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/radio_press.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/radio_press.png new file mode 100644 index 00000000..cceaeaa0 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/radio_press.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/theme.prop b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/theme.prop new file mode 100644 index 00000000..2d55dbbf --- /dev/null +++ b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/theme.prop @@ -0,0 +1,67 @@ +img.background=bg +img.titlebar=titlebar.9 +img.navbar=navbar +img.dialog=dialog.9 +img.dialog.titlebar=dialog_titlebar.9 +img.progress=button.9 +img.prograss.fill=button_press.9 +img.selection=list.9 +img.selection.push=list.9 +img.button=button.9 +img.button.focus=button_focus.9 +img.button.push=button_press.9 +img.checkbox=cb +img.checkbox.focus=cb_focus +img.checkbox.push=cb_press +img.checkbox.on=cb_on +img.checkbox.on.focus=cb_on_focus +img.checkbox.on.push=cb_on_press +img.radio=radio +img.radio.focus=radio_focus +img.radio.push=radio_press +img.radio.on=radio_on +img.radio.on.focus=radio_on_focus +img.radio.on.push=radio_on_press + + +color.winbg = #000 +color.winbg_g = #444 +color.winfg = #fff +color.winfg_gray = #666 +color.dialogbg = #000 +color.dialogbg_g = #444 +color.dialogfg = #fff +color.textbg = #000 +color.textfg = #fff +color.textfg_gray = #aaa +color.controlbg = #999 +color.controlbg_g = #999 +color.controlfg = #fff +color.selectbg = #33b5e5 +color.selectbg_g = #33b5e5 +color.selectfg = #fff +color.titlebg = #000 +color.titlebg_g = #000 +color.titlefg = #fff +color.dlgtitlebg = #fff +color.dlgtitlebg_g = #000 +color.dlgtitlefg = #fff +color.scrollbar = #ccc +color.navbg = #000 +color.navbg_g = #000 +color.border = #666 +color.border_g = #666 +color.progressglow = #33b5e5 + +config.roundsize = 1 +config.button_roundsize = 1 +config.window_roundsize = 1 +config.transition_frame = 5 + +font.small = font.roboto.small +font.big = font.roboto.big + + +info.themename = Touchwiz +info.description = Touchwiz Theme for AROMA Installer +info.author = titanic_fanatic \ No newline at end of file diff --git a/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/titlebar.9.png b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/titlebar.9.png new file mode 100644 index 00000000..af09ffb2 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/themes/touchwiz/titlebar.9.png differ diff --git a/setup-wizard/META-INF/com/google/android/aroma/ttf/DroidSans.ttf b/setup-wizard/META-INF/com/google/android/aroma/ttf/DroidSans.ttf new file mode 100644 index 00000000..0e58508a Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/aroma/ttf/DroidSans.ttf differ diff --git a/setup-wizard/META-INF/com/google/android/update-binary b/setup-wizard/META-INF/com/google/android/update-binary new file mode 100644 index 00000000..177f5355 Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/update-binary differ diff --git a/setup-wizard/META-INF/com/google/android/update-binary-installer b/setup-wizard/META-INF/com/google/android/update-binary-installer new file mode 100644 index 00000000..de6e628b Binary files /dev/null and b/setup-wizard/META-INF/com/google/android/update-binary-installer differ diff --git a/setup-wizard/META-INF/com/google/android/updater-script b/setup-wizard/META-INF/com/google/android/updater-script new file mode 100644 index 00000000..9cc4b6d1 --- /dev/null +++ b/setup-wizard/META-INF/com/google/android/updater-script @@ -0,0 +1,20 @@ +show_progress(1.000000, 0); +set_progress(0.0); +ui_print(" "); +ui_print("> NanoDroid Setup Wizard 15.90.99999999"); +ui_print(" "); +set_progress(0.1); + +ui_print("> Creating Configuration Files"); +package_extract_file("nanodroid-setup", "/tmp/nanodroid-setup"); +set_metadata("/tmp/nanodroid-setup", "uid", 0, "gid", 0, "mode", 0777); +run_program("/tmp/nanodroid-setup"); + +ui_print(" "); +ui_print(">> Now flash the NanoDroid package of your choice!"); +ui_print(" "); + +ui_print("> Thanks for using NanoDroid"); +ui_print(" "); + +set_progress(1.0); diff --git a/setup-wizard/nanodroid-setup b/setup-wizard/nanodroid-setup new file mode 100644 index 00000000..95729003 --- /dev/null +++ b/setup-wizard/nanodroid-setup @@ -0,0 +1,186 @@ +#!/sbin/sh + +OUTFD=2 + +ui_print() { + echo -n -e "ui_print $1\n" >> /proc/self/fd/$OUTFD + echo -n -e "ui_print\n" >> /proc/self/fd/$OUTFD +} + +is_mounted() { + if [ ! -z "$2" ]; then + cat /proc/mounts | grep $1 | grep $2, >/dev/null + else + cat /proc/mounts | grep $1 >/dev/null + fi + return $? +} + +setup_add () { + if grep -q "item.1.${1}=1" "${setup_prop}"; then + ui_print " <>> enable property: ${2}" + echo "${2}=1" >> "${nanodroid_setup}" + else + ui_print " <>> disable property: ${2}" + echo "${2}=0" >> "${nanodroid_setup}" + fi +} + +apps_add () { + if grep -q "item.1.${1}=1" "${apps_prop}"; then + ui_print " <>> mark for installation: ${2}" + echo "${2}" >> "${nanodroid_apps}" + fi +} + +overlay_add () { + if grep -q "item.1.${1}=1" "${debloat_prop}"; then + ui_print " <>> mark for pseudo-debloating: ${2}" + echo "${2}" >> "${nanodroid_overlay}" + fi +} + +aromapath="/tmp/aroma-data" +setup_prop="${aromapath}/setup.prop" +store_prop="${aromapath}/store.prop" +apps_prop="${aromapath}/apps.prop" +debloat_prop="${aromapath}/debloat.prop" +location_prop="${aromapath}/location.prop" + +ui_print " " +ui_print "******************************" +ui_print " NanoDroid 15.90.99999999 " +ui_print " created by @Nanolx " +ui_print " Setup Wizard " +ui_print "******************************" +ui_print " " + +if grep -q "selected.1=1" "${location_prop}"; then + ui_print " > saving configuration in: /sdcard" + configpath="/sdcard" +elif grep -q "selected.1=2" "${location_prop}"; then + ui_print " > saving configuration in: /external_sd" + configpath="/external_sd" +elif grep -q "selected.1=3" "${location_prop}"; then + ui_print " > saving configuration in: /data" + configpath="/data" + if (is_mounted /data); then + mount -orw,remount /data >/dev/null + else mount -orw /data >/dev/null + fi +fi + +nanodroid_apps="${configpath}/.nanodroid-apps" +nanodroid_overlay="${configpath}/.nanodroid-overlay" +nanodroid_setup="${configpath}/.nanodroid-setup" + +for setupfile in ${nanodroid_apps} ${nanodroid_overlay} ${nanodroid_setup}; do + rm -f "${setupfile}" +done + +ui_print " " +ui_print " < Installer Configuration" + +setup_add 1 nanodroid_microg +setup_add 2 nanodroid_fdroid +setup_add 3 nanodroid_apps +setup_add 4 nanodroid_overlay +setup_add 5 nanodroid_zelda +setup_add 6 nanodroid_mapsv1 +setup_add 7 nanodroid_init +setup_add 8 nanodroid_gsync +setup_add 9 nanodroid_swipe +setup_add 10 nanodroid_forcesystem +setup_add 11 nanodroid_sigspoofui + +if grep -q "selected.1=1" "${store_prop}"; then + ui_print " <>> setting property: nanodroid_play [None]" + echo "nanodroid_play=0" >> "${nanodroid_setup}" +elif grep -q "selected.1=2" "${store_prop}"; then + ui_print " <>> setting property: nanodroid_play [Play Store]" + echo "nanodroid_play=1" >> "${nanodroid_setup}" +elif grep -q "selected.1=3" "${store_prop}"; then + ui_print " <>> setting property: nanodroid_play [Yalp Store]" + echo "nanodroid_play=2" >> "${nanodroid_setup}" +fi + +if grep -q "selected.1=1" "${nlp_prop}"; then + ui_print " <>> setting property: nanodroid_nlpbackend [None]" + echo "nanodroid_nlpbackend=0" >> "${nanodroid_setup}" +elif grep -q "selected.1=2" "${nlp_prop}"; then + ui_print " <>> setting property: nanodroid_nlpbackend [Déjà Vu]" + echo "nanodroid_nlpbackend=1" >> "${nanodroid_setup}" +elif grep -q "selected.1=3" "${nlp_prop}"; then + ui_print " <>> setting property: nanodroid_nlpbackend [Ichnaea]" + echo "nanodroid_nlpbackend=2" >> "${nanodroid_setup}" +elif grep -q "selected.1=4" "${nlp_prop}"; then + ui_print " <>> setting property: nanodroid_nlpbackend [Déjà Vu + Ichnaea]" + echo "nanodroid_nlpbackend=3" >> "${nanodroid_setup}" +fi + +ui_print " " +ui_print " < Installed Applications" + +apps_add 1 Adaway +apps_add 2 Amaze +apps_add 3 AnysoftKeyboard +apps_add 4 FaceSlim +apps_add 5 BeHeKeyboard +apps_add 6 K9Mail +apps_add 7 KeePassDroid +apps_add 8 KernelAdiutor +apps_add 9 Lightning +apps_add 10 MPV +apps_add 11 NewPipe +apps_add 12 Oandbackup +apps_add 13 Odyssey +apps_add 14 OpenCamera +apps_add 15 OpenKeyChain +apps_add 16 OpenLauncher +apps_add 17 OpenWeatherMapProvider +apps_add 18 OpenVPN +apps_add 19 Orbot +apps_add 20 Orfox +apps_add 21 QKSMS +apps_add 22 SimpleCalendar +apps_add 23 SimpleGallery +apps_add 24 Substratum +apps_add 25 Termux +apps_add 26 Twidere +apps_add 27 XDALabs +apps_add 28 YahooWeatherProvider + +ui_print " " +ui_print " < Pseudo-Debloated Applications" + +overlay_add 1 BasicDreams +overlay_add 2 Browser +overlay_add 3 Calendar +overlay_add 4 Camera2 +overlay_add 5 CMFileManager +overlay_add 6 Eleven +overlay_add 7 Email +overlay_add 8 Exchange2 +overlay_add 9 FMRadio +overlay_add 10 Gallery2 +overlay_add 11 Gello +overlay_add 12 Jelly +overlay_add 13 messaging +overlay_add 14 mGerrit +overlay_add 15 OmniSwitch +overlay_add 16 Phonograph +overlay_add 17 PhotoTable +overlay_add 18 Recorder +overlay_add 19 ResurrectionStats +overlay_add 20 Screencast +overlay_add 21 Slimperience +overlay_add 22 Snap +overlay_add 23 SnapdragonCamera +overlay_add 24 SoundRecorder +overlay_add 25 Stk +overlay_add 26 ViaBrowser +overlay_add 27 Wallpaper +overlay_add 28 WallpaperBackup +overlay_add 29 WallpaperPickerGoogle + +exit 0 diff --git a/uninstaller/META-INF/com/google/android/update-binary b/uninstaller/META-INF/com/google/android/update-binary new file mode 100644 index 00000000..aa247df9 --- /dev/null +++ b/uninstaller/META-INF/com/google/android/update-binary @@ -0,0 +1,237 @@ +#!/sbin/sh + +OUTFD=$2 +ZIP=$3 + +ui_print() { + echo -n -e "ui_print $1\n" >> /proc/self/fd/$OUTFD + echo -n -e "ui_print\n" >> /proc/self/fd/$OUTFD +} + +grep_prop() { + REGEX="s/^$1=//p" + shift + FILES=$@ + if [ -z "$FILES" ]; then + FILES='/system/build.prop' + fi + cat $FILES 2>/dev/null | sed -n "$REGEX" | head -n 1 +} + +is_mounted() { + if [ ! -z "$2" ]; then + cat /proc/mounts | grep $1 | grep $2, >/dev/null + else + cat /proc/mounts | grep $1 >/dev/null + fi + return $? +} + +error () { + ui_print "${@}" + ui_print " " + ui_print " ** post your /tmp/recovery.log" + ui_print " ** in the XDA support thread" + ui_print " " + exit 1 +} + +request_size_check() { + reqSizeM=`unzip -l "$1" 2>/dev/null | tail -n 1 | awk '{ print $1 }'` + reqSizeM=$((reqSizeM / 1048576 + 1)) +} + +image_size_check() { + e2fsck -yf $1 + curBlocks=`e2fsck -n $1 2>/dev/null | grep $1 | cut -d, -f3 | cut -d\ -f2`; + curUsedM=`echo "$curBlocks" | cut -d/ -f1` + curSizeM=`echo "$curBlocks" | cut -d/ -f1` + curFreeM=$(((curSizeM - curUsedM) * 4 / 1024)) + curUsedM=$((curUsedM * 4 / 1024 + 1)) + curSizeM=$((curSizeM * 4 / 1024)) +} + +shrink_magisk_img () { + image_size_check /data/magisk.img + NEWDATASIZE=$((curUsedM / 32 * 32 + 32)) + if [ "$curSizeM" -gt "$NEWDATASIZE" ]; then + resize2fs $IMG ${NEWDATASIZE}M + fi +} + +mount_image() { + if [ ! -d "$2" ]; then + mount -o rw,remount rootfs / + mkdir -p "$2" 2>/dev/null + $BOOTMODE && mount -o ro,remount rootfs / + [ ! -d "$2" ] && return 1 + fi + + if ! is_mounted "$2"; then + LOOPDEVICE= + for LOOP in 0 1 2 3 4 5 6 7; do + if ! is_mounted "$2"; then + LOOPDEVICE=/dev/block/loop$LOOP + [ -e $LOOPDEVICE ] || mknod $LOOPDEVICE b 7 $LOOP 2>/dev/null + losetup $LOOPDEVICE "$1" && mount -t ext4 -o loop $LOOPDEVICE "$2" + if is_mounted "$2"; then + break; + fi + fi + done + fi +} + +# check for configuration files +config_locations="/sdcard /external_sd /data $(dirname ${ZIP}))" +config_files=".nanomod-setup .nanomod-apps .nanomod-overlay .nanodroid-setup .nanodroid-apps .nanodroid-overlay" + +system_mode_uninstall () { + if ! (is_mounted /system); then + mount -orw /system || error " !! failed to mount /system" + else mount -orw,remount /system || error " !! failed to re-mount /system read-write" + fi + + ui_print " << uninstalling: NanoDroid (System)" + + # services.jar needs special treament + if grep -q /system/framework/services.jar ${system_list}; then + if [ -f /sdcard/services.jar ]; then + ui_print " << restoring: unpatched services.jar" + mv /sdcard/services.jar /system/framework/services.jar \ + || error " !! failed to restore services.jar" + else ui_print " << can't restore unpatched services.jar" + fi + sed '/\/system\/framework\/services.jar/d' -i ${system_list} + fi + + for sapp in Settings SecSettings SecSettings2; do + if grep -q /system/priv-app/${sapp}/${sapp}.apk ${system_list}; then + if [ -f /sdcard/${sapp}.apk ]; then + ui_print " << restoring: unpatched ${sapp}.apk" + mv /sdcard/${sapp}.apk /system/priv-app/${sapp}/${sapp}.apk \ + || error " !! failed to restore ${sapp}.apk" + else ui_print " << can't restore unpatched ${sapp}.apk" + fi + sed "/\/system\/priv-app\/${sapp}\/${sapp}.apk/d" \ + -i ${system_list} + break + fi + done + + # com.qualcomm.location needs special treament + if [ -d /sdcard/com.qualcomm.location ]; then + ui_print " << restoring: com.qualcomm.location" + mv /sdcard/com.qualcomm.location /system/priv-app/ \ + || error " !! failed to restore com.qualcomm.lcation" + fi + + xargs rm -f < ${system_list} \ + || " !! failed to remove files" + + # remove empty directories + # (find -empty not available on Android) + for dir in app priv-app share; do + find /system/${dir} -type d | \ + xargs rmdir --ignore-fail-on-non-empty + done + + rm -f "${system_list}" + + if [ -f /data/adb/.nanodroid-patcher ]; then + rm -rf /data/adb/.nanodroid-patcher \ + /system/addon.d/75-nanodroidpatcher.sh \ + /data/adb/nanodroid_patcher + ui_print " << uninstalling: NanoDroid-Patcher artifacts" + elif [ -f /data/adb/.nanomod-patcher ]; then + rm -rf /data/adb/.nanomod-pacher \ + /system/addon.d/75-nanomodpatcher.sh \ + /data/adb/nanomod_patcher + ui_print " << uninstalling: NanoMod-Patcher artifacts" + elif [ -f /system/.nanomod-patcher ]; then + rm -rf /system/.nanomod-patcher \ + /data/nanomod.patcher \ + /system/addon.d/75-nanomodpatcher.sh + ui_print " << uninstalling: NanoMod-Patcher artifacts" + fi +} + +ui_print " " +ui_print "*****************************" +ui_print " NanoDroid 15.90.20180119 " +ui_print " created by Nanolx " +ui_print " Uninstaller " +ui_print "*****************************" +ui_print " " + +if ! (is_mounted /data); then + mount -orw /data || error " !! failed to mount /data" +else mount -orw,remount /data || error " !! failed to re-mount /data read-write" +fi + +if ! (is_mounted /system); then + mount -oro /system || error " !! failed to mount /system" +fi + +ui_print " << Removing configuration files (if any)" + +for path in ${config_locations}; do + for file in ${config_files}; do + if [ -f "${path}/${file}" ]; then + rm -f "${path}/${file}" + ui_print " <<> removing ${path}/${file}" + fi + done +done + +# System Mode uninstallation +if [ -f /system/.nanomod-list ] + system_list=/system/.nanomod-list + system_mode_uninstall +elif [ -f /data/adb/.nanomod-list ]; then + system_list=/data/adb/.nanomod-list + system_mode_uninstall +elif [ -f /data/adb/.nanodroid-list ]; then + system_list=/data/adb/.nanodroid-list + system_mode_uninstall +fi + +if [ -f /data/adb/magisk.img ]; then + mkdir -p /magisk + mount_image /data/adb/magisk.img /magisk || \ + error " !! failed to mount /magisk" +elif [ -f /data/magisk.img ]; then + mkdir -p /magisk + mount_image /data/magisk.img || \ + error " !! failed to mount /magisk" +fi + +if (is_mounted /magisk); then + for module in NanoMod NanoDroid NanoModmicroG NanoDroid_microG \ + NanoModfdroid NanoDroid_FDroid; do + if [ -d /magisk/${module} ]; then + ui_print " << uninstalling: ${module}" + rm -rf /magisk/${module} + fi + done +fi + +ui_print " >> clean up" + +if (is_mounted /magisk); then + umount /magisk + losetup -d $LOOPDEVICE + rmdir /magisk + shrink_magisk_img || \ + error " !! failed to shrink magisk.img" +fi + +umount /system + +ui_print " " +ui_print " > Done!" +ui_print " " +ui_print "Thanks for giving NanoDroid a try" +ui_print " " + +exit 0 diff --git a/uninstaller/META-INF/com/google/android/updater-script b/uninstaller/META-INF/com/google/android/updater-script new file mode 100644 index 00000000..11d5c96e --- /dev/null +++ b/uninstaller/META-INF/com/google/android/updater-script @@ -0,0 +1 @@ +#MAGISK