Re-Compile Framework-res.apk = Bootloop - Android Software/Hacking General [Developers Only]

Helo, sry for noobish thread but i can's solve my problem. This method allways work for me using Zte blade. But now on Xperia Arc it doesn't.
Im trying to change somethink in framework (values) , but first i try to re-compile framework to check. And what ? i got bootloop.
Im using
ApkMultiTool 1.0.6
ApkManager 5.0.2
apktool.jar
signapk.jar
First i decompile this clean stock framework (o errors), then i try to compile (0 errors, no changes inside framework) and i got bootloop.I sign new framework and put it in my rom zip file. Then i try to make it manualy, so i run ms command line :
java -jar apktool.jar d framework-res.apk
java -jar apktool.jar b framework-res.apk
Then Sign manualy :
java -jar signapk.jar certificate.pem key.pk8 framework-res.apk signedframewok-res.apk
AND ? BOOTLOOP :////////////////////

same prob
OmenHTX said:
Helo, sry for noobish thread but i can's solve my problem. This method allways work for me using Zte blade. But now on Xperia Arc it doesn't.
Im trying to change somethink in framework (values) , but first i try to re-compile framework to check. And what ? i got bootloop.
Im using
ApkMultiTool 1.0.6
ApkManager 5.0.2
apktool.jar
signapk.jar
First i decompile this clean stock framework (o errors), then i try to compile (0 errors, no changes inside framework) and i got bootloop.I sign new framework and put it in my rom zip file. Then i try to make it manualy, so i run ms command line :
java -jar apktool.jar d framework-res.apk
java -jar apktool.jar b framework-res.apk
Then Sign manualy :
java -jar signapk.jar certificate.pem key.pk8 framework-res.apk signedframewok-res.apk
AND ? BOOTLOOP :////////////////////
Click to expand...
Click to collapse
same prob here too happening.....i cant able to change theme....!!

Before decompiling you mmust install the .apk use this command:
Cd C:/.. navigate to your framework-res.apk
Once you in the folder where it is located use this command to 1)install:
Apktool if framework-res.apk
2)Decompile:
Apktool d framework-res.apk
3)Recompile:
Apktool b framework-res
4) new .apk is in .../framework-res/dist/
I think you forgot to install the .apk
Sent from my GT-I9001 using xda app-developers app

Diablob555 said:
Before decompiling you mmust install the .apk use this command:
Cd C:/.. navigate to your framework-res.apk
Once you in the folder where it is located use this command to 1)install:
Apktool if framework-res.apk
2)Decompile:
Apktool d framework-res.apk
3)Recompile:
Apktool b framework-res
4) new .apk is in .../framework-res/dist/
I think you forgot to install the .apk
Sent from my GT-I9001 using xda app-developers app
Click to expand...
Click to collapse
If he didn't install the apk, he wouldn't be able to not even decompile correctly.
OP: I also have this problem, but from what I read, after you recompile, you need to open the new and the old apk with WinRar or 7-Zip, copy the resources.src (or something like that) from the original framework-res.apk to the modified framework-res.apk. I read that this should do the job. I'm going to try that myself later when I get home. Good luck for you.
Sent from my LT26i with Tapatalk 2

You shouldn't sign any system apks, instead just copy over the META-INF folder and AndroidManifest.xml from original framework-res.apk to the newly compiled one.

kong said:
You shouldn't sign any system apks, instead just copy over the META-INF folder and AndroidManifest.xml from original framework-res.apk to the newly compiled one.
Click to expand...
Click to collapse
This simple comment of yours gave peace to my soul... THANK YOU SO MUCH!!!!!!
:laugh::laugh::laugh::laugh::victory::victory::good::good::good:

Great solution !!!!

kong said:
You shouldn't sign any system apks, instead just copy over the META-INF folder and AndroidManifest.xml from original framework-res.apk to the newly compiled one.
Click to expand...
Click to collapse
sorry for a 6 month later post, but i'm having the same problem and this solution isn't making sense to me..
edit: holy **** it worked
i compile first, I just drag them into the newly compiled apk
thank you!

