How to efficiently develop system applications on the Android Marshmallow platform?

I am working on developing system applications with Android privileges with a engplatform design ...

In Lollipop, I was able to install LOCAL_DEX_PREOPT := falseand then use mmAPK to build, build adb remountand adb pushAPK in the system partition. The system will detect changes and rebuild dex, and my performance will be high. If the application was persistent, I just needed to kill the process additionally.

Now I face all kinds of problems with this process, developing on Marshmallows. Pressing the APK and trying to execute gives:

02-01 20: 58: 26.302 E / dex2oat (3045): Oat file could not be created: / data / dalvik -cache / arm64 / system @ priv-app @ XYZ@XYZ.apk @ classes.dex: Permission denied

SELinux problem:

[1614.216323] type = 1400 audit (686361.299: 48): avc: denied {write} for pid = 2640 comm = "oid.XYZ" name = "arm64" dev = "dm-0" ino = 360453 scontext = and: g : system_app: s0 tcontext = u: object_r: dalvikcache_data_file: s0 tclass = dir permissive = 0

I tried all kinds of hacks to get around this ...

Of course, I could rebuild the entire img system and run it, but that kills performance.

+4
source share
1 answer

, SELinux app_main.cpp. , :

  • LOCAL_DEX_PREOPT := false, dex APK
  • adb remount
  • adb rm -rf /system/priv-app/XYZ/oat
  • adb push $OUT/system/priv-app/XYZ/XYZ.apk /system/priv-app/XYZ/
+2

Source: https://habr.com/ru/post/1668574/


All Articles