OTA update and system app signature

364 views
Skip to first unread message

Tomei

unread,
Dec 20, 2010, 5:26:36 PM12/20/10
to android-platform
Hello,

We are thinking of changing one of the built-in apps to use the
platform signature (because a new feature is added that requires to
access some protected features of the Android platform). So we are
modifying the Android.mk file to include this:

LOCAL_CERTIFICATE := platform

However, is this going to create any problem if the user makes an OTA
update? Will the old data from the app (before the OTA update) still
be accessible by the new reincarnation of the app?

We had problems before where the app's PID changed after OTA update
(due to a screw-up in build script). This caused all old data to be
wiped out after OTA update. So we want to avoid this unpleasant
scenario if possible.

Thanks!

Dianne Hackborn

unread,
Dec 20, 2010, 5:58:23 PM12/20/10
to android-...@googlegroups.com
This will at the very least cause your uid to change, which will require wiping your existing data.  In froyo an updatecmds facility was introduced to help deal with major structural changes like this to apps during an OTA update.  You just put a file in /system/etc/updatecmds containing information used to move existing data.  For example this is the Froyo one for Google's apps:

# Commands to move files associated with base Google packages.

# Merge all data into the new com.google.android.gsf package.
com.google.android.gsf:com.google.android.providers.talk
    databases
com.google.android.gsf:com.google.android.googleapps
    databases
com.google.android.gsf:com.google.android.apps.gtalkservice
    files
com.google.android.gsf:com.google.android.providers.settings
    databases

# Merge the old IM database in Donut to the new com.google.android.gsf package.
com.google.android.gsf:com.android.providers.im
    databases

# Merge all data from the gmail content provider into the
com.google.android.gm:com.google.android.providers.gmail
    databases

# Calendar couldn't use original-package due to a shared user ID
com.google.android.calendar:com.android.calendar
    shared_prefs


--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.




--
Dianne Hackborn
Android framework engineer
hac...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails.  All such questions should be posted on public forums, where I and others can see and answer them.

Tomei

unread,
Dec 22, 2010, 11:53:53 AM12/22/10
to android-platform
Hi Dianne,

Thanks for the detailed answer.

I tried to just change the certificate, and use "adb shell stop; adb
push foobar.apk /system/app; adb shell start", and for some reason the
app seems to keep its old settings. (This is Froyo).

So is the updatecmds really necessary? Or, does OTA do more than what
happens during stop/start?

Thanks
> > android-platfo...@googlegroups.com<android-platform%2Bunsubscrib e...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/android-platform?hl=en.
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com

Dianne Hackborn

unread,
Dec 22, 2010, 12:15:05 PM12/22/10
to android-...@googlegroups.com
Sorry I misspoke.  Just changing the certificate is fine (that doesn't cause its uid to change).  Changing the sharedUserId will cause the uid to change, though, requiring the data be erased.

To unsubscribe from this group, send email to android-platfo...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.




--
Dianne Hackborn
Android framework engineer
hac...@android.com
Reply all
Reply to author
Forward
0 new messages