I wanted to increase number of volume step following this (http://forum.xda-developers.com/showthread.php?t=1411317&page=20)
I pulled the framework.odex and baksmali it but it didn't work because of dependency or something like that. Then I pulled all the odex file in there and succesfully baksmali framework.odex
I edited the smali file needed and then smali it to framework.dex. This is where I'm stuck.
The original framework use odex file, not dex file. So I guess I need to reodex the framework.dex to odex. But all the guides I found about reodex seem to be used for cooked rom, the jar files all have classes.dex in it and there 's no odex file.
Then I tried to put framework.dex into original framework.jar file (after change its name to classes.dex), use command "dexopt-wrapper framework.jar framework.odex", and overwrite the original framework.odex. The device coudn't start, it stuck at "nokia" text (is it called bootloop?)
So what is the proper way to do it ? Thanks
PS: I did it. There is a very similar example here, I missed a few thing: http://www.jordanhotmann.com/2011/08/how-to-change-default-orientation-of.html
MarryJ said:
I wanted to increase number of volume step following this (http://forum.xda-developers.com/showthread.php?t=1411317&page=20)
I pulled the framework.odex and baksmali it but it didn't work because of dependency or something like that. Then I pulled all the odex file in there and succesfully baksmali framework.odex
I edited the smali file needed and then smali it to framework.dex. This is where I'm stuck.
The original framework use odex file, not dex file. So I guess I need to reodex the framework.dex to odex. But all the guides I found about reodex seem to be used for cooked rom, the jar files all have classes.dex in it and there 's no odex file.
Then I tried to put framework.dex into original framework.jar file (after change its name to classes.dex), use command "dexopt-wrapper framework.jar framework.odex", and overwrite the original framework.odex. The device coudn't start, it stuck at "nokia" text (is it called bootloop?)
So what is the proper way to do it ? Thanks
PS: I did it. There is a very similar example here, I missed a few thing: http://www.jordanhotmann.com/2011/08/how-to-change-default-orientation-of.html
Click to expand...
Click to collapse
It's really great that you created something for yourself. But what will be even more greater, if you shared it withe community. So I advise that when you finish with this project and if successful, upload it so that we can also admire your work.
Related
First of all: I'M SORRY FOR ASKING THIS!
But, I'm trying to edit some drawables in the framework-res and in a couple other apk's but my problem is resigning them. I followed this tutorial http://www.androiddevelopment.org/tag/apk/
I changed the .apk to .zip to open it and access the drawables but when I open the .zip file it opens it in another folder, not like winrar or whatever for windows. So after I edit what I need and recompress the file, I can't change it back to .apk. So I try signing the apk as a .zip but the signing tool thinks it's a update.zip and signs it that way.
Basically, is anyone able to successfully resign apk's on a mac? If so, how?
Thanks
make sure you rezip the files inside the folder, then either sign that zip or open the info window (command+i) and rename the extension to apk there.
circa85 said:
make sure you rezip the files inside the folder, then either sign that zip or open the info window (command+i) and rename the extension to apk there.
Click to expand...
Click to collapse
Yeah I just figured out I have to open the info window to rename to .apk. And now the signing goes smoothly.
This thread is a waste, sorry, I'm an idiot.
Actually, I'm still having an issue. Here is an example of what happens:
Say I rename framework-res.zip to framework-res.apk (after editing, and recompressing) and then I use the signing tool to sign framework-res.apk. If I change it back to .zip and decompress it, there are two files in it. There is a folder called "framework-res" and a folder called "META-INF". Nothing else. The AndroidManifest.xml is inside the framework-res folder. This happens with every apk I try to sign
what are u using to sign apk's on mac? I was tryin to get this working long time ago but gave up. them I found the method using automator and it resigns them but idk if it actually wrks. i tried editing stuff resigning and flashing but i got like 770 files unsigned. unless I just didn't know how to resign an update.zip properly..
jroid said:
what are u using to sign apk's on mac? I was tryin to get this working long time ago but gave up. them I found the method using automator and it resigns them but idk if it actually wrks. i tried editing stuff resigning and flashing but i got like 770 files unsigned. unless I just didn't know how to resign an update.zip properly..
Click to expand...
Click to collapse
I'm using the script in the tutorial I posted in the original post
The script just uses the Jarsigner tool. So I'm using Jarsigner to sign my apks
Oh ok. I might have to try this out. Question: what is the proper way of signing an update.zip after u edited framework.Res or. Apks? I'm confused when it comes to that. Must u resign every single file in the. Zip for it to work?
I went as far as rebuilding the apk, but not sure how to resign. I tried to install anyway without signing, but the installer hangs while checking for version and gives network error after some time. I found a http://code.google.com/p/signapk and tried to use it on mac, but seems like it needs to be run on android itself. When I tried to run it on android, I get permission error, though I did a chmod +x as su. Could you give some more details on where to get the tool and use it?
ok, i must be missing something here. can anyone one help? everytime i decompile an apk, i'll open the xml i want to make changes to and make the necessary changes. i then recompile the apk. i flash the file to my phone and no changes have been made. because of this i have pulled the same apk back from the phone that i modified, decompiled it and none of the xml changes i made are incorporated.
i've tried removing the resources.arsc as the instructions say and i just get bootloops after flashing. when leaving the resources.arsc the phone boots and functions properly but no xml changes are made.
can someone give me their opinions on this?
hello all. I've been reading threads about pulling, pushing, editing, unpacking, signing, and all that for days now, but I still can't get my edited framework-res.apk to actually take effect .
I'm just trying to change some of the system notification icons, but when I replace the .apk, and reboot, the changes never take place. what am I doing wrong?
also apk tool CANNOT recompile my framework-res.apk, and since I'm only doing .png changes (not a 9.png mind you) I just open the original framework apk and overide the pngs that I want... at that point, I dont resign or anything...
I am rinning Swagged out Stock based on 2.3.5
kernel: 2.6.35.10-g4b48446
build: SOS N
software: 2.0.9\4.67\ODEX
and using clockworkMod 5.0.2.2
-I've tried just using root explorer to overide the original and permissions, and after I reboot no changes took place.
-I've tried adb pushing to the framework folder (but with not fancy permission commands, could that be the issue?) and then wiping dalvik(sp?) cache but no changes took place.
-I've also tried using an update.zip file but i can't figure out the actual code that needs to go into the "update-script" file.
Anyway, is there an obvious reason why I'm failing? I had success with editing and updating other .apk files (my music.apk for example works fine when I decompile ... compile.... and sign)
thanx for any help!
I am trying to edit the smali code in the systemui.apk for a couple mods in the development section. I am having some difficulties. I am trying to use smali/baksmali.
Anyone have a guide or able to provide some steps.
Thanks
First, if you don't have apktool set up Google "How to set up apktool on Windows(or Linux or Mac etc)"
Once set up use this modified apktool and aapt.exe found here. Make sure you select the appropriate aapt.exe depending on you OS
http://forum.xda-developers.com/showthread.php?t=1755243
Rename that modified apktool jar to just apktool.jar and place the jar and exe in your C:\apktool\ directory
Next, get the framework-res.apk and twframework-res.apk (found in /system/framework/). Place them in your apktool directory
CD your apktool folder and type
apktool if framework-res.apk
apktool if twframework-res.apk
Place your SystemUI.apk in your apktool directory and type
apktool d SystemUI.apk
It'll decompile, complete your mods then recompile
apktool b SystemUI
The apk will be in the SystemUI\dist\
Sent from my SPH-L710 using Tapatalk 2
For me the easiest way is baksmali and smali.
For smali its easy. Just extract the classes.dex and run the decompile command. Simple. You will need java installed.
To recompile just run the recompile command and done. You get a new .dex that you pop I the apk you are editing and delete the old one. Name it the same, push the apk and done.
BTW, the command isent actually "decompile" and "recompile"
You will need a little more java experience to know what the commands are.
fergie716 said:
First, if you don't have apktool set up Google "How to set up apktool on Windows(or Linux or Mac etc)"
Once set up use this modified apktool and aapt.exe found here. Make sure you select the appropriate aapt.exe depending on you OS
http://forum.xda-developers.com/showthread.php?t=1755243
Rename that modified apktool jar to just apktool.jar and place the jar and exe in your C:\apktool\ directory
Next, get the framework-res.apk and twframework-res.apk (found in /system/framework/). Place them in your apktool directory
CD your apktool folder and type
apktool if framework-res.apk
apktool if twframework-res.apk
Place your SystemUI.apk in your apktool directory and type
apktool d SystemUI.apk
It'll decompile, complete your mods then recompile
apktool b SystemUI
The apk will be in the SystemUI\dist\
Sent from my SPH-L710 using Tapatalk 2
Click to expand...
Click to collapse
+1
...and don't forget to use 7-zip and grab the META-INF & androidmanifest
XML files, then put them in build/apk and run recompile command again.
"apktool b SystemUI"
Ok I have tried both methods listed above. Maybe I am not understanding something about each way. What I am doing is using root explorer to copy the SystemUI.apk from system/app and the framework-res.apk from system/framework/
When I use apktook, it decompiles but I dont find any smali code i there. I get a list of 2 folders and 2 files (assets, res, androidmanifest, apktool.yml) there are subfolders but still no luck finding smali code in there.
I tried the smali/baksmali method but i cant seem to find any classes.dex (as I understand it, its located in the SystemUI.apk). Am I looking in the wrong place. I used 7zip to view the SystemUIapk, it shows the same folders I mentioned above minus the apktool.yml and additionally a meta-inf folder and resources.arsc.
Am I looking at the wrong place? It is the stock rom. There is a file systemui.odex should I be doing something with that instead?
The editing that I am trying to do is mentioned here in case it helps. http://forum.xda-developers.com/showthread.php?t=1848611
Thanks
deepsix_69 said:
Ok I have tried both methods listed above. Maybe I am not understanding something about each way. What I am doing is using root explorer to copy the SystemUI.apk from system/app and the framework-res.apk from system/framework/
When I use apktook, it decompiles but I dont find any smali code i there. I get a list of 2 folders and 2 files (assets, res, androidmanifest, apktool.yml) there are subfolders but still no luck finding smali code in there.
I tried the smali/baksmali method but i cant seem to find any classes.dex (as I understand it, its located in the SystemUI.apk). Am I looking in the wrong place. I used 7zip to view the SystemUIapk, it shows the same folders I mentioned above minus the apktool.yml and additionally a meta-inf folder and resources.arsc.
Am I looking at the wrong place? It is the stock rom. There is a file systemui.odex should I be doing something with that instead?
The editing that I am trying to do is mentioned here in case it helps. http://forum.xda-developers.com/showthread.php?t=1848611
Thanks
Click to expand...
Click to collapse
Deodex first then use the apk.
I installed a deodexed version of the stock rom, and then used the apktool directions above. They appear to have worked.
Thanks for the help.
Hey everyone.
Here is the deal:
I want to theme my statusbar to make it look like stock jelly bean (from nexus). It's possible to do that using apps such as "ROM Toolbox", but the problem is: The rom must be deodexed and mine isn't.
So I found this "how to" to deodex an apk in another forum:
Code:
Thanks all. Have successfully done what I wanted now
For info, this is what I did.
Created a new folder called 'system' in c:\android-sdk\tools. Obtained the odexed framework folder and placed that in the system folder. Then created a folder called app in the system folder and placed the Rosie.apk and Rosie.odex inside.
Then via cmd, entered the 'system/app' folder, so for me it was...
c:\android-sdk\tools\system\app
From there I ran the following command to end of that path: baksmali.jar -d ../framework -x Rosie.odex
This produced an out folder will all the decompiled .smali files etc. From there I was able to get to the Launcher.smali that i wanted, but to recompile to a classes.dex file you simply run the following command: smali.jar out
This produces an 'out.dex' that you can rename to 'classes.dex'
I am sure there are other commands that you can use to name files accordingly etc but this is what worked for me for what I wanted, so hopefully it will be of some help to people... if they can understand anything I've written.
Is that simple as it looks? I was planning to deodex only the file needed to customize the statusbar. I think it's the framework-res.apk.
Is there any other way to do that?
As I'm new on this deodex stuff, I would appreciate some help.
fndpena said:
Hey everyone.
Here is the deal:
I want to theme my statusbar to make it look like stock jelly bean (from nexus). It's possible to do that using apps such as "ROM Toolbox", but the problem is: The rom must be deodexed and mine isn't.
So I found this "how to" to deodex an apk in another forum:
Code:
Thanks all. Have successfully done what I wanted now
For info, this is what I did.
Created a new folder called 'system' in c:\android-sdk\tools. Obtained the odexed framework folder and placed that in the system folder. Then created a folder called app in the system folder and placed the Rosie.apk and Rosie.odex inside.
Then via cmd, entered the 'system/app' folder, so for me it was...
c:\android-sdk\tools\system\app
From there I ran the following command to end of that path: baksmali.jar -d ../framework -x Rosie.odex
This produced an out folder will all the decompiled .smali files etc. From there I was able to get to the Launcher.smali that i wanted, but to recompile to a classes.dex file you simply run the following command: smali.jar out
This produces an 'out.dex' that you can rename to 'classes.dex'
I am sure there are other commands that you can use to name files accordingly etc but this is what worked for me for what I wanted, so hopefully it will be of some help to people... if they can understand anything I've written.
Is that simple as it looks? I was planning to deodex only the file needed to customize the statusbar. I think it's the framework-res.apk.
Is there any other way to do that?
As I'm new on this deodex stuff, I would appreciate some help.
Click to expand...
Click to collapse
The statusbar is SystemUI.apk.. framework-res.apk deals with all the system pop ups etc.
I would recommend starting off with a deodexed base rom, for eg. wanams..
I would also recommend using apktool rather then baksmali.. iv had great success with apktool..
EDIT: You can find deodexed wanam base rom in general section of this section of the forum.
fOmey said:
The statusbar is SystemUI.apk.. framework-res.apk deals with all the system pop ups etc.
I would recommend starting off with a deodexed base rom, for eg. wanams..
I would also recommend using apktool rather then baksmali.. iv had great success with apktool..
Click to expand...
Click to collapse
Unfortunally, flash a new rom is not an option for me right now.
Is that OK to deodex only ONE apk in order to do what I want? In this case SystemUI.apk.
I just have to deodex it using apktool and put it back to android system?
do what fences do, compile it and put in the split test system, remember it is a system app
XxeAgLeAnGeLxX said:
do what fences do, compile it and put in the split test system, remember it is a system app
Click to expand...
Click to collapse
Sorry, but what is "split test system"?
EDIT: Nevermind... I did some research and now I'm running an AVD on android emulator.
I'll soon test the deodexed SystemUI.apk and post results. Thanks for the tips...