Editing XML in framework-Res.apk? - Samsung Galaxy Player 4.0, 5.0

Okay, I have been trying to change the sliders color and size by editing XML in framework-Res.apk. I set up APKmanager 5.0.2, installed the framework files, and decompiled the apk all flawlessly (I think). I then edited "progress_horizontal.xml" found in /Res/drawable/ and also edited "styles.xml" found in /Res/values/. I then recompiled and selected yes to the option to copy unedited files to reduce errors, and of course followed the instructions to delete the edited files in the "keep" folder. I continued recompiling and it finished with no errors. I then used the apk manager option to sign it, and then I copied onto my player. It booted without bootloop (surprisingly) but after it loads, framework-Res, followed by almost every system app fcs. Any ideas as to what I am doing wrong?
While I'm on this topic, does anyone know what lines to edit in strings.xml to change the width of seek bars (ex. the brightness slider in display settings)?
Sent using Tapatalk

Did you sign the apk file with the original signature?
Sent by my Robot Butler

Umm, idk. I just used the "sign" option in apk manager after I compiled it.
Sent using Tapatalk

Okay, it seems to have had a more permanent effect than I thought. I replaced it with my old framework-Res, but when I try downloading an app from the market it fcs when it tries to install. Anyone ever have similar problems?
Sent using Tapatalk

Alright, a reinstall of the market solved that, but I am still trying to figure out what I am doing wrong. If I took the xmls from my compiled unsigned apk, and used 7zip to put them in the original apk, would that work?
Sent using Tapatalk

iJimaniac said:
Alright, a reinstall of the market solved that, but I am still trying to figure out what I am doing wrong. If I took the xmls from my compiled unsigned apk, and used 7zip to put them in the original apk, would that work?
Sent using Tapatalk
Click to expand...
Click to collapse
You cannot see the XMLs in 7zip. Try copying the resources.arsc file
Sent by my Robot Butler

exacly, you have to decompile to open properly xmls.

KOala888 said:
exacly, you have to decompile to open properly xmls.
Click to expand...
Click to collapse
Yes, I know that, but I mean after I edit and recompile.
Sent using Tapatalk

Your not supposed to sign framework-res.apk
Sent from my ASUS Transformer Pad TF300T using Tapatalk 2

Okay, so will the unsigned version work correctly?
Sent using Tapatalk

gmillz said:
Your not supposed to sign framework-res.apk
Sent from my ASUS Transformer Pad TF300T using Tapatalk 2
Click to expand...
Click to collapse
You must sign it with the original signature or you will be bootlooping
Sent by my Robot Butler

I never sign any system apks and it always works.. If I sign them then I bootloop
Sent from my SAMSUNG-SGH-I727 using Tapatalk 2

gmillz said:
I never sign any system apks and it always works.. If I sign them then I bootloop
Sent from my SAMSUNG-SGH-I727 using Tapatalk 2
Click to expand...
Click to collapse
It depends on which tool you use to decompile it. Some don't remove the signature but some do. If the tool does remove the original signature then you need to sign it again with the correct signature.

So how do I sign it with the correct signature?
Sent using Tapatalk

iJimaniac said:
So how do I sign it with the correct signature?
Sent using Tapatalk
Click to expand...
Click to collapse
There is a guide here on xda on how to create your own ics style settings. Its basically a guide on how to edit XML files and recompile and resign the apk file. I'll add the link to the thread when I get to my laptop
Sent by my Robot Butler

Okay, I found the tutorial you are talking about, and have been experimenting on lidroid-res.apk (less fatal if I mess up). However, I am still having issues. I decompile with apkmanager, then edit strings.xml with notepad++ (nothing big, just changing the text of the status bar toggles). I recompile, and follow his steps to put resources.arsc into the original apk. I push it to system/framework/ with root explorer and reboot. I then get a fc from systemUI and no status bar up top. Am I missing something?
Sent using Tapatalk

