[Q] Modifying SystemUI.apk - Galaxy S II Q&A, Help & Troubleshooting

Okay, so I've never done any modding before, and thought that correcting something that is annoying would be a good way to start!
I've changed my lcd density, so now on the quick bar the "Sound Vibration" and "Auto Rotation" text oveflows.
Being inquisitive and inspired by others modding SystemUI.apk I thought I'd have a go, and after much trouble (using apktool), I discovered apk manager and using it to decompile the apk I found that the strings appear to be in a strings.xml file.
I changed the file, recompiled it and then pushed it to the phone, but there hasn't been any change at all.
Have I missed something?
My process:
ADB Pull SystemUI.apk
Decompile SystemUI.apk (using apkmanager option 9)
Edit and Save SystemUI.apk/res/values/strings.xml
Compile SystemUI.apk (option 11, answering "y" when prompted)
adb remount
adb push SystemUI.apk to /system/app/SystemUI.apk
adb reboot

Wow, I feel stupid now...I was pushing to /system/apps!
So now I am pushing to /system/app, the problem is that the Notification bar doesn't load at all.
It must be the decompile/compile that's causing the problem, when I extract/zip (changing just a few png images) the file is loaded in and the notification bar runs without a hitch.

Signatures? Watch logcat on boot

Here's what logcat throws up:
Exception reading AndroidManifest.xml in /system/app/SystemUI.apk
W/PackageParser( 2701): java.lang.SecurityException: META-INF/MANIFEST.MF has invalid digest for AndroidManifest.xml in /system/app/SystemUI.apk
W/PackageParser( 2701): at java.util.jar.JarVerifier.invalidDigest(JarVerifier.java:130)
W/PackageParser( 2701): at java.util.jar.JarVerifier.access$100(JarVerifier.java:52)
W/PackageParser( 2701): at java.util.jar.JarVerifier$VerifierEntry.verify(JarVerifier.java:122)
W/PackageParser( 2701): at java.util.jar.JarFile$JarFileInputStream.read(JarFile.java:120)
W/PackageParser( 2701): at java.io.BufferedInputStream.read(BufferedInputStream.java:319)
W/PackageParser( 2701): at android.content.pm.PackageParser.loadCertificates(PackageParser.java:343)
W/PackageParser( 2701): at android.content.pm.PackageParser.collectCertificates(PackageParser.java:485)
W/PackageParser( 2701): at com.android.server.PackageManagerService.collectCertificatesLI(PackageManagerService.java:2789)
W/PackageParser( 2701):

Okay so if I'm reading this correctly then it's saying that the SHA1 digest for AndroidMAnifext.xml is invalid, but AndroidManifest.xml hasn't changed.
Weird...

Related

[DEV] Froyo - issues with services.jar

Hiya!
I am having trouble with services.jar. I've deodex'd it with baksmali and I tried to apply some changes. I ran it thru smali and placed the classes.dex file in the services.jar and put it on my nexus one. I deleted the services.odex aswell but it refuses to accept it:
Logcat gives me this: DexOpt: mismatch dep signature for '/system/framework/service'
I've been looking for 2 days now without a result - I'd love some help. Thanks!
rolle3k said:
Hiya!
I am having trouble with services.jar. I've deodex'd it with baksmali and I tried to apply some changes. I ran it thru smali and placed the classes.dex file in the services.jar and put it on my nexus one. I deleted the services.odex aswell but it refuses to accept it:
Logcat gives me this: DexOpt: mismatch dep signature for '/system/framework/service'
I've been looking for 2 days now without a result - I'd love some help. Thanks!
Click to expand...
Click to collapse
Same for me, here my log:
Code:
D/dalvikvm( 132): DEX prep '/system/framework/services.jar': unzip in 187ms, rewrite 7709ms
I/dalvikvm( 132): DexOpt: mismatch dep signature for '/data/dalvik-cache/[email protected]@[email protected]'
D/dalvikvm( 132): Stale deps in cache file; removing and retrying
D/dalvikvm( 132): DexOpt: --- BEGIN 'com.htc.framework.jar' (bootstrap=1) ---

