To uninstall, just flash the zip again and it'll restore everything to how it was before
If magisk or supersu: a boot scripts (post-fs-data) will be installed that will run all exectuable scripts in init.d. A test init.d script will also be installed.
The rest of this is for non-magisk/supersu installs
Otherwise: the boot img and part of the system will be modified to enable init.d support by using @osm0sis's anykernel2. It's based off of @CosmicDan's original idea with using sysinit. See list below.
What it does:
- Search for sysinit in any rc file. If found and seclabel is missing (typical case), add seclabel. If seclabel is already present, then that seclabel will be set to permissive in sepolicy
- If sysinit isn't found, a custom rc file and sysinit file (modified version of @JustArchi's) will be installed and init.rc and sepolicy will be patched accordingly to add init.d support
- Test init.d script is installed. It'll create an empty file called InitdInjectorTest in /data - if that files is present after rebooting, init.d is working
- Backup/remove any setools present in bin and xbin and then add setools to sbin. These tools include: sepolicy-inject, sesearch, seinfo. All have been ported to android by Xmikos and can be found here: https://github.com/xmikos/setools-android
I am not responsible for any oddities that happen to your device because of this, use common sense. For example, if you know your device has a weird boot img, check first.
With the setools, you can use init.d boot scripts that search and inject sepolicy changes. Check Xmikos's github linked above for more details on their usage
BACKUP BOOT AND SYSTEM PARTITIONS BEFORE FLASHING
Current weird boot imgs supported natively are:
LG bump devices (like my G2)
Devices that require boot img avb-signing
FOR OTHER WEIRD BOOT IMAGES:
If you have a weird boot image not listed above like sony ELF, rockchip KRNL, etc, go here: https://github.com/osm0sis/AnyKernel...nary-inclusion to see which binaries are required
Then get the binaries from the AIK Mobile zip here: https://forum.xda-developers.com/sho....php?t=2073775
Then just copy those binaries to the tools folder of the init.d-injector zip, rezip it, and flash it
Confirmed working (boot img method):
Verizon LG G2
Axon 7 (A2017U)
Confirm your device works and I'll add it to the list!
Special thanks to: @osm0sis, @CosmicDan, @Ricky Divjakovski, @JustArchi
- v1.1 - Use late start for magisk (liveboot is still post-fs-data) due to auto mount occurring after post-fs-data
- v1.0 - Completely redone with unity/ak2 hybrid template for maximal device compatibility