[Q] Help me! Modify CMParts.apk lead to FC! - Android Q&A, Help & Troubleshooting

When I modify the CMParts.apk's ../res/values-zh-rCN/strings.xml,
It lead to a bug, a CM setting option will Force Close;
CyanogenMod settings->Interface->Notification power widget->Widget buttons->Brightness modes,
Brightness modes will FC, can anyone help me?
These are my steps to modify the CMParts.apk:
1. install JRE;
2. download the apktool1.4.3 from code.google.com;
3. use "apktool d CMParts.apk" to decompile CMParts.apk;
4. modify ../res/values-zh-rCN/strings.xml, edit the string"警告:前面有怪兽!" to "警告!", in line 356;
5. use "apktool b CMParts CMParts1.apk" to compile modified files;
6. use CMParts1.apk's resources.arsc to replace CMParts.apk's resources.arsc;
7. copy CMParts.apk to /system/app, and grant it all permissions.
Any other CM settings work well;
the string"警告:前面有怪兽!" is be change to "警告!" succeed.
My OS is Win7(32bit), Used tools is apktool 1.4.3;
Sorry my English, My English is so poor;
Can anyone help me? Thx.^*(- -)*^
this ploblem is sloved, plz look 5th floor.

Nobody can help me? :-(

I've modded a few apks and im pretty sure you have to delete the new resources.arsc (the one from the project folder) before recompiling or it won't work, that could be why you get fc.
Also did you copy your modified XML to the new project folder too?
Sent from my HTC Legend using XDA App

but, when compile the modified xml,
the modified xml is not exist in CMParts1.apk,
and i replace the resources.asrc,
the string which i wanna modified is changed,
to puzzle me, the xml which lead to fc, is not the strings.xml,
In my opinion, it should be in /res/values/X.xml.
Sent from using XDA App

the cmparts.apk cant be decomplied by apktool or other tools,
if modify, should be modify the Source Code from CyanogenMod,
that's all.

Related

CM6 - Need help editing Settings.apk

Hello,
I'm working on adding Hebrew UI for android.
I have the strings.xml(s) of all the translated files and now i'm tring to add them back to the APK files.
this is what i've done so far (and it worked):
using APKTool I decompiled the APKs.
take the strings.xml (and other if needed) form "values" and translate it.
added new folder in "res" called values-iw (iw stand for hebrew).
put the translated strings.xml (and other files if needed).
compiled back with APKTool.
It work very well on every file i've worked on (Browser, Contects etc..).
Now for the problem
When I put the Settings.apk back in - i can't get to the "settings" (pressing it does nothing) and if I try to add a widget or a shortcut to the screen - I get Force Close on android.prosses.acore.
Any ideas?
Thanks!

[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

[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)

[TUTORIAL]How to modify SysemUI.apk

Good Day Guys!​I present this small guide on how to modify your SystemUI.apk (ICS only)​Things yah need:​APK Manager (http://forum.xda-developers.com/showthread.php?t=695701)​Java (Oh... You know where to find it)​A Windows or Linux PC.​Lets Get Started!​Decompiling:
1. Extract APK Manager from the .zip file.
2. Run Setup.bat
3. Grab the untouched framework-res.apk and SystemUI.apk from the Base ROM.
4. Place them both in "place-apk-here-for-modding" folder
5. Double click on Script.bat
6. type in 24 and type the corresponding number for framework-res.apk
7. type 9 and it should decompile (If you don't decompile framework-res.apk first you'll have serious problems.)
8. Now type in 24 again and type in the corresponding number for SystemUI.apk
9 Type in 9 and decompile.
10. Now make your modifications in "projects folder"​
Click to expand...
Click to collapse
Recompiling:
1. Once your Done go back to script.bat
2.Make sure the "Current Project" is set to SystemUI.apk
3.Type in 11 ENTER to compile apk
4.Type "y" again to confirm you DO want to add additional files that you didnt modify from thee ORIGINAL apk
5.Go into where Apkmanager is installed, and you should see a new folder called KEEP
6.Open "KEEP" folder and whatever you modified, delete the stock version of it I.e: if you inserted new battery icon png's, delete the STOCK battery icon pngs, and if you also edited any xml(s), DELETE the resources.arsc from the KEEP folder
7.Once done, go back into Script.bat and press ENTER to continue
Click to expand...
Click to collapse
Well Good Luck! , Happy Modding! ​
Reserved for the Manual
Nice tutorial, man! You're back! http://bancomicsans.com/
Great! I believe lots of users will love this good to have you back
Sent from my awesome fridge
TAM
I respect your knowledge no doubt..However I have just opened systemui.apk by 7-zip>replaced png which I want>closed 7-zip..Thats it..Replace sytemui.apk at phone>Changed persmission.
R: [TUTORIAL]How to modify SysemUI.apk
KSKHH said:
TAM
I respect your knowledge no doubt..However I have just opened systemui.apk by 7-zip>replaced png which I want>closed 7-zip..Thats it..Replace sytemui.apk at phone>Changed persmission.
Click to expand...
Click to collapse
In fact only pngs you can replace without decompiling but if you want to edit smali or XML files you have to decompile like Tam wrote.
xpirt

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