eris72 said:
sorry for a 6 month later post, but i'm having the same problem and this solution isn't making sense to me..
edit: holy **** it worked
i compile first, I just drag them into the newly compiled apk
thank you!
Click to expand...
Click to collapse
For me it is not working. My phone keeps looping after rebooting it.
I tried with 7zip and winrar and it is not working.
1.- Decompile with apktool1.4.2
2.- Compile with apktool1.4.3 (in this step i was editing eri.xml I need to edit this file, but also without editing this file I have the same result)
3.- Drag the META-INF and AndroidManifest.xml from the original apk to the newly created one with 7zip(also tried with winrar)
4.- push the file to the phone (system/framework)
Actually right after pushing it I get an error message saying Unfortunately, C has stopped.
What am I missing?

Did you fix permissions before pushing back to system/framework

dutchmaster18 said:
Did you fix permissions before pushing back to system/framework
Click to expand...
Click to collapse
I decompiled and compiled, both processes with the latest version and that solved my problem

kong said:
You shouldn't sign any system apks, instead just copy over the META-INF folder and AndroidManifest.xml from original framework-res.apk to the newly compiled one.
Click to expand...
Click to collapse
really thank you worked for me!!!!

Helped........
kong said:
You shouldn't sign any system apks, instead just copy over the META-INF folder and AndroidManifest.xml from original framework-res.apk to the newly compiled one.
Click to expand...
Click to collapse
Thank you...it helped me to overcome a problem i was unable to solve....thank u very much...:good::good::good::good::good::good:

kong said:
You shouldn't sign any system apks, instead just copy over the META-INF folder and AndroidManifest.xml from original framework-res.apk to the newly compiled one.
Click to expand...
Click to collapse
Four years later and you're still saving frustrated XDA'ers.
Thank you!
Five hours of Googling and I finally have success.
Anyone know of a quicker workaround?

framework-res re/compile, push to phone
Hi have the problem with bootloop after overwrite framework-res.apk to /system/framework
use apktool2.2.2
phone note 3 with phronesis rom
I made
1.apktool if framework-res.apk (0 error)
2. decompile apktool d framework-res.apk (0 errors)
3. changed color.xml and styles.xml (only changed color text)
4. from orginal framework-res.apk drag resources.arsc to decompiled folder
5.make re-compile (apktool b framework-res) (0 errors) after this, program created new folder BUILD and DIST, in /build/apk/is META-INF, android manifest,RES folder and resources.arsc
Now i tried ( with tutorials ) drag from orginal framework-res.apk, folder META-INF, AndroidManifest.xml to BUILD folder and recompile second time (0 errors) then, from DIST folder i took framework-res.apk and overwrite to phone/system/framework and reboot = bootloop
Also trying after 1st re-compile, drag META-INF and androidmanifest.xml from orginal framework-res to newly recomplied framework-res.apk in DIST folder, again overwrite in phone/system/framework but still bootloop
before overwrite make permission rw-r--r- the same permisson of orginal framework-res.apk
then overwrited my apps example touchwiz, google play has stopped, reboot but unfortunately booloop
Any solution? ^^ thx

DrMalaN said:
framework-res re/compile, push to phone
Hi have the problem with bootloop after overwrite framework-res.apk to /system/framework
use apktool2.2.2
phone note 3 with phronesis rom
I made
1.apktool if framework-res.apk (0 error)
2. decompile apktool d framework-res.apk (0 errors)
3. changed color.xml and styles.xml (only changed color text)
4. from orginal framework-res.apk drag resources.arsc to decompiled folder
5.make re-compile (apktool b framework-res) (0 errors) after this, program created new folder BUILD and DIST, in /build/apk/is META-INF, android manifest,RES folder and resources.arsc
Now i tried ( with tutorials ) drag from orginal framework-res.apk, folder META-INF, AndroidManifest.xml to BUILD folder and recompile second time (0 errors) then, from DIST folder i took framework-res.apk and overwrite to phone/system/framework and reboot = bootloop
Also trying after 1st re-compile, drag META-INF and androidmanifest.xml from orginal framework-res to newly recomplied framework-res.apk in DIST folder, again overwrite in phone/system/framework but still bootloop
before overwrite make permission rw-r--r- the same permisson of orginal framework-res.apk
then overwrited my apps example touchwiz, google play has stopped, reboot but unfortunately booloop
Any solution? ^^ thx
Click to expand...
Click to collapse
1. apktool if framework-res.apk
2. decompile apktool d framework-res.apk
3. change color.xml and styles.xml
4. apktool b framework-res
5. drag from the NEW (dist folder) framework-res.apk this files (with zip editor): -res folder, -resources.arsc, -classes.dex (if you edited the smali too) to the OLD framework-res.apk
6. Now you can use the 'old' framework-res.apk with your phone, but now with your modifications.
I hope its help you. Sorry for the long time delay, but i just find now this therad

