1

i want to do my Home app,and put it to /system dir,and my home app is the Unique home.of course i custom made my home app,and modify android source. all is ok. but i have a question, how to auto update my home app,i donot want to :

adb root
adb remount
adb shell rm /system/app/your.apk
adb push your.apk /system/app

if i can do it like common app update like:

  download apk and
  intent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive");  
  mContext.startActivity(intent);  

or modify android source. can someone give me advice?

pengwang
  • 19,536
  • 34
  • 119
  • 168
  • Did you try the common app update thing? As it is possible to "update" system apps somehow, in that case your updated apk will be kept on /data, as unrooted devices do not support a remount. The user will not be able to uninstall such updated apps, but it is possible to remove the update (e.g. the apk within /data). – dst Aug 15 '13 at 02:59
  • i cannot try using the common app update,i think it is not useful,because my app is system app.so i post the question.i want to update my app like system update. – pengwang Aug 15 '13 at 03:03
  • I don't understand your comment. I just tried updating a system app using the common app method, and it worked (user prompted to agree to the update of the system app, clicked agree, update installed). But maybe I didn't get your question. If you wish to silently update, use [`android.permission.INSTALL_PACKAGES`](http://stackoverflow.com/questions/5803999/install-apps-silently-with-granted-install-packages-permission); in any case your updated app will go to /data, as /system is read-only. – dst Aug 15 '13 at 03:20
  • thank you for answer. if i have root ,i think i can use remove my app ,and then add my app to system and restart device.i cannot understand "in any case your updated app will go to /data, as /system is read-only",your means, using the common app method,my app it will to at data,not at /system ? – pengwang Aug 15 '13 at 05:26
  • When using the common app method, your `/system/app/whatever.apk` is untouched, as it is not possible to change it without root. Your updated apk will go to `/data/app/whatever.apk`, but is treated as update of your `/system/app/whatever.apk`. At least in my little test system app permissions were still working from the new location. – dst Aug 15 '13 at 22:20
  • can you answer my question,so that i receive it – pengwang Aug 16 '13 at 03:12

1 Answers1

1

You can use the "common app update" method, or install the apk silently using android.permission.INSTALL_PACKAGES.

Either way your /system/app/whatever.apk is untouched, as it is not possible to change it without root (and the remount thing you mention in the question). Instead, the updated apk will get stored as /data/app/whatever.apk which will replace your system app. You can still use system app features.

The user can remove the updated apk ("uninstall updates") similar to regular, non-system apps, in that case, your original system apk is used again.

Community
  • 1
  • 1
dst
  • 3,307
  • 1
  • 20
  • 27