exist in the `data` directory of the repository, if so, those files are used when creating packages instead of the default ones from the `doc` directory.
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.