How to Re-Sign System APK for Android - Android Q&A, Help & Troubleshooting

I wanted to disable the Flash to black/screen update function on my yotaphone 2 e-ink's screen as it really disturbes me. I worked out there was a setting to do this in the phones SDK app.
I decompiled the YD_YotaphoneSDK.apk app and changed some of the settings in the classes.dex files so as to disable the full screen refresh (i.e change the backscreenmanager waveform mode to A2). I then recompiled the YD_YotaphoneSDK.apk app however when I attempt to install it on my YotaPhone it states 'Parse Error- There was a problem while parsing the package'.
Im pretty sure it needs to be resigned but cannot workout how, when i attempt to do so in android studio i get the following error: Error:Android Source Generator: [YD_YotaphoneSDK] Package is not specified in AndroidManifest.xml
Can anybody with some relevant experience give my some suggestions of how I can resign or enable this recompiled version of the APK to be installed on my yotaphone.
I have attached the edited apk file
Regards

Related

[Q]Problem after changing AndroidManifest.xml

Hello Guys and Galls,
I want to change the background of Settings.apk from black to white. I use the FroyoMod Rom http://forum.xda-developers.com/showthread.php?t=815595.
If change
Code:
<application android:label="@string/settings_label" android:icon="@drawable/ic_launcher_settings" android:taskAffinity="">
to
Code:
<application android:theme=[COLOR="Red"]"@android:style/Theme.Light.NoTitleBar"[/COLOR] android:label="@string/settings_label" android:icon="@drawable/ic_launcher_settings" android:taskAffinity="">
in AndroidManifest.xml.
I use ApkManger to decompile and compile. The (de)compiling is without any errors.
After compile with ApkManager i do the follow:
- open original Settings.apk and unsignedSettings.apk with 7-zip
- delete AndrodManifest.xml in original Settings.apk
- copy AndroidManifest.xml from unsignedSettings.apk to original Settings.apk
- copy the modified original Settings.apk to the phone in /system/app
- chmod 644 Settings.apk
- chown root:root Settings.apk
So now if I start Settings nothing happens, nothing, not even an fc.
This is was logcat says:
Code:
com.android.settings has no certificates at entry AndroidManifest.xml
What I´m doing wrong?
Try one of the many apk re-packaging tools on this forum. Ive used apktool but there are some front ends built for it
From something awesome
killersnowman said:
Try one of the many apk re-packaging tools on this forum.
Click to expand...
Click to collapse
tigger-gg said:
I use ApkManger to decompile and compile.
Click to expand...
Click to collapse
By the way if I change any other xml file in /res there are no such problems.
tigger-gg said:
I use ApkManger to decompile and compile.
Click to expand...
Click to collapse
dur
i read this on the mobile and did not see that....
solving the problem? because I would be interested
Me too, I'm having a problem recompiling an AndroidManifest.xml with apkmanager 5.0.1., it won't install unless I use an original AndroidManifest.xml file first, then I can flash right over it. At first I thought it was a the change I made in the file, but I just decompiled and compiled an unmodified version, and it did the same thing. So its the compiler.
Settings.apk is a signed system app. It will refuse to run unless signed by the same key as the rest of the system apps. Just replacing a single XML in the APK will cause a signature mismatch.
Best bet? I'd say make your change, then use a kitchen like dsixda's to resign the whole system with the test key (I think this is a menu option).
Yep your whole system has to have the same signature. I did this edit for a rom a while back, but I made the settings transparent instead of white background by using Theme.Wallpaper.NoTitlebar. Just sign your whole rom together with testkeys and all should be good until another system app gets changed/modified and the signatures don't match again.
Sent from my PG06100 using Tapatalk
Thanks to Gene Poole and one_love_420, I will try your instructions.
If your after quickly signing a whole load of apk's, I wrote a command line front end to do all the hard work for you.
You can even generate your own private key.
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums
Moving to Q&A
BUMP to top
Please big problem been fighting for weeks
any one know anything about this!!
So anybody find a solution yet? Seems to be the binary text conversion.
It is the signitures in manifest.inf fyi

Wifi Calling, Modifying, & Signing ims-service.apk

