Monday, January 15, 2018

6.0 marshmallow - app installed to /system/priv-app won't run


Prerequisites:





  • a rooted Rockchip-based China tablet device running Android 6, patched to disable SystemUI




  • own-developed app which declares LAUNCHER category and is intended to take full conrol of the device




What am I trying to achieve:


install the app as a system app to avoid handling SDK 23+ permissions



What have I done so far:



  • installed the app regularly via Android Studio

  • moved the app to /system/priv-app:


(root)


ls /data/app/my.package.name-1
base.apk
lib
oat

mount -o rw,remount /system
mv /data/app/my.package.name-1 /system/priv-app/AppName
ls -la /system/priv-app/AppName
-rw-r--r-- system system 2464934 2017-12-08 11:32 base.apk
drwxr-xr-x system system 2017-12-08 11:32 lib
drwxrwx--x system install 2017-12-08 11:32 oat
reboot

What is the problem?


It seems the system is not aware the app exists: it does not run on boot (which it perfectly does when installed as a regular app) and I am unable to launch it manually:



root@rk312x:/ # am start -n my.package.name/.ui.MainActivity
Starting: Intent { cmp=my.package.name/.ui.MainActivity }
Error type 3
Error: Activity class {my.package.name/my.package.name.ui.MainActivity} does not exist.

What am I missing?



Answer



Changing the permissions to -rw-r--r-- and owner as root followed by reboot should fix


But as OP pointed out signature issues need to be sorted out


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...