Make sure that you put the original manifest and meta folder back into the apk before pushing it. There's no need to resign unless you modify the manifest, all you should have to do is open the newly compiled app with winrar and add the contents of the originals folder. (Which is the manifest and meta folder)
Sent from my KYOCERA-C6745 using Tapatalk

kong said:
You shouldn't sign any system apks, instead just copy over the META-INF folder and AndroidManifest.xml from original framework-res.apk to the newly compiled one.
Click to expand...
Click to collapse
THANK YOU!!!

kong said:
You shouldn't sign any system apks, instead just copy over the META-INF folder and AndroidManifest.xml from original framework-res.apk to the newly compiled one.
Click to expand...
Click to collapse
Thanks... Your suggestion worked for me :good::good:

RealWelder said:
Make sure that you put the original manifest and meta folder back into the apk before pushing it. There's no need to resign unless you modify the manifest, all you should have to do is open the newly compiled app with winrar and add the contents of the originals folder. (Which is the manifest and meta folder)
Sent from my KYOCERA-C6745 using Tapatalk
Click to expand...
Click to collapse
Well that didn't work for me , im still getting bootloop

Related

Anyone managed to change style.xml and recompile/add resources.arsc

Tried everything I can find and no luck with this with Sony framwork-res.apk doing my head in, My new resources.arsc is alwyas about 200kb smaller aswell after recompiling, furthest ive got is bootanimation then restart lol. Anyone had any luck with it? All i need to change is 1 bloody line in style.xml to change bottom popup menu to black, driving me mad lol
go3asy said:
Tried everything I can find and no luck with this with Sony framwork-res.apk doing my head in, My new resources.arsc is alwyas about 200kb smaller aswell after recompiling, furthest ive got is bootanimation then restart lol. Anyone had any luck with it? All i need to change is 1 bloody line in style.xml to change bottom popup menu to black, driving me mad lol
Click to expand...
Click to collapse
Have you followed this guide to the letter?
I changed the progressbar_horizontal.xml in my framework using this guide and it worked!
yeah , changed that worked fine but the style.xml file isnt viewable unless you decompile the apk then when you recompile the folder value with style.xml is compiled into the above file resources.arsc and not had any luck with it at all lol
Try asking Mr.Rusch or Calum?
Sent from my X10a using XDA App
go3asy said:
yeah , changed that worked fine but the style.xml file isnt viewable unless you decompile the apk then when you recompile the folder value with style.xml is compiled into the above file resources.arsc and not had any luck with it at all lol
Click to expand...
Click to collapse
Hmm style.xml is not viewable but also not any other .xml is viewable or readable if you do not decompile.
So I return to My_Immortal's initial question. Have you followed calum's guide about decomipling/recompiling the resources to the letter? What about the part where you take the .asrc file from the unsigned.apk and you chose to add it to the copmressed .zip file (which is the original signed apk that you have renamed). Have you done that exactly as you should?
_calum_ said:
This will create a new framework-res.apk in a subfolder out.
IMPORTANT: Do not push this apk to your phone unless you want to reflash
Extract the xml files and images from the newly generated apk (you can use the original images, but the xml files must be the newly compiled ones from the new apk). Add these files to the original framework-res.apk that you want to push to your phone (see the previous post).
Extract the resources.arsc from the root of the apk
Rename the original framework-res.apk from your theme to framework-res.zip
Right-click the extracted resources.arsc and choose the 7zip menu item ‘Add to archive’
In the dialog that appears set the achive field at the top to the framework-res.zip from step 7. And set the archive format to zip. Now set the Compression level to store and click OK(if you do not do this your phone will not boot). The settings are in the attached screenshot.
Rename framework-res.zip to framework-res.apk and double check that the compressed size or resources.arsc is the same as the original size (see screenshot)
Done. Push the new framework to your phone.
Click to expand...
Click to collapse
Its tge re compiling tgatsvthe problem aleays get sources not founf error in apktool. Read that it might be im not using fresh framework files tgat havent already been fiddlef eith but dont have any originnalsat the moment they all gave battery mod
Sent from my X10i using XDA App

[Q] Different method to edit an Apk: differences?

