[Z1C][5.1.1] Going nuts trying to mod Settings.apk! - Xperia Z1 Compact Q&A, Help & Troubleshooting

Hey all,
I need to change 2 small lines of text in an existing XML from a decompiled Settings.apk and it seems just impossible.
I've been on it litteraly 10 hours yesterday trying to figure it out.
I really could use some help.
The data: rooted stock Z1C 5.1.1 14.6.A.1.236 (non deodexed).
I need to decompile Settings.apk, just modify one existing .XML and recompile it.
(as seen here http://forum.xda-developers.com/showpost.php?p=55659129&postcount=2 ).
The problem is I cannot for the life of me recompile the Z1C Settings.apk.
I tested with windows apktool, android apktool, java JRE7, JRE8. It decompiles OK with JR7 but throws memory error with JR8.
But regardless I'm NEVER able to recompile it, apktool is never "able to find sources", and then it crashes out with some PNG error.
I use those 2 frameworks: framework-res.apk and SemcGenericUxpRes.apk.
If you are able to decomp/recomp the Z1C "Settings.apk", please by all means let me know the tools and method you use.
Does it make a difference if my rom (and Settings.apk) is deodexed or not?
Are there more frameworks I don't know about for Z1C?
Thanks much for any help, I'm going a bit nuts with this.

Ps24u said:
Hey all,
I need to change 2 small lines of text in an existing XML from a decompiled Settings.apk and it seems just impossible.
I've been on it litteraly 10 hours yesterday trying to figure it out.
I really could use some help.
The data: rooted stock Z1C 5.1.1 14.6.A.1.236 (non deodexed).
I need to decompile Settings.apk, just modify one existing .XML and recompile it.
(as seen here http://forum.xda-developers.com/showpost.php?p=55659129&postcount=2 ).
The problem is I cannot for the life of me recompile the Z1C Settings.apk.
I tested with windows apktool, android apktool, java JRE7, JRE8. It decompiles OK with JR7 but throws memory error with JR8.
But regardless I'm NEVER able to recompile it, apktool is never "able to find sources", and then it crashes out with some PNG error.
I use those 2 frameworks: framework-res.apk and SemcGenericUxpRes.apk.
If you are able to decomp/recomp the Z1C "Settings.apk", please by all means let me know the tools and method you use.
Does it make a difference if my rom (and Settings.apk) is deodexed or not?
Are there more frameworks I don't know about for Z1C?
Thanks much for any help, I'm going a bit nuts with this.
Click to expand...
Click to collapse
Deodexed is definitely better for this. I don't have confidence to say odex won't work, but I wouldn't be surprised.
What errors are you getting?
I would suggest deodexing. There are flashable patches in the forums. I've been able to use apktool on phone smoothly and easily with deodexed stock rom.

Thanks much for your reply levone1, I'm currently in talks with the creator of apktool to find where the compiling problem comes from, it seems to be related to image (png) files, although the only thing i modified is one .xml file..

Ps24u said:
Thanks much for your reply levone1, I'm currently in talks with the creator of apktool to find where the compiling problem comes from, it seems to be related to image (png) files, although the only thing i modified is one .xml file..
Click to expand...
Click to collapse
Do you have a reason not to deodex?

No I don't, actually I deoxed 2 hours ago
I used this patch http://forum.xda-developers.com/son...236-xperia-z1-z1c-5-1-1-deodex-patch-t3268096
It worked great.
But the exact same problem remains:
I: Using Apktool 2.1.1
I: Checking whether resources has changed...
I: Building resources...
W: libpng error: Not enough image data
W: ERROR: Failure processing PNG image C:\Unzipped\a\Settings\res\drawable-xhdpi
-v4\appwidget_item_bg_pressed.9.png
W: libpng error: Not enough image data
W: ERROR: Failure processing PNG image C:\Unzipped\a\Settings\res\drawable-ldrtl
-xhdpi-v4\appwidget_item_bg_pressed.9.png
etc....
I wait a reply from the dev for now ^^;

Ps24u said:
No I don't, actually I deoxed 2 hours ago
I used this patch http://forum.xda-developers.com/son...236-xperia-z1-z1c-5-1-1-deodex-patch-t3268096
It worked great.
But the exact same problem remains:
I: Using Apktool 2.1.1
I: Checking whether resources has changed...
I: Building resources...
W: libpng error: Not enough image data
W: ERROR: Failure processing PNG image C:\Unzipped\a\Settings\res\drawable-xhdpi
-v4\appwidget_item_bg_pressed.9.png
W: libpng error: Not enough image data
W: ERROR: Failure processing PNG image C:\Unzipped\a\Settings\res\drawable-ldrtl
-xhdpi-v4\appwidget_item_bg_pressed.9.png
etc....
I wait a reply from the dev for now ^^;
Click to expand...
Click to collapse
Try apktool 2.0. Or just do it on phone. I've modded stock lp ROMs w no problem using this - http://forum.xda-developers.com/sony-xperia-z1-compact/general/apktool-phone-t3230338
(latest version is 6.1, but I've had better success overall with 6.0.5. I can post a link if you need)

Same with apktool 2.0 or apktool android, already tried (always crash in libPNG error), but thanks for the tip!

Related

[Q] porting theme and trying battery circle mod - not working

Hi all
at the moment I'm trying to port a Theme from OpenDesire to Cyanogen RC2.
I got my framework-res.apk, replaced all those icons in there, that looks pretty nice. So that part worked.
Now I wanted to apply a battery circle mod to my theme but i'm stuck here.
I got apkmanager 4.8 and decompiled my already patched framework-res.apk to edit some xml files. I added the icons, i've put them into my public.xml, added some other xml files needed and now I'm trying to recompile that stuff. The tool produces an error about not declared images.
Looks like this here: drawable/zoom_plate declared here is not defined.
There are about 100 of these errors and these are no files I've touched.
I tried to decompile the original Cyanogen RC2, not even patched, framework, editing nothing and compiling again.. same error.
Am I missing something?
Solved.
Actually I confused my sources, after searching and editing I managed to get my theme working.
There were some files in the specified dir not mentioned in the public.xml, an some lines defining files not being there.
Had the idea after a break and a coffee

[Q for Theme development] Multiple lockscreens with JVS framework

Hello,
I always got Multiple lockscreen frameworks such as EDT and JKay's Lockscreens. I really want to know, actually where are these files located in framework-res..
I want to port EDT's JVR lockscreens to JVS framework.
Anybody willing to help me?
Regards,
Rahul
I'm quite interested in this too...and I guess that nobody will write us down a list with needed files .....I can tell you what I've found out so far and hope that it will be of any help to you.
The smali files for the lockscreen itself I think they should be in android.policy.jar
Then there also should be some changes in framework.jar which I do not know.
The ressource files like pictures etc are in the framework-res.apk
Then you also need the edt.apk in /system/app
Decompile the files with apkmanager/baksmali
Use a comparision tool like winmerge to see what files are added additionaly compared with the standard stock files. And also too see if there are smali changes in some files.
Good luck
Sent from my GT-I9000 using Tapatalk
why bother, they are not bug free anyways
$omator said:
why bother, they are not bug free anyways
Click to expand...
Click to collapse
You said that more than once now, but I sure as hell don't suffer any bugs while using them on JVQ or JVR.
While we're at it, I thought, hey, what the hell, I can learn and do it myself. Always good to learn this sort of thing. So I got smali/baksmali, winmerge, and Whitehawkx's source files, which I think will work.
But that's not the point.
The point is that baksmali is desassembling the .dex files just fine, but when I want to make a new file after merging the files from the sources with the originals of the .dex... It makes a .dex with the original files.
That is: disassemble -> merge the files -> I make sure the files are there. They are. -> I use smali, it creates the new .dex -> As everytime I do anything, I think, hey, lets disassemble the new file again to make sure the new files are there -> The files are not there.
It's driving me crazy... I mean, how the hell does it create a file from something that isn't there any more?
I can sort of get that the new files and folders don't make it to the new .dex (although, no, I don't get why would that be), but how can the overwritten files go back to be the original ones?
Seriously, driving me crazy.
Edit: Ok, nevermind what I said... The files change frigging places when smali assembles them...?
Edit2: Suprise, surprise, it didn't boot, but now I don't know if it's because I did something wrong or because the source files aren't good for JVS. I'm gonna try to do it on JVP, I'm curious now...
$omator said:
why bother, they are not bug free anyways
Click to expand...
Click to collapse
Well because some of them have features people want to have...and also because people can live with some of the bugs. I don't care if it writes me SIM-Card is locked even if it isn't. The functionality doesn't decrease because of that.
But well these lockscreens give us a music widget that works with other players then the crappy samsung stock one. And I can unlock directly to messages or phone. If it was for me I would only need something like the fourtab(which sadly has a memory leak)...but if the whole package could be ported or whatsoever and people would like to do it why not ?
Code is present in the android-policy.jar and framework.jar (for some lockscreens). You need to copy over the Smali Files fromt he MOD to the JVS framework and android policy. After that you need to copy over the drawables, layouts and other xml files to the framework apk of JVS and assign them each a unique resource ID. These resource IDs need to be substituted with the new values in the Smali files. Since the framework-res.apk changes with Firmwares, the Resource IDs are different for each framework.
It's very complicated stuff for rookies. You need to know which stuff to copy where and what modifications to make for specific lockscreens. And you need to use Logcat and do a lot of trial and error.
And $omator is right. Those lockscreens all together don't work perfectly due to conflicting code. For example, I made a SGS II Lockscreen Port http://forum.xda-developers.com/showthread.php?t=1070564 . The Same Lockscreen that is found along with 9 Lockscreen MOD is incomplete and doesn't work perfectly. I don't mean to say that the 9 lockscreen mod is useless, but It is very handly provided you compromise on what you get.
dhiru1602 said:
Code is present in the android-policy.jar and framework.jar (for some lockscreens). You need to copy over the Smali Files fromt he MOD to the JVS framework and android policy. After that you need to copy over the drawables, layouts and other xml files to the framework apk of JVS and assign them each a unique resource ID. These resource IDs need to be substituted with the new values in the Smali files. Since the framework-res.apk changes with Firmwares, the Resource IDs are different for each framework.
It's very complicated stuff for rookies. You need to know which stuff to copy where and what modifications to make for specific lockscreens. And you need to use Logcat and do a lot of trial and error.
And $omator is right. Those lockscreens all together don't work perfectly due to conflicting code. For example, I made a SGS II Lockscreen Port http://forum.xda-developers.com/showthread.php?t=1070564 . The Same Lockscreen that is found along with 9 Lockscreen MOD is incomplete and doesn't work perfectly. I don't mean to say that the 9 lockscreen mod is useless, but It is very handly provided you compromise on what you get.
Click to expand...
Click to collapse
Very complicated to do something like that from scratch, yes.
If at least one of the persons that have made a 9 lockscreen JVS rom posted the sources... From there I've learned by now that it's fairly easy to just include them into the files.
But no one have.
If you really want to learn how to do it i can only recommend read lots of info and do some investigations by yourself.
If some guy made the stuff for lets say XXJVQ then grab the files and compare them with the stock files. Decompile them with apkmanager. (jar files can also be modded this way, you only need to add .apk to the jar extention, and remove it later after compiling back)
This way you can see what files need to be added and what values need to be changed/added. First try to understand the process and after that make your own mods.
I used Winmerge for comparisation of the files.
Well... I modded the overscroll by myself. It's a start.
Thanks to Team Obssessed, we can already have multiple lockscreens on JVS.
I already made a theme as I like and added the lockscreens thanks to the files of this rom.
Now I can have a proper JVS .
Is just that I'm too used to puzzle and MIUI lockscreens to go back to stock or AOSP. And those two work without bugs, so... And don't know about the rest.
and btw. apkmanager got aapktool with outdated baksmali/smali ...

how to deodex Email.odex from our ICS stock ROM..?

how do you deodex email.odex?? i've downloaded java.awt.jar, i've loaded EVERY .jar and .odex from framework into the classpaths, also tried deodexing under different API, but still i get errors.
"could not resolve method in class :javax/mail/BodyPart; at index 19"
using baksmali 1.3.3
this **** is frustrating.
thanks for help

SOLVED: [Q] apktool compile error: need HELP

Hoping an "apktool" wizard can help me resolve a compile error driving me up a wall. I've been using apktool for past 6 months successfully making various system and data apk changes, but this one has me stumped. Experimenting with making a few simple color changes in my active Gmail v4.5.2 (inverted theme) apk. It successfully decompiles, but cannot recompile. To eliminate any of my changes, I started over and decompiled the Gmail apk... then immediately recompiled, but get the "No resource identifier found for attribute..." error (attached). I updated my JAVA and re-installed apktool... same issue. Anyone have guidance on what the issue might be? attaching screenshot of my CMD window commands in both WORD and PDF formats. Thx
EDIT: SOLVED I got it solved thanks to recognized themer "Ticklefish" in the UK. Turns out, the apk I was editing included 4.2 code (WidgetCategory)... and apktools could not handle this during recompile with my 4.1.2 framework. I just edited the 4 xml files which had the 4.2 code and removed those lines... made my theming edits... and it recompiled flawlessly. Then signed the apk and pushed to /system/app. If anyone else runs into similar apktool compile errors, this is why and how to resolve.

Which tool do you use to decompile and recompile framework-res.apk Lollipop?

Hello,
I need your help!!
I have been customizing my Galaxy Tab S, which I recently updated to Lollipop, and I have successfully customized SystemUI.apk, SecSettings.apk, etc. However, when I wanted just change a value in framework-res, I got many FC's. I cannot even open Settings.
So, I decompiled framework-res and recompiled it without changing anything. The result is the same. I got many FC's and not even the power button is working. And, I need to reflash original framework-res.
As I normally use Apk Multi-tool (with Apktool 2.2.2.), I tested Advanced Apktool (4.1.0). The result is the same and the recompiled framework-res is not usable.
What am I doing wrong? Maybe there is something special about this framework-res?
Maybe it is the version of Apktool? What is the version which works for framework-res?
Which tool do you use to work with framework-res from Galaxy Tab S (Lollipop)?
By the way, I did not have any problem with Kitkat framework-res from Galaxy Tab S. Neither did I with Lollipop framework-res for Galaxy Note 3.
Can someone help?

Categories

Resources