iJimaniac said:
Okay, I found the tutorial you are talking about, and have been experimenting on lidroid-res.apk (less fatal if I mess up). However, I am still having issues. I decompile with apkmanager, then edit strings.xml with notepad++ (nothing big, just changing the text of the status bar toggles). I recompile, and follow his steps to put resources.arsc into the original apk. I push it to system/framework/ with root explorer and reboot. I then get a fc from systemUI and no status bar up top. Am I missing something?
Sent using Tapatalk
Click to expand...
Click to collapse
Sorry I totally forgot to post the link . I would recommend using apktool as it makes the tutorial easier to follow. Also I think its easier to use but that's just personal preferance. I don't know why it doesn't work. My advice is to redo the entire process using apktool and see if it makes a difference. I hope it works

Hmm, tried apktool, same result. One thing I saw when recompiling it was it said "could not find sources" but it continued normally with no other errors. I will try to see if it works on a different PC, since mine often has weird problems like this.
Sent using Tapatalk

iJimaniac said:
Hmm, tried apktool, same result. One thing I saw when recompiling it was it said "could not find sources" but it continued normally with no other errors. I will try to see if it works on a different PC, since mine often has weird problems like this.
Sent using Tapatalk
Click to expand...
Click to collapse
Try using apktool to decompile the apk and then see if you can recompile it without any errors. If you do get errors then something is going wrong...

Supermaster34 said:
Try using apktool to decompile the apk and then see if you can recompile it without any errors. If you do get errors then something is going wrong...
Click to expand...
Click to collapse
Well, I did it, no errors, just the "could not find sources" witch I read was normal for some system apks. I tried the compiled app but it still gives me fcs. I will let you know if I have better luck with my xp desktop.
Sent using Tapatalk

Related

[HOW TO] CRT-Effect only

