Resign system application - Android Q&A, Help & Troubleshooting

Hi,
Hope someone would be able to give me some help\advice.
I have a system application and trying to install it onto another phone. The installation keeps failing.
How would I get this app resigned so it will install?
The phone that I am trying to install the apk on is a nexus 5 with a custom rom.
Any help would be appreciated.
Thanks

If your getting a error about it not being signed, you need to find a signed installation. You cant sign it yourself.

Thanks for the response.
So if I wanted to add a system app into a Rom before I flash the phone can that be done and how would I do it?
Thanks

All the system apps have to have a signing that matches that of /system/framework/framework-res.apk
The most radical solution is for you to resign everything with your own keys.

Related

[Q] Force Close when decompile&compile CM7 Contacts.apk CMParts

I want to change locales and images in system apk of CM 7.2.0 on my LG-P500. It is Contacts.apk and CMParts.apk. Decompiling and compiling passed without errors. Everything is ok! But!
When i put on phone already changed Contacts.apk upon transition to a tab of a dialer I receive an (android.process.acore Force Close!) And
When i put on phone already changed CMParts.apk upon transition to Interface/Notification Power Widget/Widget Buttons/Brightness modes I receive an (android.process.acore Force Close!).
Help me please...! I don't know that I do not so. Thanks!
(Sorry for my English)
Did you sign the apk?
I know that some people claim you don't need to sign system apps, but there are times when signing it is the only way to make it work.
Also, did you decompile and recompile with the appropriate framework-res.apk installed (the one from the rom you are using)?
Yes. I put signed and not signed apks. All the same too most. And when I try to decompile with dependences APK Manager writes that this application not the dependent.
TroyxRUS said:
Yes. I put signed and not signed apks. All the same too most. And when I try to decompile with dependences APK Manager writes that this application not the dependent.
Click to expand...
Click to collapse
Have you tried running a logcat to see what the issues are? That's what I always do when I get errors. Usually the logcat will tell you the error in a detailed enough manner that you can go back and fix the code.
Is this by any chance a stock rom? Because if its a stock rom, I've heard of people having issues sticking modified apks into a stock rom.
I have the same problem and would like very very much to know how to solve that ...
thanks
How to install framework?
Press Thanks on getting Helped by me

[Q] Modifying smilies in LatinImeGoogle.apk

