Help! troubles compiling framework-res (oreo) - Android Q&A, Help & Troubleshooting

I need some help after editing the framework res of my device to change the round icon bool value system wide, it is quite simple following this guide
But, I got errors when trying to recompile. I already installed all the framework apk's found inside system/framework (I will include them 2 apks + the logs and decompiled files in the link below)
https://drive.google.com/open?id=1TPuMyHh9hgjt6ev0g2feJc_Od5m_wvrY
Device is: HTC U11 stock Oreo ROM

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

howto de/compile systemui.apk without any error

Hello,
I wanted to de/compile the systemui.apk and got errors.
I installed framework-res.apk with apktool.
After installation I used apktool (Win7) and decompiled the systemui.apk.
But I got the same errors as many others have gotten them.
brut.blahblahblah..
So I tried other apktool.jar (apktoolICS.jar) and it worked fine!
I opened the new systemui folder and there are the following folders:
res and assets
no smali folder. is it right and normal?
Because the compiling with old apktool (not apktoolICS) didn't work, I compiled with the ICS file and it worked. I got the translation message (airplane_mode).. Not interesting for me atm.
When I look at the new built systemui.apk, I wondered about the file size.
The new file: 1.009kb
The old file: 1.338kb
I signed the new file. Now the file size is 1.044kb.
I edited only a xml file (styles.xml)..
The file didn't work on the sgs2..
Could someone tell me what I did wrong?
Please help me
Best regards
Marcus
*push* after moving to correct section
maybe no need to sign your new file,
try to drag the META-INF folder and the AndroidManifest.xml from the older file to the new file you build
BTW, is your old systemui file a deodex one?
if no deodex, the smali code wil include in the odex file~

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

Help- Not able to sucessfully recompile samsungcamera apk

Hi.
I extracted samsungcamera from qsrom 4.4.2 i9300 nl1, and decompiled it using apktool.
then I modified smali files and replaced
"com.sec.android.gallery3d" to "com.alensw.PicFolder"
"com.sec.android.gallery3d.app.Gallery" to "com.alensw.PicFolder.GalleryActivity"
but after recompiling it with some error I got new modified class ,resourceses, and other xmls,
then I opened original samsungcamera.apk and replaced inside with new class, recources and xmls, and then pushed new samsungcamera.apk in system app gave proper permissions , installed quickpic and restarted,
after restart camera icon shows in app drawer but when opened it force-closes.
if someone with knowledge could could modify samsungcamera the it would be great help, ThankYou
files used
quickpic- http://forum.xda-developers.com/android/apps-games/app-quickpic-v4-5-2-classic-version-t3204543
samsung camera apk decompiled and modified - http://d-h.st/IdeC
samsungcamera original in attachment

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