This is just the plain CRT effect. No custom roms, no pre-made files or anything. (You need root)
I've searched for this on XDA, Google, other forums etc. but I couldn't find it.
It always showed up ROMs including this feature, not the actual feature itself
DO A BACKUP BEFORE EDITING ANY FILES!
Also, you need root
1. Pull framework-res.apk from the /system/framework/ folder via ADB (Alternate way below*)
2. Decompile framework-res.apk with APKTool/APK Manager (Whatever you prefer..)
3. Navigate to /res/values/ and open the bools.xml file with Notepad++ (Notepad works too )
4. Search for "config_animateScreenLights" and change the "true" to "false".
5. Save, and compile the file. Open the fresh-compiled file and copy resources.arsc to the original apk. (Overwrite the existing one)
Click to expand...
Click to collapse
Transfer the framework-res.apk file back to your phone, and then switch it with the original one
You must reboot to make it work!
*If you don't know how to push/pull files via adb, you can use Root Explorer and copy it to the /sdcard/ folder, then transfer it to your PC.
If you switch it back with root explorer, programs will start to force close. Just reboot and you'll be fine
Click to expand...
Click to collapse
CWM Flashable template
Use the attachment below as a template for flashing with CWM.
Open the .zip file, and place your framework-res.apk in system/framework/
Then extract it to your phone and flash it
Click to expand...
Click to collapse
Thank you very much, Worked
tried it on KF2
Don't forget to share what you make mentioning what fw it is from
Sent from my GT-I9100 using XDA App
Rawat said:
Don't forget to share what you make mentioning what fw it is from
Sent from my GT-I9100 using XDA App
Click to expand...
Click to collapse
Doesn't matter, it's integrated in every Android 2.3 devices.
Sent from my GT-I9100 using XDA App
thanks for this, could you possibly make a similar "how to" for the overscroll glow effect?? Been searching everywhere and can't find a simple guide
viva.fidel said:
thanks for this, could you possibly make a similar "how to" for the overscroll glow effect?? Been searching everywhere and can't find a simple guide
Click to expand...
Click to collapse
I'll see what I can do
Edit: Looks like there's something wrong with my firmware.. I don't have a classes.dex files within framework.jar
And it's hell of a process to do it, so I might have to re-concider this :/
Edit 2: I dont have a deodexed rom, and when I try to deodex it, it fails
Is the Pixelbug still there?
Sent from my GT-I9100 using XDA App
i think metamorph app supports editing system files... can u make a compatible zip?
DooMLoRD said:
can u make a compatible zip?
Click to expand...
Click to collapse
Sorry, I'm waaaaay to lazy to create a zip compatible for every single firmware out there. I can't take a framework file from KE2 and think it works on a phone with KF3..
fuzzl said:
Is the Pixelbug still there?
Sent from my GT-I9100 using XDA App
Click to expand...
Click to collapse
Pixelbug?
No idea what that is, but I can't see any pixels being stuck or anything.
Thanks, but...
Would you like to explain step 5 a bit further? I'm a bit confused. I'm using apk manager and it asks me a bunch of things and you don't tell me where to overwrite the arsc-file, etc.
sackynuts said:
Thanks, but...
Would you like to explain step 5 a bit further? I'm a bit confused. I'm using apk manager and it asks me a bunch of things and you don't tell me where to overwrite the arsc-file, etc.
Click to expand...
Click to collapse
Ah, so sorry.
Open the original framework-res with WinRar. And do the same with the modified. In there you'll see the resources.arsc file
If you don't know how to use APK Manager, use google.
Not trying to be rude, I'm just in a little hurry
I'll ask a mod later if he can move on of my posts up, and then I can perhaps create a more user friendly guide
Sent from my GT-I9100 using XDA App
bruflot said:
I'll see what I can do
Edit: Looks like there's something wrong with my firmware.. I don't have a classes.dex files within framework.jar
And it's hell of a process to do it, so I might have to re-concider this :/
Click to expand...
Click to collapse
No worries, thanks for having a look though
Sent from my GT-I9100 using XDA App
viva.fidel said:
No worries, thanks for having a look though
Sent from my GT-I9100 using XDA App
Click to expand...
Click to collapse
Well, I can take a further look, but only if you upload your framework.jar file and then send it to me.
Sent from my GT-I9100 using XDA App
bruflot said:
Doesn't matter, it's integrated in every Android 2.3 devices.
Sent from my GT-I9100 using XDA App
Click to expand...
Click to collapse
I read your thread, and know what you posted.
What I'm saying is that if someone makes the anim for example KF3, it would only take a few seconds to upload so other people could use, while diy CRT anim takes at least 5 mins even if you know what you're doing.
bruflot said:
I have always liked the CRT effect, but it got kinda annoying to always have a custom ROM installed to have it (I prefer stock ROMs )
I've searched for this on XDA, Google, other forums etc. but I couldn't find it.
It always showed up ROMs including this feature, not the actual feature itself
DO A BACKUP BEFORE EDITING ANY FILES!
Transfer the framework-res.apk file back to your phone, and then switch it with the original one
You must reboot to make it work!
I don't know the adb commands for switching the system files, so if anyone could tell them to me?
Sent from my GT-I9100 using XDA App
Click to expand...
Click to collapse
So to send a file to system in adb I used
Code:
abd push (new apk with mods) /sdcard // used to temp move it
adb shell
su
mount -o remount,rw /system
mv /sdcard/framework-res.apk /system/framework/framework-res.apk
Is that what you were asking?
bruflot said:
Well, I can take a further look, but only if you upload your framework.jar file and then send it to me.
Sent from my GT-I9100 using XDA App
Click to expand...
Click to collapse
That I can do no problem, appreciate you willing to look into this, used to have CM7 on my old HTC Desire and missing the overscroll effect! The only how-to thread on this I could find was [MOD][PORT][04-16] Android 2.3 Overscroll Glow MOD for Galaxy S I9000 (Gingerbread) but it's only for specific SGS firmwares, might be of some help to you still
Hmm...I don't have a res/values folder (just res, there is no values). There is also no Books.xml anywhere in the apk. I'm on stock rooted KE7...Is the value somewhere else on my version? Am I doing something wrong?
TheSopranos16 said:
Hmm...I don't have a res/values folder (just res, there is no values). There is also no Books.xml anywhere in the apk. I'm on stock rooted KE7...Is the value somewhere else on my version? Am I doing something wrong?
Click to expand...
Click to collapse
And you decompiled it right? I know i you were to just open the apk it would have a res but not res/values.
I followed the instructions ... and used APK Manager, I complied, signed, and before i quit it asked me to delete a file...resources.arsc
do i have to do that?
also, i noticed the APK Manager made signed apk of less size as compared to original file
original apk file size = 8.05 mb
complied, signed apk = 5.16 mb
is that normal?
infra4800 said:
I followed the instructions ... and used APK Manager, I complied, signed, and before i quit it asked me to delete a file...resources.arsc
do i have to do that?
also, i noticed the APK Manager made signed apk of less size as compared to original file
original apk file size = 8.05 mb
complied, signed apk = 5.16 mb
is that normal?
Click to expand...
Click to collapse
yeh same thing happend to mine, works fine though also use LCD Density to change the DPI to 240 to get rid of the pixelated crt animation

