Updating system apps

Having issues applying a release or having continuing weirdness? Place it here.

Moderator: Revue Mod

FMKaiba
Android 1.0
Posts: 11
Joined: Sun Nov 20, 2011 12:23 pm
GTV Device Owned: Logitech Revue

Updating system apps

Post by FMKaiba »

First off, thankyou GTVHacker for the awesome UserDebug leak, everything seems to work perfect (safe a few unimportant bugs)

One thing that does consern me, is some of the system applications cannot be updated through the market.

The biggest one i am working on right now is the 'Photos for Google TV' app,

Userdebug comes with 1.0, market lists an update 1.1, but if anyone tries to update, the update fails.

If i could somehow get the apk for 1.1 i could debug the problem, i am expecting signature validation issues, of the installed not matching the downloaded cause of the debug signing key.

So, my question is, does anyone have any clue how to get the apk? (i checked /cache) when it downloads.. nothing.
or, does anyone know the database file that the system stores installed applications, i should be able to edit it with sqlite and remove the reference to the app, so the new one will install into /data as it should, without treating it like an update.

-Thankyou!
gottahavit
1.6 Donut
Posts: 107
Joined: Tue Sep 06, 2011 7:53 pm
GTV Device Owned: Logitech Revue

Re: Updating system apps

Post by gottahavit »

FMKaiba wrote:First off, thankyou GTVHacker for the awesome UserDebug leak, everything seems to work perfect (safe a few unimportant bugs)

One thing that does consern me, is some of the system applications cannot be updated through the market.

The biggest one i am working on right now is the 'Photos for Google TV' app,

Userdebug comes with 1.0, market lists an update 1.1, but if anyone tries to update, the update fails.

If i could somehow get the apk for 1.1 i could debug the problem, i am expecting signature validation issues, of the installed not matching the downloaded cause of the debug signing key.

So, my question is, does anyone have any clue how to get the apk? (i checked /cache) when it downloads.. nothing.
or, does anyone know the database file that the system stores installed applications, i should be able to edit it with sqlite and remove the reference to the app, so the new one will install into /data as it should, without treating it like an update.

-Thankyou!
I could be wrong, but my understanding is the system partition cannot be updated on the UD2
FMKaiba
Android 1.0
Posts: 11
Joined: Sun Nov 20, 2011 12:23 pm
GTV Device Owned: Logitech Revue

Re: Updating system apps

Post by FMKaiba »

true, the system partition cannot be touched (thanks intel =/)

but when you update a system app, the updated apk ends up in /data/apps

like on your phone when you update the preinstalled gmail app, that app is in system, and the update goes into /data/ and the sytem knows to perfer the version in data (due to a database somewhere i am guessing?)

problem is, APKs are signed, its why we can update the pandora app for google tv, but not photos. pandora is signed by pandora, but this photos app does not seemed to be signed with the same key as the one on the market.

UPDATE:

I succeded in capturing the apk as it was being downloaded from the market, i will do more reasearch now.

/data/data/com.android.providers.download/cache

is where its stored temporarly

horray "busybox find /data -name *.apk"
FMKaiba
Android 1.0
Posts: 11
Joined: Sun Nov 20, 2011 12:23 pm
GTV Device Owned: Logitech Revue

Re: Updating system apps

Post by FMKaiba »

UPDATE:

Definitely seems to be a signature collision, logcat on install of the update showed a comparison between two clashing signature keys.

I am at a loss on how to solve this, other then explode the new application and hack it to use a different package ID.

Suggestions anyone?

I can't imagine i am the only one who wants the built in applications by google to be able to be updated when new fixes become avalible
M1cha
Android 1.0
Posts: 39
Joined: Sat Oct 08, 2011 8:42 am

Re: Updating system apps

Post by M1cha »

I know, the system-partition cannot mounted RW, but can it be unmounted?
This way we could replace the system-partition with an virtual image at runtime.
This wouldn't give us the full access but still some more possibilities to mod at runtime.

I didn't rooted or installed HC-Leak on my Revue so I can't test this.
FMKaiba
Android 1.0
Posts: 11
Joined: Sun Nov 20, 2011 12:23 pm
GTV Device Owned: Logitech Revue

Re: Updating system apps

Post by FMKaiba »

M1cha wrote:I know, the system-partition cannot mounted RW, but can it be unmounted?
This way we could replace the system-partition with an virtual image at runtime.
This wouldn't give us the full access but still some more possibilities to mod at runtime.

I didn't rooted or installed HC-Leak on my Revue so I can't test this.
Smart idea, i already tried this a while back, u can't really remove /system in android as its running for one.. being as thats essentially whats running the OS, but i was hoping i could collapse the running linux system to a single shell instance, and unmount system, or even change any flag on it.

Despite the 'root' status of the shell through ADB, its still returns denied permissions on any attempt to mount, unmount, or remount the system partition, due to the way the kernel protection is designed.

Though its a little off topic, (but a good topic non the less), all i want to do is update an application to the current revision.

I had 0 luck in determining where android stores its database of installed apps, the more i read code, the more it seems that 'database' is built on run-time and in memory, which we cannot touch... grrr
M1cha
Android 1.0
Posts: 39
Joined: Sat Oct 08, 2011 8:42 am

Re: Updating system apps

Post by M1cha »

Sorry for continuing offtopic but that's an interesting topic :mrgreen:
Did you try the following command?

Code: Select all

umount -l /system
I tried that on my smartphone and this "-l"-option is the only way to unmount system.
I really hope this will work as it's the only way to do this without hacking.
FMKaiba
Android 1.0
Posts: 11
Joined: Sun Nov 20, 2011 12:23 pm
GTV Device Owned: Logitech Revue

Re: Updating system apps

Post by FMKaiba »

UPDATE: i haven't updated this because i been busy trying to work on a trick to get real root access, via basically a 'second boot' effect.

the umount -l /system works... to an extent... i will post more with my results in a day or two.
M1cha
Android 1.0
Posts: 39
Joined: Sat Oct 08, 2011 8:42 am

Re: Updating system apps

Post by M1cha »

Sounds great!
I interested in what exactly you mean(technicaly)?
Does is have something todo with this unmount-trick or did you found something new?
FMKaiba
Android 1.0
Posts: 11
Joined: Sun Nov 20, 2011 12:23 pm
GTV Device Owned: Logitech Revue

Re: Updating system apps

Post by FMKaiba »

Bad news, my plan failed, and nearly bricked my revue. haha

The plan was to use your 'lazy' umount (thats what the -l is for) which would 'empty' the /system dir,

then using a squashfs image and a symbolic link i could load and 'alternate' system from /tmp/system, and it would appear to the OS as /system. and then trigger init to 'boot' the revue from where i set the pointer. (Similar to how the droid-x second init works, just ALOT simpler)

Problems include the fact we don't have rw access to /, and despite the lazy unmount, the /system handle itself cannot be deleted to recreate a new one (i thought i could bypass this, but without rw permissions to /, i cannot, i can just cause it to terribly bootloop.... yay.
Post Reply