I've seen previously that you can modify 'more_keys_for_smiley' in LatinIME.apk to modify the predefined smilies in the keyboard ( http://forum.xda-developers.com/showthread.php?p=23362533 ).
I'm trying to do this for LatinImeGoogle.apk.
I've got it decompiled with apktool, but I can't seem to find where 'more_keys_for_smiley' is defined to change it. The only reference to it inside of that apk is in key_styles_common.xml where it has:
<key-style latin:moreKeys="!text/more_keys_for_smiley" latin:backgroundType="functional" latin:keyOutputText=" " latin:keyLabel="" latin:keyLabelFlags="hasPopupHint" latin:styleName="enterKeyStyle" />
Can anyone help me locate more_keys_for_smiley so I can modify it? Does the "!text" refer to a different package?
Thanks in advance for any help.
Ok, thanks to someone's help I was able to figure out that the string is now located in the odex file for the keyboard. I was able to deodex LatinImeGoogle.odex using baksmali and edited the file com/android/inputmethod/keyboard/internal/KeyboardTextsSet.smali. I then used smali to recreate the odex file, but pushing it to my device and rebooting causes the keyboard to not load. Do I need to do anything special with this new odex file?
I tried following tutorials ( http://forum.xda-developers.com/showthread.php?t=1208320 ) and using automatic batch scripts ( http://forum.xda-developers.com/showthread.php?p=31360029 ) for recreating the new odex file and copying the signature from the old one, but I could not get it to work. At best I got the keyboard to load and instantly crash, at worst it wouldn't even load the keyboard upon boot.
Anyone want to offer some advice or take a stab at this?
Seems like your doing exactly what i'm trying to accomplish, and had success, so i'm gonna ask a couple questions, but first some background info.
I'm using a (Verizon) Galaxy Nexus, CM10.1 Clockwork Recovery, GAPPS. (no custom Kernels, etc)
I'm a windows guy, definitely a noob to linux, i'm comfortable following the more complicated instructionals, but traveling off the beaten path is difficult for me.
I was able to use apktool tool to decompile Latinime.apk, and i found KeyboardTextsSet.smali, and the smileys i want modified.
Is it as simple as recompiling and installing it? (remove/uninstall keyboard via TitaniumBackup first?)
You refer to a LatinImeGoogle.odex, is this only relevant to someone using an odexed rom?
I appreciate greatly any assistance you are able to provide!:good:
PrettyPistol555 said:
Seems like your doing exactly what i'm trying to accomplish, and had success, so i'm gonna ask a couple questions, but first some background info.
I'm using a (Verizon) Galaxy Nexus, CM10.1 Clockwork Recovery, GAPPS. (no custom Kernels, etc)
I'm a windows guy, definitely a noob to linux, i'm comfortable following the more complicated instructionals, but traveling off the beaten path is difficult for me.
I was able to use apktool tool to decompile Latinime.apk, and i found KeyboardTextsSet.smali, and the smileys i want modified.
Is it as simple as recompiling and installing it? (remove/uninstall keyboard via TitaniumBackup first?)
You refer to a LatinImeGoogle.odex, is this only relevant to someone using an odexed rom?
I appreciate greatly any assistance you are able to provide!:good:
Click to expand...
Click to collapse
Yes, you should be able to modify KeyboardTextsSet.smali and then recompile and install the keyboard. I never achieved any success because I'm on an odexed ROM and couldn't get reodexing to work properly.
Tried but no joy, then realized it could be because the apk was from a previous nightly (couple days) than the one currently installed. Crossing my fingers that it's the reason it didn't work.
I'll try again.
sent from my vzw Galaxy Nexus / CM10.1 (nightlies)

[Q] APK compiled/recompiled will not install

I was trying to make some changes to an apk and edit the classes.dex. It wasn't installing so I figured my changes must have messed it up. But it seems that simply decompiling and recompiling it messes it up. I don't even make any changes. I also re-sign it using jarsigner. I also uninstalled it so each install is a new install. Could anyone point me in the direction of what could be the problem please? Thanks. I'm using smali/baksmali.
Edit: I started using apktool and it finally installed. Unfortunately, now the app closes immediately after I open it. Sometimes it doesn't even open all the way. Any suggestions? Thank you.

How to modify system app?

Hi all,
I'm trying to comment out one line of code in system apk on car head unit.. Im using apktool to decompile and then compile again.
However I cant update the app, it says something like that app is persistent... System is Android 9, rooted.
If I replace apk in root system then I get corrupted android and need to do factory reset. Can someone help?

How would I debug an Android app to figure out how to inject my own images instead of the ones designated? Is there a tool to see "under the hood"?

What tools can I use to do that? I know how to do it with JS web apps, but I'm not sure how with an Android one. Can someone please give me a couple pointers? I don't need you to hold my hand. Just give me something to go off of as a start. I will read whatever you post.
Thank you
didymus said:
What tools can I use to do that? I know how to do it with JS web apps, but I'm not sure how with an Android one. Can someone please give me a couple pointers? I don't need you to hold my hand. Just give me something to go off of as a start. I will read whatever you post.
Thank you
Click to expand...
Click to collapse
First, are you trying to modify a system app or a user installed app? If it is a system app, it will probably require your device to be rooted in order to make your modifications and have it actually work.
You would need to use something like APKtool or some other kind of decompiler to unsign and decompile a copy of the apk file for the app. Then, when you find where the images are located in the decompiled file system, replace them, then recompile and resign the apk file and install the modified apk, reboot to recovery, wipe cache partition(but do not factory reset), then reboot the device.

Categories

Resources