[Q] How to properly recompile the framework-res.apk?

I have tried using the APK Manager,
Problem: If I recompile the framework-res.apk, it always gives me loops...
Even if I make a very small change!
(I don't sign it!)
Images can be replaced by opening it in 7-zip but xml files can't be changed that way.
I'm 100% sure that I follow correct steps....
What I'm trying to do:
Power menu: http://forum.xda-developers.com/showthread.php?t=1169443
and
ICS transitions: http://forum.xda-developers.com/showthread.php?t=1343350
I have followed more then 10 threads with same problem but still didn't get a solution.
Sorry if I missed something.
Any help?
*BUMP*
Why don't u sign it?
Sent from my SCH-I400 using xda premium
AFAIK, we don't have to sign a system apk using APK Manager (specially the framework-res.apk)
P.S. The guide (http://forum.xda-developers.com/showthread.php?t=1169443) also states so...
Try to use APKTool, I used to compile it and decompile it with this application and it works fine
Oic. I've always signed my frameworks. Ill not from now on.
Sent from my SCH-I400 using xda premium
Apktool has worked for me in past, haven't tried for a couple of months though so not sure what Rom I was playing with... Oh and unsigned for me
Sent from my Desire HD using xda premium
Use apktool....put the frameowrk-res.apk in the same folder as the apktool u unpacked....then open command prompt and navigate to that folder....type "apktool if framework-res.apk"...that will install the framework...then when that finishes type " apktool d framework-res.apk ./out"...that will decompile the apk into the out folder you just created....make your changes then type..."apktool d -f -b framework-res out" that will recompile....when your finished you have to copy the original metainf folder into the newly recompiled apk....then copy the new classes.dex file into the new apk...done...hope that helped
Sent from my SAMSUNG-SGH-I997 using xda premium

What am I doing wrong? apktool?

I have been building ROMs for a while but I have been relying on other peoples bases (a big thank you to everybody for all your efforts). I have managed to edit some .apk files by opening them with WinRar and just replacing files (images etc). I now need to get a bit deeper and want to edit framework-res.apk but I just can't get it to work
Right now I have wiped and reinstalled Windows 7 Ultimate SP1 x86 on a Dell Optiplex GX270. I have let windows update do its thing and it is all up to date. I have no AV software installed. I have installed Sun JDK 6 update 32. I have installed the Android SDK and this has updated itself to Rev. 19 and installed the latest Android 4.0.3 API. I have installed the apktool using the instructions from here - http://code.google.com/p/android-apktool/. I have pulled the framework-res.apk from the phone, installed it with 'apktool if framework-res.apk' and then decompiled it with 'apktool d framework-res.apk framwork-res'. I then edited the bools.xml file using notepad++ and then recompiled with 'apktool b framework-res unsigned-framework-res.apk'. I then renamed the file and pushed it to /system/framework on the device. And its now in a boot loop
What am I doing wrong?
Andy
Use APK MULTI TOOL.
Sent from my GT-I9300 using Tapatalk 2
winrar?you can edit an app that way...but it's much better using 7zip
Sent from my MB860 using XDA
Kev_cr said:
winrar?you can edit an app that way...but it's much better using 7zip
Sent from my MB860 using XDA
Click to expand...
Click to collapse
Yes I know. My issue is with recompiling .apks though - specifically framework-res.apk and the resources.arsc it contains....
Andy
ADB100 said:
Yes I know. My issue is with recompiling .apks though - specifically framework-res.apk and the resources.arsc it contains....
Andy
Click to expand...
Click to collapse
well take everything inside from the new apk except the androidmanifest. i believe and copy it over to the old apk see if that works.
From my powered Shooter.
Easier thing to do is take the meta-info and manifest from the original apk and copy it over the new apk using an archive manager.
However I've found that if its bootlooping then I've usually missed something out.
私はローボーボブ。 Haro!!

Systemui.apk

Is it necassary to sign systemui.apk? I made some changes to the file and now when i flash the ROM I get systemui force closes
Sent from my PG86100 using xda app-developers app
kevin130 said:
Is it necassary to sign systemui.apk? I made some changes to the file and now when i flash the ROM I get systemui force closes
Sent from my PG86100 using xda app-developers app
Click to expand...
Click to collapse
No, you don't ever want to sign system apps. Are you sure the permissions are correct? and what changes did you make?
I didn't put any permissions. How do I set them in the zip? And I change the 3g icon to 4g because I have virgin mobile so I can't get 4g but I want it to say 4g lol.
Sent from my PG86100 using xda app-developers app
Well if you are installing it with a zip permissions are probably correct. I'm assuming you decompiled the apk changed the icon and compiled it again? If all you want to do is change an icon, just open the apk with 7zip or similar and replace the icon, no need to decompile. That should solve it. Let me know
Okay. I'll try that and if I do decompile it, how do I set the permissions? Cuz i decompiled settings.apk and made a XML change.
Sent from my PG86100 using xda app-developers app
kevin130 said:
Okay. I'll try that and if I do decompile it, how do I set the permissions? Cuz i decompiled settings.apk and made a XML change.
Sent from my PG86100 using xda app-developers app
Click to expand...
Click to collapse
You would set permissions if you are just pushing the apk to your phone. Better question, how exactly are you installing the apk after you made the changes?
I just replace the old apk in the zip file and flash the ROM.
Sent from my PG86100 using xda app-developers app
ok, then the updater-script in the zip is handling the permissions for you, so you don't need to worry about that.
So there is no need to sign anything at all? Awesome.
Sent from my PG86100 using xda app-developers app
Apps in /system/app/ never get singed, apps in /data/app/ however have to be signed.
Alright. Thanks.
Sent from my PG86100 using xda app-developers app
Android commander... http://androidcommander.com/
great tool you should use when first dealing with androids..
you can delete/pull/push files to your phone there also apk backup which backs up your apps from the play store.. just a great program to have in your PC.
no problem, let me know if you still need help or get it working
Hi I'm also trying to learn modifying systemUI.apk through smali edits
So as a start I just decompiled my systemUI.apk with apktool v1.5.2 with no errors. Then directly recompiled it. No modifications made. The resulting apk didnt have any META-INF folder and thus I suppose is unsigned. But pushing this apk to /system/app doesn't install it.. As a result after reboot I have no installed systemUI.apk
What am I doing wrong? BTW I'm on Sony xperia live with walkman. But I suppose this is a general thing. And yes I have installed all framework files and as a result no errors while de/recompiling
havocgb said:
Hi I'm also trying to learn modifying systemUI.apk through smali edits
So as a start I just decompiled my systemUI.apk with apktool v1.5.2 with no errors. Then directly recompiled it. No modifications made. The resulting apk didnt have any META-INF folder and thus I suppose is unsigned. But pushing this apk to /system/app doesn't install it.. As a result after reboot I have no installed systemUI.apk
What am I doing wrong? BTW I'm on Sony xperia live with walkman. But I suppose this is a general thing. And yes I have installed all framework files and as a result no errors while de/recompiling
Click to expand...
Click to collapse
The best way in case of small edits is to open both your stock and your modified SystemUI.apk with 7-zip, then copy the META-INF and AndroidManifest.xml from the stock to the modded one.
Close both and push back your modded one to the phone.
Guess that work.
pquinqu said:
The best way in case of small edits is to open both your stock and your modified SystemUI.apk with 7-zip, then copy the META-INF and AndroidManifest.xml from the stock to the modded one.
Close both and push back your modded one to the phone.
Guess that work.
Click to expand...
Click to collapse
Well now I use APK Multi-Tool and it works great. From what I have understood it keeps the same signatures as in the original SystemUI.apk and there is no need of any resigning.

[Q] Zip to APK issue

I just download MMOJ game, and wanted to make some changes for fun. I changed file extension from .APK to .Zip, unzip the file, modfied a .lua file, zip the files, and changed the extension back to .apk. Then, I tried to install the game, and then I receive "Parsing Error". What did I do wrong? As you can tell, I don't have a good programming skill, so when providing answers, please be as detail as possible, so any new comers can understand the explanation and solutions.
Thank you.
You need to find a program to properly de/recompile for you, search out apktool as one of many options, there will surely be instructions as well in you searches
Sent from my Nexus 4 using Tapatalk 2
demkantor said:
You need to find a program to properly de/recompile for you, search out apktool as one of many options, there will surely be instructions as well in you searches
Sent from my Nexus 4 using Tapatalk 2
Click to expand...
Click to collapse
Thanks for the reply. Because many people said that I can change .apk to zip and back to .apk, I thought de/recompile program was unnecessary. I will try a program. Any recommendation? Preferably free?
Depending on what you do yes you can unzip do somethings then rezip, but for most changes it needs to be decompiled, I usually use apktool, initially made by brut.all but has been updated by others, right now I believe version 3 is the latest
Sent from my Nexus 4 using Tapatalk 2
demkantor said:
Depending on what you do yes you can unzip do somethings then rezip, but for most changes it needs to be decompiled, I usually use apktool, initially made by brut.all but has been updated by others, right now I believe version 3 is the latest
Sent from my Nexus 4 using Tapatalk 2
Click to expand...
Click to collapse
I tried apktool, but after extracting the folder AndroidApktool in C:\ and put the .apk file I want to modify along with framework-res.apk, AndroidApktool.exe does not start. It gives an error. Is my PC language setting as Korean a problem, do you think?
Once changed from a zip to an apk after being modified.the apk usually needs to be resigned before attempting to reinstall again.
Sent from my SGH-T889 using Tapatalk 4
Um, did you open cmd/terminal and tell it to decompile?
apktool d xxx.apk
Or what do you mean by it doesn't start?
Sent from my Nexus 4 using Tapatalk 2
hasbrobot said:
Once changed from a zip to an apk after being modified.the apk usually needs to be resigned before attempting to reinstall again.
Sent from my SGH-T889 using Tapatalk 4
Click to expand...
Click to collapse
Does that mean if I can get a program that re-signs the .apk, I can install the modified .apk?
demkantor said:
Um, did you open cmd/terminal and tell it to decompile?
apktool d xxx.apk
Or what do you mean by it doesn't start?
Sent from my Nexus 4 using Tapatalk 2
Click to expand...
Click to collapse
No, I did not use the command line apktool d xxx.apk. I may have to read how-to.txt to understand how to execute the file. Because apktool was an executable file, I thought double clicking would start the program with graphical user interface waiting for further input from the user.
u can unzip apk to .zip, but not rebuild file .zip to apk if you're not use tool. It'll not compiler.

Categories

Resources