I got some XML troubles - Optimus One, P500, V Themes and Apps

I think i'm gonna need an exorcist. I'm trying to fix battery xml like this:
1.decompile w/ apkmanager
2.Navigate to /res/drawable and open with wordpad stat_sys_battery
3.Customize the file
4.Recompile
5.Flash.
But after flashed,i can't see battery icons in statusbar.
This is my untouched XML. I can see battery icons in statusbar.
Code:
This is my modded stat_sys_battery. With this one i can't see battery icons in statusbar.
Code:
What can it be?!?!?

Up.
Sent from my LG Optimus One P500 using Tapatalk

Did you delete the resources thing when recompiling? the only problem that I can see here is that the new battery pngs didn't get to be registered in the resources.xml(I'm not exactly sure with the name so) and so when the sys_stat_battery.xml calls for the pngs(it ask resources.xml if it was included and is part of the apk), resources.xml will reject the request and battery icon won't show up. Wasted almost a month of my life with the same problem before. Hope this helps.
There was someone(moderator) on the android theming thread who knows a lot about these stuff. Try asking there and post the results here.

So i only need to delete resources.arsc before compiling?
Sent from my LG Optimus One P500 using Tapatalk

I'm not doing any themes lately but if I remember it correctly, there's an instruction to delete resources.arsc on the temporary folder(can't remember the exact name) made by apkmanager whenever you modify an XML.

Related

battery mod

Hello,
I found this thread :
http://forum.xda-developers.com/showthread.php?t=765419
and I have some questions about this :
1) Is it possible to "tweak" our framework-res.apk with this battery mod.
2) Can I use this method to "tweak my framework-res.apk : http://circle.glx.nl/
3) When I download my new framework-res.apk, how to boot on recover mode on the phone to put the framework-res.apk on the system ?
4) Do you know an other easylier method to tweak icons on the HD2 under android ?
Thanks a lot !
+1 I asked myself to but no time to seach forum
@Karlichon
What is with this batmod? Are you done with them?
karlichon said:
1) Is it possible to "tweak" our framework-res.apk with this battery mod.
2) Can I use this method to "tweak my framework-res.apk : http://circle.glx.nl/
3) When I download my new framework-res.apk, how to boot on recover mode on the phone to put the framework-res.apk on the system ?
Thanks a lot !
Click to expand...
Click to collapse
Ok I think I'll answer this, but bear with me as it's NOT easy or for the faint of heart. If you read this and you DO NOT feel comfortable I would recommend you not giving this a go.
Before you start ANY of these steps below, MAKE SURE YOU BACKUP YOUR FILES BEFORE REPLACING THEM. I WILL NOT BE HELD RESPONSIBLE FOR ANY DAMAGE CAUSED FOLLOWING THESE STEPS! You have been warned.
1) Visit the website above and run through the steps to get the battery images you want. For the purposes of this tutorial/howto I am not covering how to change anything else (KISS: Keep It Simple, Stupid).
2) The easiest ones to change are the Version A-I ones, just choose which battery set would work best for you on your phone and click "Next"
3) Choose "Do not include icons" and click next. The icons it is talking about here are the signal, wifi, usb etc notification bar icons and as I mentioned I will not cover how to change those here.
4) Leave "Do not change notification status bar" selected and click next. Again I'm not covering that here.
5) You can choose a different boot anim if you want, they are very easy to upload to your phone and you can figure out where they have to be put yourself with no problems. IMPORTANT: If you do change the boot animation, make sure you choose the correct type of rom you have from the dropdown selection.
6) Upload your existing framework-res.apk (using something like DroidExplorer, navigate to /system/framework and paste it onto your desktop, then upload here). This will update the relevant files in your framework-res.apk automatically. (If you cannot obtain your existing framework-res.apk I cannot guarantee method 2 will work, sorry but feel free to try)
7) Replace your framework-res.apk (via DroidExplorer or your chosen ADB browser) on your phone and reboot. Voila!
This worked for me on shubcraft 2.0 drop mode but obviously I cannot guarantee it will work for everyone. Please remember my warnings above that this is not guranteed.
hello, thanks for your quick help, but it doesn't work for hyperdroid rom V1.7
any idea ?
karlichon said:
hello, thanks for your quick help, but it doesn't work for hyperdroid rom V1.7
any idea ?
Click to expand...
Click to collapse
there is another far more complicated way around it, but it really does take about half an hour to work out.
Basically, you need to get your framework-res.apk and extract it with winrar or something similar (an apk is basically just a zip file) and find the folder called res/drawable-HDPI. this is where all the icons for things like your battery icons live.
Copy and paste the new icons from someone elses framework-res or even one you download from the website above into this folder and replace the drawable-HDPI folder into your framework-res.apk, replace it onto your phone and reboot.
Again, this is a quick description of a much lengthier way of doing it but it does work. Also, my disclaimer in the post I made before still stands, do this AT YOUR OWN RISK and do NOT complain to me if something breaks. If you don't fully understand, don't do anything.
I tried the kitchen method, but I receive a huge error log after uploading the framework apk
is the page currently partly down?
rafpigna said:
I tried the kitchen method, but I receive a huge error log after uploading the framework apk
Click to expand...
Click to collapse
It doesn't seem to work all that well with frameworks from our current modded builds. I've tried it with a rooted desire framework (from my gf's desire) and that worked. Evidently all the work that the devs do on our hd2's make them very different to other android builds. the second method I posted (adding the png's to your existing framework) works perfectly.
BlackPit666 said:
is the page currently partly down?
Click to expand...
Click to collapse
Nope, seems up to me.
yes its up again
rafpigna said:
I tried the kitchen method, but I receive a huge error log after uploading the framework apk
Click to expand...
Click to collapse
for me the same, desirehd revolution rom of mdj
can anybody help me?
Reno_79 said:
there is another far more complicated way around it, but it really does take about half an hour to work out.
Basically, you need to get your framework-res.apk and extract it with winrar or something similar (an apk is basically just a zip file) and find the folder called res/drawable-HDPI. this is where all the icons for things like your battery icons live.
Copy and paste the new icons from someone elses framework-res or even one you download from the website above into this folder and replace the drawable-HDPI folder into your framework-res.apk, replace it onto your phone and reboot.
Again, this is a quick description of a much lengthier way of doing it but it does work. Also, my disclaimer in the post I made before still stands, do this AT YOUR OWN RISK and do NOT complain to me if something breaks. If you don't fully understand, don't do anything.
Click to expand...
Click to collapse
can you tell me which files i need to replace to get another battery icon? only the files which "batt" in it?
Reno_79 said:
there is another far more complicated way around it, but it really does take about half an hour to work out.
Basically, you need to get your framework-res.apk and extract it with winrar or something similar (an apk is basically just a zip file) and find the folder called res/drawable-HDPI. this is where all the icons for things like your battery icons live.
Copy and paste the new icons from someone elses framework-res or even one you download from the website above into this folder and replace the drawable-HDPI folder into your framework-res.apk, replace it onto your phone and reboot.
Again, this is a quick description of a much lengthier way of doing it but it does work. Also, my disclaimer in the post I made before still stands, do this AT YOUR OWN RISK and do NOT complain to me if something breaks. If you don't fully understand, don't do anything.
Click to expand...
Click to collapse
This method will not work with the battery icons which shows all 100% increments. This method will only work for the standard battery icons, which only involves like 12 battery icons.
In order to add the 1% increment readings in the battery, it involves modifying xml files to read and associate the correct battery icons at each increment.
can you give a tut how to add the version a manually?
nvm, I got it!

[REQ] Need help decompiling/recompiling framework-res.apk

Could someone help walk me through this? I've decompiled/recompiled plenty of apks, however the framework-res.apk is being relatively stubborn. After recompiling the apk I get force closes in random areas of settings, etc.
I use apktool (as I need to edit an xml file's value), to decode, then build.
Are there any random steps I'm missing?
I've tried this over and over to get the same results everytime.
Someone said it is because of corrupted xml, and if so how do I prevent the problem from happening?
Anyway, thanks in advance.
Check out the theme guides in epic themes and apps forum, grab apk manager, the op says to decompile and recompile without making any changes as some apks can just be problematic and error. But you should be able to edit xmls (no pngs! Drag and drop after!) And recompile with no prob, use like notepad++ as windows notepad adds junk characters tat cause issues too.
Sent from my SPH-D700 using Tapatalk

[Q] how do i remove the favorites icon that sits in the middle of the status bar?

You know that little white word bubble icon in the middle of the thinkpads status bar that you can set favorites to? How can I get rid of it? I am on a us thinkpads tablet that ha been rooted.
It's buried in a system file if you want to try to hack it & cook a new ROM for us. Wed' all be incredibly grateful!
I can provide some insight into this.
It's in the systemui.apk. I've removed the icon itself by making the images associated blank. That way i didnt have to decompile / recompile, however if you press that specific location, it'll still activate.
I can attach my hacked apk for 3.1 HC if you guys like.
Sent from my Lenovo Thinkpad using xda premium
I bet a lot of people would like it!
Let me get this right.... All you did was rename from .apk to .zip, unzip (assuming with 7zip), replace the graphic file, and rezip, un-rename, and it worked?
If that's the case, I'm going to try replacing all of those blasted bar graphics wherever they are with something at least grey. They burn out my eyeballs, especially when I have a screen filter on. Nandroid, here I come....
Yea, that's essential what I did. Just don't remove any of the files. You'll have to decompile and recompile for that.
I've attached my modified SystemUI.apk
rename to SystemUI.apk and push it to /system/apps/ and reboot
i recommend doing a fix permissions after pushing.
Sent from my Lenovo Thinkpad using xda premium

[Q] Tweaking Nexus 4 (SystemUI.apk/framework-res.apk)

Hi guys.
I am trying to tweak my phone by my self and was wondering about how to do it.
What I want to do is change the battery icon in the notification bar to show percentages. I know there's already a flashable mod available, but I wanted to use my own icons and to learn how to do the mods my self so that I can modify the phone more to my tastes my self. (You know, since I do own a nexus phone now) (Also, I completely agree with what efrant said in his post about knowing about how to do things yourself, not only how to use 1-click tools and ask people "Help!! I bricked my phone!!" without knowing what I did wrong..)
I used to own a galaxy s and had changed the battery icon there by modifying the framework-res.apk file, but when I downloaded the existing battery percentage mod, I found that the modder actually changed the SystemUI.apk file, so I'm kinda stumped.
The process I used to modify the galaxy s was:
- Uncompile the framework-res.apk using apkmanager
- Edit the /res/drawable/stat_sys_battery.xml and /res/drawable/stat_sys_battery_charge.xml files
- Put the new icons into /res/drawable-hdpi
- Recompile the apk to unsignedframework-res.apk
- Open both the original framework-res.apk and unsignedframework-res.apk and move the edited files and icons from framework-res.apk to unsignedframework-res.apk
- Copy /resources.arsc from unsignedframework-res.apk to framework-res.apk
- Done.
So to summarize, my question is: Is the process I used okay for the Nexus 4? If there are any differences what are they and what do I have to do.
Of course, I would be grateful if I could get a detailed guide to modifying the phone, since I'm kind of a noob when it comes to doing my own modifications.
bef0re y0u d0 that, can y0u share y0ur framework-res and SystemUI?? I want t0 m0d my htc desire....
sakithree said:
Hi guys.
I am trying to tweak my phone by my self and was wondering about how to do it.
What I want to do is change the battery icon in the notification bar to show percentages. I know there's already a flashable mod available, but I wanted to use my own icons and to learn how to do the mods my self so that I can modify the phone more to my tastes my self. (You know, since I do own a nexus phone now) (Also, I completely agree with what efrant said in his post about knowing about how to do things yourself, not only how to use 1-click tools and ask people "Help!! I bricked my phone!!" without knowing what I did wrong..)
I used to own a galaxy s and had changed the battery icon there by modifying the framework-res.apk file, but when I downloaded the existing battery percentage mod, I found that the modder actually changed the SystemUI.apk file, so I'm kinda stumped.
The process I used to modify the galaxy s was:
- Uncompile the framework-res.apk using apkmanager
- Edit the /res/drawable/stat_sys_battery.xml and /res/drawable/stat_sys_battery_charge.xml files
- Put the new icons into /res/drawable-hdpi
- Recompile the apk to unsignedframework-res.apk
- Open both the original framework-res.apk and unsignedframework-res.apk and move the edited files and icons from framework-res.apk to unsignedframework-res.apk
- Copy /resources.arsc from unsignedframework-res.apk to framework-res.apk
- Done.
So to summarize, my question is: Is the process I used okay for the Nexus 4? If there are any differences what are they and what do I have to do.
Of course, I would be grateful if I could get a detailed guide to modifying the phone, since I'm kind of a noob when it comes to doing my own modifications.
Click to expand...
Click to collapse
Sounds like it should still work. The only difference is the nexus uses xhdpi images, but the hdpi will still work as well.
Sent from my Nexus 4 using xda premium

Can't decompile SecSettings ApkTool

Hi
I try to decompile SecSettings by apktool and i get this:
Code:
C:\apktool>apktool d secsettings.apk SecSettings23
I: Baksmaling...
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources:
spec=0x7f020052 drawable/avatar_default_6, config=-hdpi
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:65)
at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:58)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:196)
at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:165
)
at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:130)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:10
5)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:82)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:48)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibRes
ources.java:315)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.jav
a:50)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.jav
a:43)
at brut.androlib.Androlib.getResTable(Androlib.java:44)
at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:148)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)
at brut.apktool.Main.cmdDecode(Main.java:128)
at brut.apktool.Main.main(Main.java:65)
What to do ??
Thanks
Please any help?
Same issue here
osherdadon said:
Please any help?
Click to expand...
Click to collapse
Using a Note 3 from T-Mobile, I pulled the file with the adb command, with root explorer, and extracted it from the stock ROM file all giving me the same error. For some reason I also don't get any smali files out of my SystemUI.apk which has been driving me crazy. I can't seem to find any working answers yet... Fail...
Basically bumping this thread a half a year later...
SOMEONE HELP US
You have the relevant frameworks installed and java in your path?
Learned a lot in 24 hours
DSA said:
You have the relevant frameworks installed and java in your path?
Click to expand...
Click to collapse
Summary/Lessons Learned in the last 24 hours:
I must have been too tired, went to sleep got up again and went at it. I realized a few things, main thing was deodexing, I learned all about that. Converting the .odex file to a class.dex file inside the SystemUI.apk and SecSettings.apk so decompiling would work properly (I was originally missing the smali folder without deodexing my app). Second I needed to pull all the framework files from my device instead of just the two I had, then I used "apktool if framework-res.apk" then "apktool if twframework-res.apk" then "apktool d SystemUI.apk" then "apktool d SecSettings.apk". This time it actually worked, I proceeded to try and re-compile them just to test. The SystemUI.apk worked flawlessly but the the SecSettings.apk had errors then I realized I needed to copy the AndroidManifest.xml and resources.arsc from the original app to the decompiled folder and the SecSettings.apk compiled with no issues. I had to get the original file out of the stock ROM, it had gotten damaged somehow with zipping/raring/7zipping so quicktip no one should be zipping the files you're about to work on get it fresh from the ROM.
Current Issue:
Now that all that's done I'm onto what I was trying to get at when I started this whole project. I need to modify both of these apps which are now perfectly deodexed and on my stock device. Every time I try to modify these files I lose my status bar and my settings stop working, I'm obviously breaking it, this is the XDA guide I was following.
Any help or redirection on where to post would be greatly appreciated, thanks
Easiest thing - put your mod back in and get the status bar to disappear/fc whatever
Then, pull a log (catalog from appstore works fine)
Post that log at pastebin and link it here
We won't be able to solve your issue without knowing what it is, in the first place
Like this?
This was before I restarted: Log 1
Then I recorded for a little after I restarted probably pointless but that's where the error would have been: Log 2
DSA said:
Easiest thing - put your mod back in and get the status bar to disappear/fc whatever
Then, pull a log (catalog from appstore works fine)
Post that log at pastebin and link it here
We won't be able to solve your issue without knowing what it is, in the first place
Click to expand...
Click to collapse
Not sure exactly how to record it and send it to you, I pressed record but when the phone finished rebooting CatLog was closed so I reopened it and it keeps scrolling endlessly.
Research progressed a little
I came across a post here in the Flashlight Mod development thread which made me realize I'm not getting the ID's correct. They suggest compiling the modded SystemUI.apk to get the ID's into the apk file under the /res/values/public.xml file, then decompiling it to read the ID values. I'm missing a step or doing something wrong, I can't replicate it to find the ID values I need so I can add them to the .smali file and recompile a final time. I'm sure this is the only reason for the missing status bar and the force closes. I guess I need help understanding, a different set of instructions or just more detailed?
I can't post in that thread yet so I'm getting my posts up over here, I already posted in the Q&A thread but no one has responded yet, any help is greatly appreciated!
I get this when decompiling the modded apk: Modded SystemUI ApkTool Decompile
All these errors look like the file is broken now or something, I'm just lost at this point. I tried ApkTool 1.5.2 and 2.0 as well.
EDIT:
Additional info below for troubleshooting purposes since it seems my issue recompiling at the end to get the values for my public.xml
STEPS:
1. deodex (universal deodexer v5)
2. decompile (apktool 1.5.2 & 2.0 separate tests)
3. modify (add flashlight .png's and .smali file from 4.4kk flashlight mod files)
4. recompile (apktool)
5. decompile (apktool)
=
Errors <<<<< These errors solved in edit below
EDIT:
I forgot to use "apktool if SystemUI.apk" when loading "framework-res.apk" & "twframework-res.apk" now I get through decompiling and recompiling like I thought I should be and I even located the values int he public.xml, replaced them in the .smali and everything went peachy. Only problem is I never get the status bar after I reboot, not really getting any FC's but the status bar, if my goal were to get it to be invisible I would be so happy omg lol If you're curious I've also tested by signing and even another test with zipalign, nothing zip/zero/zilch...
EDIT... Again I know still no sleep, durp durp:
So my main issue was not using apktool v1.5.2 to decompile and v2.0 to compile EVERY SINGLE TIME, NO EXCEPTIONS. When I followed that simple rule I get it onto my device and she has no status bar... Hmmmmm..... And a logcat for anyone smart enough to help me
EDIT:
Maybe I'm in the right direction with an error I saw in the log at this post? I thought it was so I installed the DisableSignatureVerification Mod from the Xposed Modules and still nothing.
Calling All Developers
It's been like 2 weeks just curious if anyone has even looked at this, I haven't been able to make any progress so I started learning how to develop apps. I made two small apps basic flashlight and a counter app but I really want to know why I'm totally unable to mod a file on my phone. I can't get the ink effect to work with finger input either I've been really trying to get this flashlight mod and the ink effect for months. If I could get pointed in the direction of a developer that can actually help me I don't see why I couldn't donate like $10 or $20 to the one who helps me. I'm on android 4.4.2 (NK3) on my Note 3 from T-Mobile.

Categories

Resources