Hi to all! What are the differences between this:
Rename the *.apk to *.zip
Extract the *.zip file
Edit whatever you want
Compress all files again
Rename the *.zip to *.apk
and this:
Download ApkTool and "install" it
Using CMD navigate to the *.apk folder
Use this command "apktool d app_u_want_edit.apk"
Edit whatever you want
Use this command "apktool b app_u_want_edit"
???
Thanks in advance.
apktool
Francoiky said:
Use this command "apktool d app_u_want_edit.apk"
Edit whatever you want
Use this command "apktool b app_u_want_edit"
Click to expand...
Click to collapse
.
Using apktool be more change.
Normally you do not make changes to the file classes.dex and resources.arsc included in the APK files.
.
ze7zez said:
.
Using apktool be more change.
Normally you do not make changes to the file classes.dex and resources.arsc included in the APK files.
.
Click to expand...
Click to collapse
So, if I would change graphics only I could simply unzip and zip again, right?
As long as they are not .9.pngs then this will work but it will only work for images. I would advice learning apktool as this is the proper way to do it and you have less chances of messing something up. Alot of images are indexed and if not done properly can lead you to a boot loop
Sent from the Bat Cave

[How to] noobs guide to decompile/recompile android application

Guide to decompile android application
REQUIREMENT
Apktool [ http://www.mediafire.com/?ooaflvs6nvo5xvq ][Thanks to brut.all for this apktool]
Java JDK/JRE 32 bit [please google it guy's]
Little knowledge on cmd
__________________________________________________ __________________________________________________ _____________________
Preparation before WORKING
Process :-
1)now install the java in your pc/lappy
then copy the apktool.zip & goto directory C:/
make a folder name apktool (u can name it by watever u like)
now goto that folder & paste the zip
extract that zip there...
2) now copy the .apk or jar file which u wnt to decompile
& paste it on apktool folder.....
also copy the framework-res.apk of that rom &
paste it on that folder..
Decompiling application
3) now open cmd
Your cmd will probly look like this..
C:\users\yourname>
so type in
cd.. (yes include the '..' and press enter after you type each command)
this will get you to back directory so now you will see
C:\users>
so type again
cd..
you should now see this:
C:\>
now type
cd apktool (and you are in the apktool directory)
4)Installing Framework
Now that you are in directory we need to install the device's framework to your system for it to compile correctly so type this:
apktool if framework-res.apk
this will install the devices framework to your system (need to do this)
5)now to decompile the apk you want to edit.. type this:
apktool d music.apk mod
music.apk is the apk your decompiling
mod is the folder you're creating for the decompiled apk
do whatever you want to do with your apk...
NOW RECOMPILING
6)now to recompile your new apk type this:
apktool b mod music-new.apk
mod is the folder with your edited files
music-new.apk is your new apk file
Now we are NOT done... we cannot use the new apk's...
now make two separate folder a & b
copy-paste the original music.apk in 'a'
& music-new.apk in 'b'
use something like 7zip, take the 'resources.arcs' file and any other xml files you edited out of the "new-edited" apk and copy them into Original apk
now add to archive ...the origanl apk in zip format
& at the end of the file name .apk ( i mean give the file format name as .apk insted of .zip)
Now you are almost done..... :good: :good:
IF it is a system app then don't sign it....otherwise u have to sign that app....
That's all
don't forget to hit thanks or comment.... :good: :good:
Quick info: It doesn't work for chineese roms
lozohcum said:
Quick info: It doesn't work for chineese roms
Click to expand...
Click to collapse
is sony roms r chinese?!
Sent from my GT-S5360 using xda app-developers app
No but you can't use it for MIUI/Lewa porting, just saying
lozohcum said:
No but you can't use it for MIUI/Lewa porting, just saying
Click to expand...
Click to collapse
hmm its for gb,ics and jb based roms.. and its very simle guide :good:
ASK
Sorry Bro.. I am trying this method to decompile and recompile *.apk in system, but it say needed "twframework-res.apk" / 2.apk .. where i can get this file..? because there is nothing twframework-res.apk file in my phone...
thanks..
Java_Indo said:
twframework-res.apk
Click to expand...
Click to collapse
It is in system/framework
But be very careful
Because it may cause your handy not to boot
Regards
Naney said:
It is in system/framework
But be very careful
Because it may cause your handy not to boot
Regards
Click to expand...
Click to collapse
sorry , twframework-res.apk cannot found in framework folder,
btw do you have twframework-res.apk for tipo?
if ya, would u like to share with me...
thanks for your explanation.
Java_Indo said:
do you have twframework-res.apk for tipo?
Click to expand...
Click to collapse
Which ROM are you using?
Naney said:
Which ROM are you using?
Click to expand...
Click to collapse
sorry .. usually iam using JB ROM Cyanogen, but for now iam using MIUI v5 . ..
Java_Indo said:
do you have twframework-res.apk for tipo?
Click to expand...
Click to collapse
Here you are...

