Theming apps

czerdrill

Silver Member
Joined
Jan 2, 2010
Messages
4,825
Reaction score
12
When you theme an app, and you move it from /data/app to /system/app how do you have it so that you're still notified of updates to the app? When I do this and I go to the market, I'm told that the app is no longer installed. Any workaround to this or do you have to manually check and then retheme everytime there's an update?
 

raidzero

n00b.
Premium Member
Developer
Theme Developer
Joined
Apr 15, 2010
Messages
1,054
Reaction score
3
when there is an update you will have to remove the one in system, install the update and then move it to system and theme away. It is a pain and this is why I have chosen to let my updates pile up..

The other way is just edit the APKs directly and then re sign them and they can stay in /data that way, and when there is an update you just have to edit them and re sign again.
 

icculusX

Premium Member
Premium Member
Theme Developer
Joined
Feb 10, 2010
Messages
2,529
Reaction score
0
Location
The Moon
Much better to re-sign them, yes...
 
OP
czerdrill

czerdrill

Silver Member
Joined
Jan 2, 2010
Messages
4,825
Reaction score
12
Thanks, can you point me in the direction of how to resign an apk if you're using Ubuntu and not Windows?
 
OP
czerdrill

czerdrill

Silver Member
Joined
Jan 2, 2010
Messages
4,825
Reaction score
12
when there is an update you will have to remove the one in system, install the update and then move it to system and theme away. It is a pain and this is why I have chosen to let my updates pile up..

The other way is just edit the APKs directly and then re sign them and they can stay in /data that way, and when there is an update you just have to edit them and re sign again.

Ok figured out how to edit and resign but then do I just overwrite the thing that's in /data/app or install the apk? When I tried to install the apk with the edited files it appeared to work but the changes I made didn't stick. I didn't get any errors in resigning or in installing.
 
OP
czerdrill

czerdrill

Silver Member
Joined
Jan 2, 2010
Messages
4,825
Reaction score
12
Tried overwriting as well, and still nothing. The app disappears from the app drawer, and the market shows as if it's not installed...
 
OP
czerdrill

czerdrill

Silver Member
Joined
Jan 2, 2010
Messages
4,825
Reaction score
12
man i don't get this at all haha...why is it that if i install something from the market it shows up in /data/app as com.something.something.apk, but the apk for example in the luna theme is just called Pandora.apk. Do you just rename the apk after it's signed or what is the deal? If I edit the file in the archive directly, then the archive asks me if I want to update after I save.. If I drag a file into to replace, the archive doesn't ask me this, and the apk doesn't install. Just totally confused about this.

Moving to /system/app never has a problem and always works for me, but I would like to learn how to edit the files within the apk and how they are named Pandora.apk, Facebook.apk etc when in /data/app they are not named that...
 

raidzero

n00b.
Premium Member
Developer
Theme Developer
Joined
Apr 15, 2010
Messages
1,054
Reaction score
3
you do not need to rename the APK's. just overwrite the apk in /data after they have been edited and re-signed. you will need to remove the old copy of the apk otherwise you will end up with two or things may break. only keep one copy of the apk on the device at once.
 
OP
czerdrill

czerdrill

Silver Member
Joined
Jan 2, 2010
Messages
4,825
Reaction score
12
hey thanks for your patience, i'm usually not this bad i promise haha :icon_eek:...but it's still not working, so here are the exact steps i'm doing...maybe you can figure out what i'm doing wrong...i'm trying to edit pandora

1] copy com.pandora.android.apk to my sdcard
2] copy com.pandora.android.apk from sdcard to computer
3] edit files, making sure i hit "update archive" when prompted after saving files
4] resigning the apk
5] move the new com.pandora.android.apk to my sdcard
6] navigate to /data/app and delete the existing com.pandora.android.apk
7] paste the newly resigned com.pandora.android.apk from sdcard root to /data/app
8] change permissions to rw-r-r and reboot

The app disappears from the app drawer, and in the market it shows that it isn't installed. I can't figure out what i'm doing wrong here...do i have to uninstall pandora? do i have to install the new apk?
 

raidzero

n00b.
Premium Member
Developer
Theme Developer
Joined
Apr 15, 2010
Messages
1,054
Reaction score
3
hey thanks for your patience, i'm usually not this bad i promise haha :icon_eek:...but it's still not working, so here are the exact steps i'm doing...maybe you can figure out what i'm doing wrong...i'm trying to edit pandora

1] copy com.pandora.android.apk to my sdcard
2] copy com.pandora.android.apk from sdcard to computer
3] edit files, making sure i hit "update archive" when prompted after saving files
4] resigning the apk
5] move the new com.pandora.android.apk to my sdcard
6] navigate to /data/app and delete the existing com.pandora.android.apk
7] paste the newly resigned com.pandora.android.apk from sdcard root to /data/app
8] change permissions to rw-r-r and reboot

The app disappears from the app drawer, and in the market it shows that it isn't installed. I can't figure out what i'm doing wrong here...do i have to uninstall pandora? do i have to install the new apk?

Here is what I would do:

Mount system: adb remount
get the apk onto my PC: adb pull /data/app/Pandora.apk
decompile the apk: apktool d Pandora.apk Pandora
(make my edits)
recompile the apk: apktool b Pandora
(sign the out.apk)
put the edited apk back onto the phone: adb push c:\path\to\your_signed_app.apk /data/app/pandora.apk

my method requires the android sdk, well at least adb from it.
You don;t need to decompile and recompile unless yuo plan to make xml or smali edits. make sure you use 7zip to do the apk editing and saving.
 
OP
czerdrill

czerdrill

Silver Member
Joined
Jan 2, 2010
Messages
4,825
Reaction score
12
still no go...tried it with adb as well...same deal...everything seems to work fine with no errors but then it disappears from the app drawer and the market shows that its not installed...just don't get it
 
OP
czerdrill

czerdrill

Silver Member
Joined
Jan 2, 2010
Messages
4,825
Reaction score
12
easily one of the most frustrating things ever haha...tried everyhting imagineable..adb, root explorer, windows, ubuntu, and nothing works. I know I can take the easy way out and just put it in /system/app but I hate not being able to figure out why it's not working. I've gotta assume it's some issue with resigning because the pushing and pulling work fine and obviously work since moving the apks to /system/app never gives me any problems.

anyone else have any idea what i could be doing wrong here?
 
OP
czerdrill

czerdrill

Silver Member
Joined
Jan 2, 2010
Messages
4,825
Reaction score
12
ok some progress(if you want to call it that...i wouldn't haha)...

I installed Pandora from the market, copied the apk to my sdcard and then uninstalled Pandora through the market

I then adb installed the apk that I had copied and all was well. The app installed, it shows up in my app drawer, and shows in the market as installed

soooo....

the error is happening after I edit the files. I've tried not resigning, I've tried resigning, I've tried adb, I've tried root explorer. I've tried it all, and whenever I edit a file I get the Failure [INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION] or parse error. Anyone can give me any tips on how to resign this apk correctly? I have ubuntu, but i can also use Windows if necessary. I know it can be done, just gotta figure out how haha
 
Top