​ims-service.apk is part of Wifi Calling. Upon decompilation it appears to contain a file res/values/strings.xml that contains information for connecting to the tmobile sip server. Now, I would like to modify this server info so I can connect to the sip server of my choice. However, merely decomp/editing/building ims-service.apk creates an unusable apk. This is due to its lack of signing? Would I be able to sign the apk myself or would I need the cert the authors used due to trust issues from other apk's using this apk (rendering any rebuilds futile and signing impossible)? Another approach I found would be to just decompile, edit the xml, and add the xml into the unmodified ims-service.apk. However, upon openning ims-service.apk with 7zip there is no res/values/ folder or the strings.xml.
Any guidance?
other resources -
http://code.google.com/p/the-ims-open-source-project-for-android/
looks like all i have to do is drag in a modified resources.arsc?

[Q] Problem with apks (de)compiled with apktool

I made some changes to my SystemUI.apk, and I pushed it back, then rebooted, only to find my status bar had disappeared.
So, I restored to my backup, and made 4 copies of the SystemUI.apk to try to find out where the problem lay.
Copy 1: No change
Copy 2: Decompiled and Compiled with apktool. No other change.
Copy 3: Decompiled with apktool. Changed one png. Compiled with apktool
Copy 4: Decompiled with apktool. Edited text in strings.xml and changed a few colours. Compiled with apktool.
Out of these 4, only the first one worked. The rest had my status bar gone. Hence I have arrived at the conclusion that something had gone wrong in either the compiling or decompiling stages. I didn't sign the apk because I read that system apps should not be signed.
Just to make sure, these were the steps I took.
1. Retrieve SystemUI.apk, framework-res.apk, and SemcGenericUxpRes.apk
2. Install frameworks with apktool
3. Decompile SystemUI.apk
4. Make any changes
5. Compile
6. Place on SD card
7. Change \system\ to be RW
8. Copy SystemUI.apk from sd card, and overwrite the one in \system\app
9. Ensure permissions are set to rw-r-r (644)
I have not much idea what else could have gone wrong, but then again, I'm just a newbie who follows others' guides and might have missed out on doing something. Perhaps some kind soul would be able to point that out?
Well, apktool is using smali/baksmali to compile/decompile classes.dex/apk_name.odex file.
The problem can occur when you use different baksmali version when you decompile and also not the right version to compile (as the system expects it to be). You can also experience issues if the apk is not zipaligned properly (check down who to do that)
apktool has the smali/baksmali code inside it so you will need to get the newest version for it for JB for example.
You can check why the status bar is not there when you monitor the logcat and look for DEX related logs in the beginning.
You can also use smali/baksmali on your own: http://code.google.com/p/smali/wiki/DeodexInstructions
and just place the generated classes.dex in the apk
then zipalign -f 4 filein.apk fileout.apk (http://developer.android.com/tools/help/zipalign.html)
then push back fileout.apk (sytemui.apk in your case)

[Q] NAVER LINE: Modifying androidmanifest.xml

Hi guys,
I'm owning a Nexus 5 with original ROM.
I'm trying to decompile with apktool the LINE app (messaging app, from Naver) because I want to change the androidmanifest.xml in order to prevent the app to be shown on recent application list (LINE content is shown on that list even if passcode is enabled).
The steps I follow are:
1 - Download LINE apk from google play
2 - Decompile it with apktool
3 - Modifiy androidmanifest.xml
4 - Compile with apktool
5 - Sign with a test certificate
6 - Install the new apk to device (Nexus 5)
The app installs, but when I execute it, it suddenly stops with a message (Application stopped).
I tried the same procedure on Whatsapp and it worked, so I think LINE's server is verifying that the client app is what is supposed to be (maybe comparing file sizes? certificates?? ).
The original apk downloaded on step 1 is correct, I can install it and the app works.
If I bypass step 3 (just decompile and compile the "same" code), same result (Application stopped).
I'm really stucked on it. Does someone ever tried this? I would really appreciate any help. Thank you very much.

Android 11, Is it possible to decompile / edit / recompile framework-res.apk

Ok. Changing settings in frameworks-res.apk seems to be a lot harder than it used to be.
Creating an overlay apk doesn't seem possible without the original signature of the ROM.
Is it still possible to decompile / modify/ recompile framework-res.apk and use the META-INF and AndroidManifest.xml from the original framework-res.apk?
If not, Is there anyway to edit framework-res.apk short of developing your own rom from source?
Ok I see that it is not due to new v3 apk signature. Would it be possible if signature check was disabled?
Edit: This is indeed not possible. Disabling signature I never tested. I created an RRO apk to change the values. See this thread: https://forum.xda-developers.com/t/night-light-display-red-only-tweak.4220829/
Yes you can, you need to have conscrypt setup with your java/openjdk etc. Are you signing with testkeys, platform etc? Just seeing this.

Categories

Resources