Unable to deodex SystemUI.odex

I have not been able to deodex the SystemUI.odex to be able to modify smali, I always get the below error. I've been able to successfully deodex the Settings.odex, but every SystemUI.odex I've tried always gives me the same error. I was originally using baksmali-1.3.0, then tried 1.3.2 and even tried a 1.3.3 jar that m!k3 over in the One S forums compiled, but all give the same result. Anyone know how to get around this error?
C:\Android Stuff\Phones\EVO LTE\working1>baksmali -d framework -x SystemUI.odex
Error occured while loading boot class path files. Aborting.
org.jf.dexlib.Code.Analysis.ClassPath$ClassNotFoun dException: Could not find superclass Lcom/htc/fusion/fx/MessageListener;
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.loa dSuperclass(ClassPath.java:832)
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.<in it>(ClassPath.java:685)
at org.jf.dexlib.Code.Analysis.ClassPath.loadClassDef (ClassPath.java:282)
at org.jf.dexlib.Code.Analysis.ClassPath.initClassPat h(ClassPath.java:163)
at org.jf.dexlib.Code.Analysis.ClassPath.InitializeCl assPathFromOdex(ClassPath.java:110)
at org.jf.baksmali.baksmali.disassembleDexFile(baksma li.java:104)
at org.jf.baksmali.main.main(main.java:293)
Error while loading class Lcom/android/systemui/recent/RecentAppFxActivity$10; from file SystemUI.odex
Error while loading ClassPath class Lcom/android/systemui/recent/RecentAppFxActivity$10;
I suggest to you that you use this pack for deodex...
or use the baksmali.jar inside...is better and works fine for me with my cellular.
first copy the entire folder from your \system\framework to the same path of the baksmali.jar
and use this command to deodex
java -Xmx1024m -jar baksmali.jar -c :framework.jar -x SystemUI.odex
java -Xmx1024m -jar smali.jar out -o classes.dex
http://forum.xda-developers.com/showthread.php?t=1208320
debarron said:
I have not been able to deodex the SystemUI.odex to be able to modify smali, I always get the below error. I've been able to successfully deodex the Settings.odex, but every SystemUI.odex I've tried always gives me the same error. I was originally using baksmali-1.3.0, then tried 1.3.2 and even tried a 1.3.3 jar that m!k3 over in the One S forums compiled, but all give the same result. Anyone know how to get around this error?
C:\Android Stuff\Phones\EVO LTE\working1>baksmali -d framework -x SystemUI.odex
Error occured while loading boot class path files. Aborting.
org.jf.dexlib.Code.Analysis.ClassPath$ClassNotFoun dException: Could not find superclass Lcom/htc/fusion/fx/MessageListener;
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.loa dSuperclass(ClassPath.java:832)
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.<in it>(ClassPath.java:685)
at org.jf.dexlib.Code.Analysis.ClassPath.loadClassDef (ClassPath.java:282)
at org.jf.dexlib.Code.Analysis.ClassPath.initClassPat h(ClassPath.java:163)
at org.jf.dexlib.Code.Analysis.ClassPath.InitializeCl assPathFromOdex(ClassPath.java:110)
at org.jf.baksmali.baksmali.disassembleDexFile(baksma li.java:104)
at org.jf.baksmali.main.main(main.java:293)
Error while loading class Lcom/android/systemui/recent/RecentAppFxActivity$10; from file SystemUI.odex
Error while loading ClassPath class Lcom/android/systemui/recent/RecentAppFxActivity$10;
Click to expand...
Click to collapse

[Q] Unable to deodex SystemUI.odex

