Both sides previous revision Previous revision Next revision | Previous revision |
lwc:programming:mobile:android:root [2021/09/28 09:36] – John Harrison | lwc:programming:mobile:android:root [2022/01/03 12:21] (current) – [Tips and Tricks] John Harrison |
---|
| |
==== Apps ==== | ==== Apps ==== |
* [[https://forum.xda-developers.com/t/util-win-mt65xx-mtk-droid-root-tools-mediatek-android-smartphone.2160490/|MTK Droid]] [[alternate link|https://androidmtk.com/download-mtk-droid-tool]] runs in Windows only and reads/writes scatterfiles. Can also root | * [[https://forum.xda-developers.com/t/util-win-mt65xx-mtk-droid-root-tools-mediatek-android-smartphone.2160490/|MTK Droid]] [[https://androidmtk.com/download-mtk-droid-tool|alternate link]] runs in Windows only and reads/writes scatterfiles. Can also root |
* [[https://forum.hovatek.com/thread-21495.html|Mediatek (MTK) Auto Philz recovery porter]] creates custom recovery | * [[https://forum.hovatek.com/thread-21495.html|Mediatek (MTK) Auto Philz recovery porter]] creates custom recovery |
| |
==== App and file permissions ==== | ==== App and file permissions ==== |
* [[https://source.android.com/security/app-sandbox|The app sandbox]] | * [[https://source.android.com/security/app-sandbox|The app sandbox]] |
| === Giving an app root access === |
| //Apps need to be system apps to have root-type privs// |
| * [[https://stackoverflow.com/questions/17222535/create-system-application|How to make your app a system app on a rooted device]] |
| * [[https://titanwolf.org/Network/Articles/Article?AID=08b12461-41e9-4fa2-9fe9-e40a604cfb53|root run bash-like commands etc.]] |
| * [[https://medium.com/android-news/system-app-in-android-f003d418b4cc|tutorial on Medium on how to make system apps]] |
| |
| For apps to have root access they need to be system apps. For KitKat the app needs to be in ''/system/priv-app'' with 644 permissions. |
| * Example: ''cat /sdcard/SecureSetting.apk > /system/priv-app/SecureSetting.apk'' (cp works too) |
| |
| ==== Emulator ==== |
| To give emulator root: |
| - change to directory where emulator is located, probably something like: ''~/.android/avd'' |
| - start the emulator yourself with an incantation similar to: ''~/Android/Sdk/emulator/emulator -avd Nexus_4_API_19 -writable-system -selinux disabled -qemu -enable-kvm'' |
| - in emulator shell: ''mount -o rw,remount /system'' |
| //not fully tested// |
| |
| ==== Tips and Tricks ==== |
| * [[https://android.googlesource.com/platform/frameworks/base/+/master/cmds/bootanimation/FORMAT.md|change boot animation]] |
| * when compressing the animation to a zip, make sure the zip is uncompressed (use the ''-0'' flag) |
| * for script to run on boot add/create ''/system/etc/install-recovery.sh'' |
| * Mount system RW: ''mount -o rw,remount /system'' |
| * Mount system RO: ''mount -o ro,remount /system'' |
| |