[Q] Edit SettingsProvider.apk to enable an option by default

Hi i want to enable "Unknown Sources" by default, when a ROM flashed.
I know that i need to modify the SettingsProvider.apk, and exactly the file settingsprovider.apk/res/values/bools.xml
Code:
<bool name="def_install_non_market_apps">true</bool>
when i edit this file, and repack, e resign the file, i flash the rom, and the phone not startup, freeze on loading bootanimation.
I use apktool 1.5.2
brunosso said:
Hi i want to enable "Unknown Sources" by default, when a ROM flashed.
I know that i need to modify the SettingsProvider.apk, and exactly the file settingsprovider.apk/res/values/bools.xml
Code:
<bool name="def_install_non_market_apps">true</bool>
when i edit this file, and repack, e resign the file, i flash the rom, and the phone not startup, freeze on loading bootanimation.
I use apktool 1.5.2
Click to expand...
Click to collapse
After you compile it open the modified settingsprovider.apk as an archive with 7zip or winrar and pull out the res folder and then take the original settingsprovider.apk and open that with 7zip or winrar and replace the res folder with the modified res folder you pulled out of your modified apk. You can use VTS to decompile and recompile and key old signature and that will work too.
mkinney88 said:
After you compile it open the modified settingsprovider.apk as an archive with 7zip or winrar and pull out the res folder and then take the original settingsprovider.apk and open that with 7zip or winrar and replace the res folder with the modified res folder you pulled out of your modified apk. You can use VTS to decompile and recompile and key old signature and that will work too.
Click to expand...
Click to collapse
didn't work
is there other solution ?
i want to edit settingsprovider for Android10

[Q] Modifying APK files. Why won't "apktool" recompile?

Modifying Mms.apk. I installed Java, and used the following command to decompile the .apk:
apktool.jar d Mms.apk
I then made my changes, and am trying to recompile with the command:
apktool.jar b Mms Mms.apk
The guides I'm following say this will create a "dist" folder within the Mms folder, containing the new (but unsigned) .apk file. This doesn't happen.
No output is given in Command Prompt.
A "build" folder is created, however. Inside is an "apk" folder. Inside of that is a "classes.dex" file.
Why won't apktool create the dist folder?
How can I get the recompiled apk file?
Mellowmarrow said:
Modifying Mms.apk. I installed Java, and used the following command to decompile the .apk:
apktool.jar d Mms.apk
I then made my changes, and am trying to recompile with the command:
apktool.jar b Mms Mms.apk
The guides I'm following say this will create a "dist" folder within the Mms folder, containing the new (but unsigned) .apk file. This doesn't happen.
No output is given in Command Prompt.
A "build" folder is created, however. Inside is an "apk" folder. Inside of that is a "classes.dex" file.
Why won't apktool create the dist folder?
How can I get the recompiled apk file?
Click to expand...
Click to collapse
Alternatively, if we can't figure out why it's not working, can someone compile it? I've attached the files.
Mellowmarrow said:
Alternatively, if we can't figure out why it's not working, can someone compile it? I've attached the files.
Click to expand...
Click to collapse
uhmm when building the apk you don't include the ".apk"
For example if I want to decompile app.apk, I type this:
apktool d app.apk
If I want to recompile, I type this:
apktool b app
YOU DON'T TYPE THE ".apk" AT THE END.
As for your Mms.apk:
1. "apktool d Mms.apk" > Correct
2. "apktool b Mms Mms.apk" > Incorrect
3. apktool b Mms > Correct
This is how it works:
1. If I have an app.apk in the APKTOOL directory, I decompile it by using the command apktool d app.apk
2. This will create a folder named app
3. If I recompile by using the command apktool b app, a new apk will be created inside the dist folder....inside the "app" folder

Categories

Resources