Hi Guys..
I have not been able to deodex the SystemUI.odex to be able to modify smali, I always get the below error.
Code:
C:\I9300>java -Xmx1024m -jar baksmali-1.3.3.jar -d framework -x systemui.od
ex
Error occured while loading boot class path files. Aborting.
org.jf.dexlib.Code.Analysis.ClassPath$ClassNotFoundException: Could not find int
erface Lcom/sec/android/app/minimode/manager/MiniModeAppCallback$OnFocusChangedC
allback;
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.loadAllImplementedInte
rfaces(ClassPath.java:867)
at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.<init>(ClassPath.java:
692)
at org.jf.dexlib.Code.Analysis.ClassPath.loadClassDef(ClassPath.java:282
)
at org.jf.dexlib.Code.Analysis.ClassPath.initClassPath(ClassPath.java:16
3)
at org.jf.dexlib.Code.Analysis.ClassPath.InitializeClassPathFromOdex(Cla
ssPath.java:110)
at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:104)
at org.jf.baksmali.main.main(main.java:297)
Error while loading class Lcom/android/systemui/statusbar/tablet/MiniModeAppsPan
el$1; from file systemui.odex
Error while loading ClassPath class Lcom/android/systemui/statusbar/tablet/MiniM
odeAppsPanel$1;
I've been able to successfully deodex the SecSettings.odex, but every SystemUI.odex I've tried always gives me the same error.
Anyone know how to get around this error?
I was trying to deodex SecContacts.odex. I received same error. I put only SecContacts.apk and SecContacts.odex in the dir. is that the problem? what file else do I need to put?
Error occured while loading boot class path files
~~
a bug of the baksmali, that it won't load certain classes when using -x option
so you should add the code "-c :what-you-need.odex"
ie. : java -Xmx1024m -jar baksmali-1.3.3.jar -d framework -c :minimode.odex -x systemui.odex
make sure you have copy the needed odex file to the folder within systemui.odex...
and sorry for my bad english...

[Q] Help with ApkTool and WhatsApp

Hi people!!
I followed some tutorials to try to customize my WhatsApp app, just wanted to change the icon to start.
I'm doing this, I put whatsapp.apk inside apktool directory and this to cmd:
Code:
apktool.bat d WhatsApp.apk app
this makes a folder app that inside have de decompiled code of whatsapp and works ok.
Then, i go to res, and open icon.png, make a color change, and then save changes.
So, when I'm trying to recompile with:
Code:
apktool.bat b c:\apktool\app whats.apk
fails and shows this:
Code:
I: Building resources...
c:\apktool\app\res\layout-large\abs__action_mode_close_item.xml:5: error: No res
ource identifier found for attribute 'textAllCaps' in package 'android'
.....
And more errors.
It's the first app I'm trying to decompile, i have the latest android sdk-apktool and java jdk.
Thanks You.

Generate an Android App Bundle (*.aab) from the command line

I want to generate an app bundle via the command line[manually]. I have many other modules apart from the app module.
I tried to compile manually each feature module something like this, not sure whether this is the right way.
aapt2 compile project/feature_moduel1/src/main/res/**/* -o compiled_resources
aapt2 compile project/feature_moduel2/src/main/res/**/* -o compiled_resources
after this when I tried with the below command for AAPT2 to convert the app's manifest and compiled resources into the protobuf format
aapt2 link --proto-format -o output.apk -I android_sdk/platforms/android_version/android.jar --manifest project_root/module_root/src/main/AndroidManifest.xml -R compiled_resources/*.flat --auto-add-overlay
Getting errors like:
aapt2 W 11-01 14:40:21 6340 125576 ApkAssets.cpp:138] resources.arsc in APK '/Users/<user_name>/Library/Android/sdk/platforms/android-29/android.jar' is compressed. root_project/feature_module/src/main/res/drawable/btn_toggle_bg.xml:3: warn: generated id 'android:id/background' for external package 'android'. root_project/feature_module/src/main/res/drawable/btn_toggle_bg.xml:6: warn: generated id 'android:id/toggle' for external package 'android'. warn: removing resource ...:array/drawer_title_array without required default value. .....and so on
Does anyone Face similar issues with the above scenario Or any other better approach which I can go for?

Categories

Resources