ROM Building: The Basics Part III - Sprint Samsung Galaxy S III

Welcome back everyone
For those who are not familiar with the series, I recommend checking out part I and then part II to get caught up on our continued efforts to modify a ROM to your every whim and need.
We will be utilizing some really cool tools today. They come at a price of patience and perseverance, you know, kind of like what Valve expects from all of their loyal customers, and the worst part is....they could release the HL3 in 10 years, and I would still throw money at my screen.
I digress again.
Today we learn how to decompile those sneaky APK's and the necessary Framework files. They are located in the 2 most important folders:
MD4_Version_1/system/app
MD4_Version_1/system/framework
We need to start at the beginning of this topic.
To begin, let us test your ability to use JAVA....Wait STOP! Java? Programming? We do not need to be experts at programming at all, in fact, implementing mods is really a copy and paste procedure for us noobs, but if you know how to JAVA, maybe you can create your own mods that you can share with the community. Also, I am not a programmer, but I do know how to use logic to trial and error the crap out of the mods until they work.
To test if you have JAVA installed, open up a command prompt in Windows (because if you have Linux, you are not going to even be on this beginner's tutorial now are you?)
type in:
Code:
java
You should see
Code:
C:\>java
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-server to select the "server" VM
-hotspot is a synonym for the "server" VM [deprecated]
The default VM is server.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -jre-no-restrict-search
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image
Wait, you did not see this did you? Well it happens, you probably got an Unknown Command or some shenanigans that doesn't look similar to the above?
Do not worry, we will need to add JAVA to the environment variables. First head over to JAVA and download the Java Runtime Environment (JRE). Install as you would by clicking next next next next and next and next.
When it installs, it goes to a specific location. The problem is, sometimes Windows does not recognize that path, which is why when you execute the JAVA command in a command prompt it tells you unknown command. We have to tell Windows to search in the java installation folder that you just installed for the JAVA.exe program so Windows can add it to the list of areas to search when you execute a command.
To do this, we will need to add the path in the environmental variables, java explains that sometimes this should not be necessary. But use this for more information and an understand of how to do this to different operating systems.
My path was the default "PATH" for java
Code:
C:\Program Files (x86)\Java\jre7\bin
Once that has been added to the environmental variables, test out the java code and see if it looks like what I have from above.
After this is done, we will need to install the Android SDK, this can be found here
The SDK, is a software development kit. It will allow for a user to create software for your android phone. This tutorial will not be doing that because that is a very heavy order. It will require the release of the Kraken. I do not recommend releasing the Kraken. Unless it is harmless Cthulhu. He's so adorable.
Anyway, this will install platform tools for us to push files to our phone and allow us to to execute these commands.
Remember, we can add the tools of the SDK to our PATH variable so we can execute these tools in any command prompt and at any location.
If you are having trouble at this point, let me know in the comments below and we can try and address this issue.
Now that we have the basic tools down, we need to understand what the heck that APKTOOL, SMALI and BAKSMALI do.
These tools are used to decompile the our APK and JAR files.
Keep this in mind at all times
APKTOOL will decompile and combile APK FILES
SMALI compiles DEX FILES
BAKSMALI decompiles DEX FILES
Do you know what any of these 3 are? Maybe you do, maybe you don't.
The APK stands for Android application package. It is basically the app. In windows, it would be equivalent to the program. The APK is unique in the sense that all the files in the app are actually zipped inside an APK file.
That logic only deduces, we can open almost any APK file with 7-zip. This is good news until we realize, the APK files are actually encoded in a way. We cannot make serious mods until we de-scramble the code hidden in the APK.
This is where APKTOOL comes into play. The APKTOOL can de-compile the encoded files and put it into a folder for us to work with. We can then make our mods, recompile and then put it into our ROM.
After explaining Smali and Baksmali, we will begin a basic mod.
Smali and Baksmali are actually java archive files. They contain instructions to take a DEX file and de-compile them into very interesting SMALI code. DEX is an EXE file for our Android system. We can only de-compile a classes.dex file for now, for it contains the majority of the rest of the tweaks. As a result, doing this is important and very difficult unless you understand what is going on. We will definitely have examples so do not fret, did I mention a half life reference yet...I don't think so.
So back to APKTOOL, we are going to need to understand what it does before we begin. I am assuming you got your APKTOOL downloaded from here, go to your C: drive and create a folder in there called APKTOOL in there, unzip the downloaded file, there will be a file Setup.bat, execute that file and a command prompt window with Green text will appear, I recommend selection 1 first to ensure you have the latest version, but we do not need to do this.
We will need to press option 2, but it says we must place some files in the other folder first. The files needed are actually the framework files, basically, the way our rom interprets the files are needed for this APKTOOL to operate.We will need to go to our ROM's
MD4_Version_1/system/framework/ folder and copy 2 files
Code:
framework-res.apk
tw-frameworkres.apk
These files will be copied into
Code:
C:\APKTOOL\other
This needs to be done before you select option 2.
Once the files are copied, press 2, then we need to install the first two options, so go one by one and install both.
Then when you are back to the main menu, press 3 and setup the directories for your need.
Personally, I took the
Code:
C:\APKTOOL\other
folder and moved into my own working directory. Assume that the locations will be selected by you for organization. I will use the following folder for reference:
Code:
C:\other
This will have all of the tools I need, while you are at it, create a new folder in their called Smali and copy the Smali.jar and BakSmali.jar files in there, they will of course be named something else like smali-1.4.2.jar and baksmali-1.4.2.jar
Rename the files to make life easier
Code:
from
smali-1.4.2.jar
to
smali.jar
and
baksmali-1.4.2.jar
to
baksmali.jar
Back to APKTOOL, now back to me, Now back to APKTOOL, now back to me.
We will be victimizing a specific APK to get modding started.
Before we get started, this is where we start version controlling more seriously. As each mod you add could cause a freeze, hang, bootloop or whatever, so go to the folder of your ROM, select the four files
META-INF
system
boot.img
installbusybox
right click them and "Add to Archive". Zip file only remember, compression level( Normal to no compression is fine)
Now
Lets grab a copy of SecPhone.APK located in the system/app folder
And put it into
Code:
C:\other
Open a command prompt and navigate to that location of the APKTOOL
Execute the following command
Code:
apktool d SecPhone.apk SecPhone
If done successfully, you will something like
Code:
C:\other>apktool d SecPhone.apk Secphone
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\<Your User Name>\apktool\framework\1.apk
I: Loaded.
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...
C:\other>
This means it successfully decoded the file. We will have a folder called SecPhone that has a bunch of folders.
Navigate to the following folder:
Code:
C:\other\Secphone\res\raw
There are 2 .ogg files. Well well well, I thought we took care of these, hmm, guess we need to change these to whatever you need to. Let's assume you did this already and have replaced them. We will need to stop the "mods" for now, for we are learning a process not a mod per se.
So we are done "modding" the file, I know it is not a BIG mod but we are trying to learn how to do this now so we can do the heavy stuff later. Now we can continue to recompile the file.
Go back to command prompt and direct yourself to
C:\other>
Click to expand...
Click to collapse
The put in the following command:
Code:
C:\other>apktool b SecPhone new-SecPhone.apk
Notice we changed 3 things, the d became a b, the second option is the folder we are recompiling, the third is the name of the new file
You should then see something that might be worrisome:
Code:
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
aapt: warning: string 'reject_cause_location_reg_fail' has no default translatio
n in C:\other\SecPhone\res; found: es pt
aapt: warning: string 'reject_cause_location_registering' has no default transla
tion in C:\other\SecPhone\res; found: es pt
aapt: warning: string 'stms_version' has no default translation in C:\other\SecP
hone\res; found: ja
I: Building apk file...
C:\other>
The warnings will be acceptable for the time being as they are related to a different language setting. If you are in English, you will be fine. If you are not, then that is a different tutorial altogether. Also, there is a very particular code bug that occurred the very first time I ran these commands and caused a catastrophic failure, more than any Movie-to-Game adaptation could ever be,
But you think you are done here, well that is not true. You see,
We have compiled the new APK file but unfortunately, it is a system file, we cannot sign this file to tell Android it is legit, we will have to cheat at this point, just like Valve did by creating any other project except Half Life 3 after number 2, you know they have enough funding for it, they are making it, and if I get kidnapped, I will probably be in a basement at Valve which I won't mind if they give me a grav gun. On a side note, while Brian Cranston would make a great Gordon Freeman, I still think Hugh Laurie would do a good job, just saying.
So back to our dilemma. We have created a new file called new-SecPhone.apk, open it with 7-zip, do not do anything yet, open the SecPhone.apk file you should have, it is the original file in the C:\other folder, we will need to drag two files for signature's sake
Copy the
Code:
Meta-INF Folder
AndroidManifest.xml
directly into the new-SecPhone.apk file. This can be done by dragging the files.
This will allow Android to think the file is signed and legit.
Take the new-SecPhone.apk file and copy it to your desktop and rename it to SecPhone.apk
Then place it into your ROM's system/app folder.
Your "first Mod" is ready to go, pretty easy actually but I really think the method is what many of us lack and this centralizes the effort. When you want to mod any System file, this process has to be done.
Its not a crazy mod, that will be after we explain how to modify files with Smali and BakSmali.
That will be in the next part of this set of series. These keep getting longer, I know, but we have a boat ton to cover. I think a central place to go-to for this information is important instead of jumping around to so many places for information. Eventually, the plan is to stick them as one big post I hope so we can integrate the vast amount of knowledge flowing.
Let me know what you think in the comments below, feedback is important, I felt this is so far the most complicated of the series and it will only get crazier. Luckily we can ask questions and keep this series going with an understanding for ROM building and see how much effort goes into someone else's effort modifying one of these ROM's out there, this is just a stock ROM mod tutorial, imagine something like CyanogenMod or any crazy ROM with a boat ton of features. It is time consuming and they deserve mad props for their amazing work.

Again great stuff. Can't wait for the next tutorial!
Sent from my SPH-L710 using xda app-developers app

bigpappags3 said:
Again great stuff. Can't wait for the next tutorial!
Sent from my SPH-L710 using xda app-developers app
Click to expand...
Click to collapse
He is very informative, and puts it in ways I can understand!
------------------------
Sprint Galaxy S3
Need Help? PM
Hit the "Thanks" button if I helped!

I'm stuck
I've downloaded the APKTOOL zip, and there is no setup.bat file in the unzipped package. There are only two files in the package and nothing else. One is an application called aapt, the other is a batch file called apktool. Both of which when executed briefly open a command prompt window that closes before I can read what they say. I've followed every direction to a "T" thus far, and can't figure out what to do. I thought that perhaps I had a bad download, but I've re-downloaded the file several times without success. Any suggestions would be incredibly helpful.

Might have a solution
balcoresbane said:
I've downloaded the APKTOOL zip, and there is no setup.bat file in the unzipped package. There are only two files in the package and nothing else. One is an application called aapt, the other is a batch file called apktool. Both of which when executed briefly open a command prompt window that closes before I can read what they say. I've followed every direction to a "T" thus far, and can't figure out what to do. I thought that perhaps I had a bad download, but I've re-downloaded the file several times without success. Any suggestions would be incredibly helpful.
Click to expand...
Click to collapse
Well it seems they have changed up quite a few things on the Wiki page, the version I was using was 1.5.2, the package has moved around and it seems these instructions are as obsolete as they are dependent on a website to not change things around.
They still offer the 1.5.2 of course but in the archives, suppose it was my fault linking to a constantly changing website than to link to the files directly that I used which I was considering.
This is the link
https://code.google.com/p/android-apktool/

zalooa said:
Well it seems they have changed up quite a few things on the Wiki page, the version I was using was 1.5.2, the package has moved around and it seems these instructions are as obsolete as they are dependent on a website to not change things around.
They still offer the 1.5.2 of course but in the archives, suppose it was my fault linking to a constantly changing website than to link to the files directly that I used which I was considering.
This is the link
https://code.google.com/p/android-apktool/
Click to expand...
Click to collapse
Thanks @zalooa. I'll give it a go tonight for sure. I appreciate you getting back to me!

Related

[Q] Compiling 9-patch in framework-res

In attempts to do a bit of my own theming, I've begun looking around for info on how to create 9 patch images (.9.png). I've successfully created them and understand the whole stretching and content thing, but I can't figure out how to compile the images so that the 1 pixel border isn't part of the image.
For now, I am working off of Manup's INCredibile rEVOlution theme and just replacing some stuff that I'd like to start out with. I've tried a couple of things which may sound retarded to those that know what they're doing with this stuff, including manually adding the new 9-patch to the framework-res.apk with aapt.exe, along with extracting the apk, replacing the old image with my new 9-patch then building a whole new apk using apkbuilder.bat. Each time the image gets added to the archive successfully, but neither of these compile it and the 1 pixel border is still visible on the image.
I've read about decompiling the framework somehow and rebuilding it but A) I'm not sure if that's really necessary and B) am not quite sure how to do it anyway. I've tried creating a new android project in eclipse using the source of the extracted framework-res.apk, but I can't create the project because it can't parse the AndroidManifest.xml file.
Is there some sort of tool available that can simply be executed on a newly created .9.png to compile it into an image that is can be easily inserted into framework-res.apk? Any insight would be greatly appreciated!
Ok, so I got all excited thinking I figured this out and was good to go with all my future .9.png editing, but I'm still getting a boot loop when I push framework-res.apk back onto my phone. I have already replaced regular .png files and pushed successfully, so I know it's gotta be something with the .9.png file I am trying to edit and not the signing/pushing process.
The steps I used to edit and get the file back on the phone are:
1. Create new png file in Photoshop with the same dimensions as the existing .9.png to be replaced (478x46).
2. Save the file as .png (tried both regular save and Save for Web/Devices as PNG-8 which I read somewhere)
3. Open with draw9patch
4. Add one pixel on the left side and one pixel on the top for stretchable areas (I have tried with and without lines for content on the right and bottom)
5. File -> Save 9-patch (Creates new .9.png, dimensions 480x48)
6. Create new eclipse project from sample project source
7. Insert new .9.png into res/drawable (also tried res/drawable-hdpi)
8. Right click root project folder -> Android Tools -> Export Unsigned Application Package
9. Open sample apk with winRAR, extract my new .9.png (dimensions are once again 478x46)
10. Open framework-res.apk and replace current .9.png with mine
11. Resign framework-res.apk
12. Push framework-res.apk to /system/framework in recovery
Could anyone tell me what I am doing wrong in this process? I figured originally since the image wasn't compiled it was causing a boot loop. But now that I've figured out how to compile them, it still happens!
Yup, those 9-patches can be realllllyyy annoying. You have to be careful.
This is what works for me:
1. Get APKManager. (google it. It's here on xda somewhere)
2. Follow directions to install it.
3. Decompile apk.
4. Go to 'out' and find the image you want to edit.
5. (Assuming it's a 9-patch) Edit with GIMP or PS, but DO NOT TOUCH THE 1px BORDER. You can delete it or whatever, but make sure it's the same after you save it. (Pure black 1px)
6. Recompile apk.
7. Done!
One more warning, do NOT open any 9-patch images. (unless decompiled) It will mess up the metadata.
Hope that helps!
I had downloaded APKManager previously and messed with it a bit, but didn't think it could ultimately help me. That being said, I'm having some issues trying to do what you suggested:
1. Place unmodified framework-res.apk into "place-apk-here-for-modifying"
2. Decompile apk (Success)
*I don't have an 'out' directory, but everything is extraced into 'projects\framework-res.apk' so I'm guessing that's where you mean.
3. Edit status_bar_close_on.9.png in Photoshop, retaining the existing 1px border
4. Recompile apk (Here's the big issue)
APKManager says "Building Apk" and then gives me this message: "An Error Occured, Please Check The Log (option 21)" Press any key to continue
I press a key and it then asks, "Is this a system apk? (y/n)"
If I enter 'y', it is followed by: "Aside from the signatures, would you like to copy over any additional files that you didn't modify from the original apk in order to ensure least # of errors (y/n)"
The best combination of answering these questions I've seen is yes it's a system file and yes to copy files from the original. This creates a folder called 'keep' and instructs to delete anything I've modified. I assumed that was so that it would take any missing files from 'keep' and replace them with the modified file of the same name in 'projects\framework-res.apk', but when I delete from 'keep' the file is just missing from the new apk that is created.
When I answer no it is not a system apk, I don't see a new apk created and the original one is still unchanged containing the original image.
Answering yes it's a system file and no to copy files from original, I just get an apk with 'META-INF'.
I tried replacing the image during the whole "keep" process instead of deleting the old one, and that put it in the new apk but it still has the 1px border.
I also noticed that inside 'projects\framework-res.apk' there is a 'build\apk' folder which is empty. Not sure if I need to put something in there or what.
When I check the log, it starts with:
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b07)
Java HotSpot(TM) Client VM (build 17.0-b17, mixed mode, sharing)
Could Not Find C:\Users\Zach\Desktop\DroidStuff\APKManager\place-apk-here-for-modding\../place-apk-here-for-modding/signedframework-res.apk
Could Not Find C:\Users\Zach\Desktop\DroidStuff\APKManager\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedframework-res.apk
I: Loading resource table...
I: Decoding resources...
W: Cant find 9patch chunk in file: "drawable-hdpi-v4/status_bar_item_app_background_normal.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi-v4/status_bar_item_background_normal.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi-v4/status_bar_header_background.9.png". Renaming it to *.png.
I: Copying assets and libs...
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
libpng error: Read Error
ERROR: Failure processing PNG image C:\Users\Zach\Desktop\DroidStuff\APKManager\other\..\projects\framework-res.apk\res\drawable-hdpi\status_bar_header_background.9.png
libpng error: Read Error
ERROR: Failure processing PNG image C:\Users\Zach\Desktop\DroidStuff\APKManager\other\..\projects\framework-res.apk\res\drawable-hdpi\status_bar_item_app_background_normal.9.png
libpng error: Read Error
ERROR: Failure processing PNG image C:\Users\Zach\Desktop\DroidStuff\APKManager\other\..\projects\framework-res.apk\res\drawable-hdpi\status_bar_item_background_normal.9.png
Then there's a ton of entries that look like this for every single png:
C:\Users\Zach\Desktop\DroidStuff\APKManager\other\..\projects\framework-res.apk\res\values\public.xml:2690: error: Public symbol drawable/activity_title_bar declared here is not defined.
And ends with:
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Zach\AppData\Local\Temp\APKTOOL1864619025913287067.tmp, -x, -S, C:\Users\Zach\Desktop\DroidStuff\APKManager\other\..\projects\framework-res.apk\res, -M, C:\Users\Zach\Desktop\DroidStuff\APKManager\other\..\projects\framework-res.apk\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(Unknown Source)
at brut.androlib.Androlib.buildResourcesFull(Unknown Source)
at brut.androlib.Androlib.buildResources(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.apktool.Main.cmdBuild(Unknown Source)
at brut.apktool.Main.main(Unknown Source)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Zach\AppData\Local\Temp\APKTOOL1864619025913287067.tmp, -x, -S, C:\Users\Zach\Desktop\DroidStuff\APKManager\other\..\projects\framework-res.apk\res, -M, C:\Users\Zach\Desktop\DroidStuff\APKManager\other\..\projects\framework-res.apk\AndroidManifest.xml]
at brut.util.OS.exec(Unknown Source)
... 7 more
Hmm... it sounds like quite a few of the 9-patch files are corrupted. Looking at the error log, it seems as if you have some 9-patch files that "aren't 9-patch"ed. That is, you opened the compiled 9-patch, or somehow corrupted it.
Are you sure it's an unmodified framework-res.apk? Try pulling the one from your phone (assuming it's running), or download your ROM again.
PS Don't worry about all the errors. I know it looks scary, but the rest of the errors are caused by the failed compilation of those 9-patches.
It has been modified from the standpoint that it is Manup's INCredible rEVOlution theme and not stock, but it runs on my phone. However, I think I may have just discovered something really stupid on my part.
Instead of restoring my nandroid when it didn't work, I decided "hey, why don't I repush this unmodified backup framework I have and save 15 minutes!" I pushed that and it still boot looped, so I think somewhere along the line I overwrote my backup/file I was using as a base, with something that doesn't work. Ugh! I must have at some point a while ago opened those png's that are corrupted, because I see they are all related to the status bar, which is what I'm trying to modify, I haven't touched them recently though.
I'm now in the middle of a long txt conversation with someone so it'll have to wait, but I think I should be good to go using my previous method and a freshly pulled framework-res.apk, possibly using the decompiled 9-patch from APKManager in place of mine created from scratch.
I'll let you know how it goes when I get around to it!
Edit: I pulled the current working framework off my phone and got the same errors on those png's with APKManager. I tried making the edit and pushing again anyway, didn't work. Re-pushing the unmodified one (which I'm sure was unmodified, as far as since I pulled it just now) boot looped still. Something obviously got messed up somewhere, but I'm confused why it runs on my phone, but when I re-push it, it stops working. So I guess I'll try a fresh download again later and see how it goes. If that doesn't work, then I'm just completely lost =/
Yeah, so I'm pretty lost on this. I downloaded a fresh copy of the framework-res.apk from the INCredible rEVOlution theme and I still can't get it to work.
I've tried making a status_bar_close_on.9.png from scratch with draw9patch as well as overwriting the decompiled status_bar_close_on.9.png from the apk, thinking maybe there was a conflict with something in xml when I changed the stretchable areas by making my own (I don't know much about the xml so I'm trying to avoid touching it for now).
Since APKManager is still giving me re-compiling errors, I used my previous method of compiling the image (both mine and the original decompiled one) by putting it in a res/drawable folder within an eclipse project and exporting, which appears to work since the dimensions shrink from 480x48 to 478x46 after it's done. This is the original dimensions of the .9.apk I pulled.
The only thing I can think of is maybe the file size? My png is 13k before I compile it, and then becomes 31k. The original status_bar_close_on.9.png is around 4k.
Seems like we need to do some debugging.
Try (in this order):
1. Flashing the umodified framework-res.apk. If it's good, then go on. If not, then it's the theme's fault.
2. Decompile the umodified framework-res.apk. Recompile it. Are there errors? If yes, then it's APKManager's fault and you should try APKtool. If no errors, then it's something about your editing.
Try those two steps, then report back! =]
The unmodified theme works fine, so I tried decompiling and recompiling it and gave the same errors. apktool gives me the same errors as APKManager, so it's not the fault of APKManager but rather the SDK tools it uses to do its job, or rather the theme itself.
However, I decided to try replacing the framework-res.apk inside of the original .zip file for the theme and flashing that instead of pushing it through adb. For whatever reason, that worked! Now that I think of it, the standard .png images I replaced previously were in com.htc.resources.apk and not the framework-res.apk. So I guess the phone doesn't like the framework being pushed through adb.
Thanks for the tip re: APKManager. I'm going to give that a shot. Seems less cumbersome than the 9Patch tool/Eclipse/Unzip approach I'm currently using.
I have been extremly unsuccessful with 9patch images until I found the attached
1) Extract the contents to any folder
2) Look in the \Originals\res\drawable-hdpi folder and you will see a sample I left in there.
3) After edits (I use Gimp) just run the xUltimate-d9pc.exe
4) Look in the done\Originals\res\drawable-hdpi and you will see the new output patched image.
5) Copy your outputs images to the appropriate folder in the apk. either by:
a. dragging the images to the folder within the archive (I use 7Zip) or
b. first extract the res folder to the PC and make your edits there then
drag the whole folder back into the archive.
EDITING NOTES:
1) The image that you use as input has to be 2x2 pixels bigger than the final 9patch image you want for the "stretch marks" along the sides and top.
2) Look at the sample I provided and basically the solid black marks on the right, bottom, left and top will work for most images but you can experiment.
3) The marks (patches) MUST be solid black
Enjoy
NilsP's xUltimate headache cure
@NilsP
Thank you very much for the xUltimate-9Patch.zip, it worked perfectly.
I have tried a couple of other xUltimate downloads but ended up with either bad .9.png's after compiling with APKmanager or simply just errors when running the .exe inside the xUltimate folder.
I am going to be flashing a new Desire HD rom onto my Desire very soon and can not wait to edit some fresh, uncorrupted .9.png's knowing I will not get errors from APKmanager.
Hi, I wonder if you´re still there! I would like to make my phone dialer transparent, understand that therefor I have to work on .9.pngs in drawable-sw320dp-hdpi of secphone.apk. But I run into various problems. First there are lots of .9.pngs, then I thought I´d begin with *bg.9.pngs and there came my first surprise. xUltimate-9Patch says even when compiling the original ones that there are errors ... So how could I proceed? If you could answer I´d really appreciate it!!! Thanks!
NilsP said:
I have been extremly unsuccessful with 9patch images until I found the attached... xUltimate-d9pc.exe ...
Click to expand...
Click to collapse
FYI, many AVs have started tagging xUltimate-d9pc.exe as a trojan. I'm not smart enough to know if it's a false positive though:
https://www.virustotal.com/en/file/...2db2aef519e3a80cd991fab1a513438a638/analysis/

[TUT] Custom frameworks for Gen 8

So, it seems that more people are taking an interest in making custom frameworks. This isn't really a full tutorial, but I thought it would be helpful to just post some tips on how to go about making your own framework-res.apk, save others a bit of time retreading old ground, since the methods are scattered around the site a bit!
Thanks to wdl1908 for prompting me to do this - should really have done this sooner!
Okay, so basic requirements:
Rooted Gen 8 (Uruk or chulri method)
Original Archos framework-res.apk
zip editor
image editing software
.png's to replace the stock ones with
That's about it! I've been using GIMP on Ubuntu for the image editing, and Phatch for batch resizing, but Photoshop will work just as well on Windows.
Edit: Thanks to wdl1908, have found that Gwenview gives much better results when resizing, compared to Phatch or GIMP. Works on both Ubuntu and KDE.
Use your preferred zip editor to unzip the contents of framework-res.apk to your chosen folder. The main folder of interest is "drawable-mdpi".
The Gen 8's use MDPI resolution images (well, A70 and A101 to at any rate. I think someone mentioned the A32 or A43 used HDPI images). Depending on your .png source, you may need to resize the images. I took my images from themes made for the Desire, which is an HDPI device, so I used GIMP/Phatch to resize them.
In terms of resizing, I compared the size of each new png with the original one, and resized. I know p0rkburn just resizes the images to 66%, but I've had problems with some images not coming out the right size that way. The other thing to watch out for is that not all the images need resizing. Also, some of the textfield and tab_select images are different proportions to their phone equivalents, so again watch out for that.
Once you've replaced the images you want to, they need to be put back into the .apk. I used to copy and paste into the framework-res.apk, but that doesn't work for 9patch files. Also, wdl1908's FrameWorkBuilder makes the compile process so ridiculously easy, there is no reason not to use that instead.
To put the new framework-res.apk on the device, I use this method via ADB wireless, which works fine.
Happy theming!
EDIT: 9patch files
These can be a PITA, until you understand how they work. I used the following two sources to finally crack it :
http://developer.android.com/guide/developing/tools/draw9patch.html
http://forum.xda-developers.com/showthread.php?t=580351
If you are changing 9patch files, you have to decompile and recompile using the FrameWorkBuilder.
I prefer using the draw9patch tool, as it lets you check that the 9patch works as expected.
Spent enough time bashing my head against a brick wall trying to sort out 9patch files, so if I can spare anyone else that, feel free to post/PM..
I'll leave this post here for my recommendations that will be more complex when you need to modify xml files.
In short the procedure is a follows (this needs to be expanded)
unpack the apk to framework-res-UNPACKED dir
decompile the apk to framework-res-DECOMPILED (with apktools)
copy framework-res-MOD to framework-res-DECOMPILED
compile framework-res-COMPILED (with apktools)
unpack the compiled apk to framework-res-COMPILED (with 7za)
remove all the files that are present in framework-res-MOD from the framework-res-UNPACKED dir
remove the file resources.arsc from framework-res-UNPACKED
copy all files from framework-res-UNPACKED to framework-res-COMPILED
zip all files in framework-res-COMPILED to the new framework-res.apk
remove the resources.arsc from that apk file
readd the resources.arsc file without compression to the new apk file
Done
The reason this is so complex is that their are bugs in apktools and the signature needs to be preserved.
FrameWorkBuilder v0.3
README.txt
-------------------------------------------------------------------------------------------------------
Place the script FrameWorkBuilder.sh in a directory and execute.
The script will download all the needed tools.
Place framework-res.apk in the dir framework-res-STOCK
Place mods in framework-res-MOD follow the usual directory structure.
Example:
framework-res-MOD
framework-res-MOD/res
framework-res-MOD/res/drawable-hdpi
framework-res-MOD/res/drawable-mdpi
framework-res-MOD/res/drawable
Execute FrameWorkBuilder.sh to apply the mod.
Modded framework-res.apk will be stored in the directory framework-res-MODDED.
-------------------------------------------------------------------------------------------------------
Changelog
-------------------------------------------------------------------------------------------------------
v0.3 Added xml png duplication check to avoid that animations don't work. .9.png support
v0.2 Added mod checks Added compile failure test
v0.1a BUGFIX cp dirs
v0.1 Initial version
-------------------------------------------------------------------------------------------------------
Have fun modding.
wdl1908 said:
I'll leave this post here for my recommendations that will be more complex when you need to modify xml files.
If you don't mind we'll make it a joined tutorial. I have no time now it's time I got some sleep.
Click to expand...
Click to collapse
I have no idea about editing XML files, but that was the next thing on my "To learn" list. I would be very happy for you to add your knowledge to this thread.
Also, if anyone has info to add/corrections to make, please feel free.
Good stuff, guys. At the very least we can make this a three man party.
The more the merrier!
Guys, can I ask what device you're both using?
fisha21 said:
Guys, can I ask what device you're both using?
Click to expand...
Click to collapse
A101IT with archangel root
A70IT with chulri's root
fisha21 said:
The more the merrier!
Click to expand...
Click to collapse
well, if i can do something, i'm here ;-)
wdl1908 said:
A101IT with archangel root
A70IT with chulri's root
Click to expand...
Click to collapse
Cool, thanks. Also, can I ask how you're viewing the XML files? Every program I've tried won't open them - keep getting error messages about invalid character content.
woti23 said:
well, if i can do something, i'm here ;-)
Click to expand...
Click to collapse
Welcome...
fisha21 said:
Cool, thanks. Also, can I ask how you're viewing the XML files? Every program I've tried won't open them - keep getting error messages about invalid character content.
Click to expand...
Click to collapse
You have to decompile the framework-res.apk with the apktools then all is revealed.
I have an A43it, and I find it to use a mixture of the hdpi and mdpi drawables, it is quite odd how they have it. I am drawing this conclusion because I only changed the hdpi drawables, and some things (status bar pull down for one) stayed original. I am going to work some more on it later today and will update here. My method for pushing to the device uses adb like such:
Code:
adb push framework-res.apk /sdcard/framework-res.apk
adb shell
su
stop
cp /sdcard/framework-res.apk /system/framework/framework-res.apk
chmod 644 /system/framework/framework-res.apk (only needs to be done the first time, as the permissions will adopt those when replacing in the future)
start
This causes the device to do a little soft-reboot (does not perform a proper full shutdown/reboot) that is pretty quick, and avoids any f/c situations you may encounter replacing the file while the system is live.
Edit 2 - ok, I just plain old missed the drawables earlier, they are all in hdpi for the A43. Posting screenshots of what I have put together shortly.
daveid said:
My method for pushing to the device uses adb like such:
Code:
adb push framework-res.apk /sdcard/framework-res.apk
adb shell
su
stop
cp /sdcard/framework-res.apk /system/framework/framework-res.apk
chmod 644 /system/framework/framework-res.apk (only needs to be done the first time, as the permissions will adopt those when replacing in the future)
start
This causes the device to do a little soft-reboot (does not perform a proper full shutdown/reboot) that is pretty quick, and avoids any f/c situations you may encounter replacing the file while the system is live.
Click to expand...
Click to collapse
Great I was looking for that.
wdl1908 said:
[*]compile framework-res-COMPILED (with apktools)
Click to expand...
Click to collapse
Getting stuck on the above step. Have got a folder called framework-res-DECOMPILED. When I try to compile it, the first message I get is:
Code:
w:Could not find sources.
It then runs through the process throwing up multiple error messages, and at the end I am left with an empty Build folder. Any ideas? I read on the Apktool thread that you need to add a classes.dex file to apk that don't already have one?
Thought I'd try your method as my primitive version keeps resulting in faulty apk's the last day or two!
fisha21 said:
Getting stuck on the above step. Have got a folder called framework-res-DECOMPILED. When I try to compile it, the first message I get is:
Code:
w:Could not find sources.
Click to expand...
Click to collapse
No problem there thats only a warning.
fisha21 said:
It then runs through the process throwing up multiple error messages, and at the end I am left with an empty Build folder.
Click to expand...
Click to collapse
What error messages?
fisha21 said:
Any ideas? I read on the Apktool thread that you need to add a classes.dex file to apk that don't already have one?
Click to expand...
Click to collapse
What version of apktools do you have?
never needed any classes.dex in framework-res.apk
fisha21 said:
Thought I'd try your method as my primitive version keeps resulting in faulty apk's the last day or two!
Click to expand...
Click to collapse
I'll try to cleanup my script and post it soon.
I just found out we can have custom boot animations on our gen 8 devices.
search for some bootanimation.zip on the web or go to UOT Kitchen and download one from the kitchen. place it in the directory /data/customization/ and reboot. This works even for the stock firmwares with archangel root.
Enjoy
I've added the first version of my FramWorkBuilder script in the second post.
wdl1908 said:
I've added the first version of my FramWorkBuilder script in the second post.
Click to expand...
Click to collapse
Thanks for the hard work!
Gave it a run through but get the following error messages:
Code:
Applying MOD...cp: cannot stat `/home/sarju/FWB/framework-res-MOD/*': No such file or directory
and
Code:
Copy files from UNPACKED to COMPILED that are not modified...cp: cannot stat `/home/sarju/FWB/WorkSpace/framework-res-UNPACKED/*': No such file or directory
The script is located in the "FWB" folder.
fisha21 said:
Code:
Copy files from UNPACKED to COMPILED that are not modified...cp: cannot stat `/home/sarju/FWB/WorkSpace/framework-res-UNPACKED/*': No such file or directory
The script is located in the "FWB" folder.
Click to expand...
Click to collapse
yeah download the 0.1a version and try again.
wdl1908 said:
yeah download the 0.1a version and try again.
Click to expand...
Click to collapse
Ok, think I'm just being stoopid here. Ran the v0.1a, no error messages BUT
If I use the folder structure "framework-res-MOD>drawable-mdpi", the resulting apk just has the original contents of drawable-mdpi. If I use "framework-res-MOD>res>drawable-mdpi", the resulting pak has an empty drawable-mdpi folder.
fisha21 said:
Ok, think I'm just being stoopid here. Ran the v0.1a, no error messages BUT
If I use the folder structure "framework-res-MOD>drawable-mdpi", the resulting apk just has the original contents of drawable-mdpi. If I use "framework-res-MOD>res>drawable-mdpi", the resulting pak has an empty drawable-mdpi folder.
Click to expand...
Click to collapse
the structure should look like this.
Code:
framework-res-MOD
framework-res-MOD/res
framework-res-MOD/res/drawable-hdpi
framework-res-MOD/res/drawable-ldpi
framework-res-MOD/res/drawable-mdpi
framework-res-MOD/res/drawable
but make sure you remove empty dirs.
I suspect it has to do with empty dirs I'll check that....
Nope tthats not it.
can you zip up the files files-to-remove.txt and log.txt in the WorkSpace dir and post them or via pm if thats possible.

built in htc [FM TRANSMITTER] dev needed.

this is an older tutorial i found for the evo way back. it needs to be updated..
this could possibly work on other android htc phones to that have the fm transmit capability....
the evos Broadcom chip has a built in fm receiver and also a transmitter.
according to some threads and diagrams ive seen the transmitter does have a power source, it just doesnt have and software code to actually work.
like hdmi the hardware was there but there was no code set up, therefore we didnt have full hdmi out. it had to be built from scratch.
the hardware for the fm transmitter is there we just need some one to build the code for it.
some one please take this on!!
This tutorial was originally posted in > android development and hacking > android software development.
i am reposting it here in the evo forums for guidelines
its a nice tutorial but its old. i think it was for android 2.0 ive followed the tutorial but i couldnt get it working, and i by no means have the experience to switch things up and get it working.
[TUTORIAL] Reverse engineering HTC FM Radio for noobs (on EVO 4G)
Okay, I'm writing this because I want to help any other newbies trying to learn how to reverse engineer. The technical details involved in this are extremely daunting, so the purpose of this tutorial is to first explain in layman terms exactly what you're trying to accomplish and what to expect. Then we'll go over the details. That way you're not completely blind going into this. I'm fairly new to the scene, so I'm not as knowledgeable as everyone else. If you see any errors in my post, let me know so I can change. I'm going to assume you know a little bit of Java, can find your way around a computer, and know nothing about Android. The techniques used should work with other Android phones. For this tutorial I'm using Windows 7, Cygwin, and my stock (not rooted) EVO 4G mobile phone.
The FM tuner for the Evo is run by a Broadcom chip: BCM4329. This chip is pretty amazing in that it does wireless, bluetooth, and it has an FM receiver/transmitter. We're interested in the FM receiver / transmitter.
Now, all android phones are based on a Linux kernel. Basically they're Linux running computers. The Android operating system is then installed onto the linux system. Every app is then run off of Android.
Android is based on Java but it is not a Java system. It uses a virtual machine called Dalvik. Google did this to get around licensing issues with Sun Microsystems. So they pretty much invented their own machine language (called byte code) for the Java language. This makes things complicated for the reverse engineer because from what I've read, once Java is converted into this machine language or byte code, it can't be converted back.
So let's rehash.
If you were programming strictly in Java, you would see these extensions:
Java source code = .java
Compiled Java source code = Java byte code = .class
Compressed file to package your program = .jar (Java Archive)
But since you're programming in Android and Dalvik, you will see these:
Java source code = .java
Compiled Java source code = Dalvik byte code = .dex
Compressed file to package your program = .apk
(I haven't mentioned this, but HTC further Optimizes their .dex code)
Optimized Dalvik byte code = .odex
I'm writing all of these down because it's very easy to get confused with all of the extensions. (for me at least!). remember how I said once you go dex, you can't go back to java? That's where JesusFreke comes in. He's a senior member of XDA, and he created "baksmali" and "smali", two programs that can convert the Dalvik code back into a human readable format. These files have extensions of .smali
Decompiled Dalvik byte code = .smali
But what can you do with .smali files? That's where this other senior member, brut.all comes in: He developed apktool. apktool takes JesusFreke's work to the next level. This program in conjunction with NetBeans, actually lets you trace through any program using the .smali code taken from JesusFreke's programs!
apktool does this by converting those .smali files into "fake" .java files that can be used by the NetBeans (program that compiles and makes java programs) IDE. I say "fake" because apktool embeds the .smali code into java files as comments. However, once you attach a debugger to NetBeans, you'll see that the debugger will follow line by line every execution statement found in the smali code!
So...... you can take the program you want, plug it into Net Beans using a debugger (using the default ddms command provided by Android SDK), and you can trace everything you do in the program. I have it connected to my phone, so whenever I push a button while running my HTC FMRadio app or unplug my headphones,I see the corresponding response to the HTCFMRadio code I have loaded in NetBeans. I can now see in real-time how the program operates from my own interactions... JAM.
Technical Aspects: How to get from ground zero to tracing HTCFMRadio?
1.) Download Android SDK - Go to google development site and follow instructions: Make sure to download the latest Java JDK. Once that is installed, download NetBeans 6.8. Unfortunately, smali debugging does not work with the lastest versions of NetBeans.
Download the "Java SE" version for minimal space
http://netbeans.org/downloads/6.8/index.html
You can follow the rest of Google walkthrough and download Eclipse and ADT plugin, but it's not pertinent to this. You're going to be using adb and ddms from the android SDK extensively, so make sure the path for </android SDK/tools> is included in the PATH variable in your ENVIRONMENT SETTINGS. To get here, right click My computer, click properties, Advanced Settings, ENVIRONMENT SETTINGS.
2.) Search for 7z and download it. It is an awesome and free compression tool that will be extremely useful. It can be used to "unzip" .jar, .apk, and other compressed formats.
3.) Get the Radio app. You can do this by going to "shipped-roms" website, downloading the latest Supersonic image, and following the directions in the unlockr tutorial for HTC kitchens at the unlockr website... (once you have extracted the files from the image, you can look in the system/app and system/framework directories to get the files listed below) or:
you can pull the following files from your phone:
Using the command prompt type (and with phone plugged in, and with USB debugging enabled on phone):
adb pull /system/app/HtcFMRadio.odex
adb pull /system/app/HtcFMRadio.apk
adb pull /system/framework ./framework
This will put HtcFMRadio.odex and HtcFMRadio.apk in the current directory and create a framework directory with more files. A couple of the files in the framework are needed for the HtcFMRadio app, but for simplicity, we're just going to pull the whole directory.
Now that we have the files, we have to make a few changes to make the app installable and to be viewable by the debugger. To do this we have to decompile the .odex format into a human readable format we can edit. That brings us to:
3.) Download baksmali and smali from Project Hosting on Google Code (google search smali).
Usually an Android application is made up of one file, an apk file. Inside the apk file is an AndroidManifest.xml file, a classes.dex file (compiled Java code for the program), and other folders. The other folders contain either graphics or other .xml files that tell the program how it should look to the user. We don't have to worry about those for now. This is important because APKTOOL only opens programs set up this way. But wait up? We didn't download one .apk file, we downloaded an .apk file and an .odex file! What gives? Well, if you right click the apk file and open it (using 7z), you'll see that it's missing the classes.dex file. The dex file for the app is actually the HtcFMRadio.odex file we downloaded. So, to make this system app more like a nominal app, we have to find a way to convert the HtcFMRadio.odex to a classes.dex file. That's easy with baksmali and smali!
Once you download goto command prompt and type:
java -jar baksmali-<version>.jar -d framework -x HtcFMRadio.odex
(Remember to match baksmali-<version>.jar with the filename of baksmali you downloaded)
If done correctly, you should see a newly created \out directory
This creates an out\com\htc\fm directory with many .smali files.
Now let's reverse the process and put it back as a dex file. Type at command prompt:
java -jar smali-<version>.jar out -o classes.dex
If done correctly you'll see a newly created classes.dex.
now, right click on HtcFMRadio.apk (select 7z and open). Drag classes.dex into the file. Say yes to the prompt. Now you have a normal apk file APKTOOL can read!
4.) Download APKTOOL from Project Hosting on Google Code and the helper apps for your OS. (If you're extracting files for windows OS you should have apktool.bat and aapt.exe). Extract (again using 7z, don't you love this program?) apktool.jar (keep it as a jar file, don't extract the stuff inside of it), apktool.bat, and aapt.exe to the directory you're working on. To make things neat, you can also delete HtcFMRadio.odex (you don't need it anymore) and classes.dex (make sure you put it in the HtcFMRadio.apk file first!)
If this is the first time you're using apktool, then you have to install the htc framework so apktool can baksmali the Radio app. You only have to do this once:
apktool if ./framework/com.htc.resources.apk
Alright, at the command prompt:
apktool d -d HtcFMRadio.apk
This extracts the contents of HtcFMRadio.apk and places them in the HtcFMRadio directory. However, there are two major differences between this content and the content created in step 3. If you go into the smali directory you'll see that instead of .smali files, you'll see .java files. And if you go back and edit the AndroidManifest.xml file, you will also see that it's in text! Android applications convert their xml files to binary format. Now that APKTOOL has converted everything to an IDE friendly format, we can use NetBeans to edit everything. The first thing we're going to do is edit AndroidManifest.xml (using notepad) and add the following:
android:debuggable="true" to the Application tag.
IT should now look like this:
<application android:theme="@android:style/Theme.Black.NoTitleBar" android:label="@string/fm_app_name" android:icon="@drawable/fm_radio" android:taskAffinity="android.task.fmradio" android:description="@string/htc_corp" android:allowTaskReparenting="true" android:debuggable="true">
This permission lets the debugger watch the program while it's running on the phone.
We are going to run into two problems if we try to install this program. One is that Android doesn't let you install more than one copy of a system app. The second issue is that if we change the signature of our system app, then we'll have to change the signatures of our other system apps as well! Ahh.... So, to get around that, we're going to trick Android into thinking we have a completely new program. We're going to do that by renaming the com.htc.fm class to com.htc.modradio class. Next step:
5.) Cygwin (or Linux virtual machine)
The easiest way that I can think of to replace strings in multiple files is by using linux. You can most definitely do it in WIndows, but I dont know how. If you let me know how, I can put it in this tutorial.
(update: you can use Notepad++ to easily find/replace strings in multiple files for Windows. You still, however, want to download Cygwin if you're going to develop with Android-NDK.)
For now, just search for Cygwin (Cygwin is a program that lets you run Linux commands from a command prompt using your Windows directories), and install it. Make sure to have the Perl option selected. You'll need Perl to make the following commands work.
Once you get Cygwin up and running
cd <to your HtcFMRadio directory>
in my case it's
cd /cygdrive/c/Users/Jerry/Desktop/HtcFMRadio
now type the following commands in this order:
this command changes all occurances of htc/fm to htc/modradio in your xml and .java files.
find ./ -type f | xargs perl -pi -e 's/htc\/fm/htc\/modradio/g'
this command changes all occurances of htc.fm to htc.modradio
find ./ -type f | xargs perl -pi -e 's/htc.fm/htc.modradio/g'
If you don't follow this order, your source code will get messed up.
If using cygwin, a bunch of .bak files will be created. Using windows search, find all .bak files in your HtcFMRadio directory, then select them all and delete them (Make sure they are only files with .bak!)
Now just rename the fm directory to modradio. It is located in HtcFMRadio/smali/com/htc
Now go to your windows command prompt and type:
apktool b -d .\HtcFMRadio modradio.apk
Now sign and install modradio.apk on your phone.
adb install modradio.apk
If you have never signed before, then you need to use keytool and jarsigner. These two files are in your JDK directory, so make sure you include your JDK directory in the PATH variable of your ENVIRONMENT SETTINGS. (To get here, right click on My Computer, click Properties, Advanced Settings, Environment Variables. Once you make change, open up a new COMMAND prompt to see changes).
cd to the directory which has modradio.apk
now type:
keytool -genkeypair
Answer all questions, then use the same password for all password prompts.
Next type:
jarsigner -verbose modradio.apk mykey
Type in the password you created in the above step. Your apk should now be signed.
Next install:
adb install modradio.apk
Success!
6.) Testing the app on phone
Go to your phone and you'll now see a new FMRadio icon next to your first. Click on it and watch it open. It should now be able to play music. Keep it open.
7.) Using Netbeans
Go into HtcFMRadio and delete the build directory created by APKTOOL.
Now open up Net Beans and click on File, New Project, Select Java Project with Existing Sources, click on Next
Select HtcFMRadio directory for Project Folder, rename Project Name to whatever you want. Let's type in ModRadio. click on Next
Next to "Source Package Folders" click on "Add Folder" and select the smali directory.
Click Finish. For a quick tutorial by Brut.all, search APKTOOL in youtube and click on: Apktool Demo 2 - Smali improvements
Right click on Libraries. Click on "Add Jar / Folder". You want to add Android.Jar. Since I have Android 2.1 loaded I went to /platforms/android-7 located in my android SDK directory.
Your project is now ready for editting!
8.) Running the Debugger to trace through program.
Next go back to Windows command prompt and type ddms. This runs the Dalvik Debug Monitor. A window should open up. In the left hand side you should see com.htc.modradio. That's our app! To the right you're going to see 2 numbers, you're interested in the one to the right, 4 cells away from com.htc.modradio. This number is a port number, and you're going to use it to communicate with NetBeans. (In my case it is 8603)
Go back to NetBeans and click on Debug, Attach Debugger.
In the host field type: localhost
In the Port field: type in the second number you saw. (8603)
If everything is working you'll see a bug appear next to com.htc.modradio in the Dalvik Debug Monitor. Look at the bottom bar of NetBeans for feedback. If you get errors make sure the numbers match, or try port 8700 and make sure you select com.htc.modradio in the Dalvik Debug Monitor. Port 8700 is the default port used for whatever program you select in Dalvik Debug Monitor.
9.) Setting a breakpoint
I'm making this a seperate step because it is completely arbitrary. When creating a break point be sure to follow this rule:
You must select line with some instruction, you can't set breakpoint on lines starting with ".", ":" or "#".
Rather than looking for a spot to breakpoint, though, I'll tell you where to put one so you can quickly see how the debugger traces through the code. You aren't "REQUIRED" to do the next step, but if you want to trace you have to put a breakpoint somewhere.
In Net Beans click on the Project tab, click on Source Packages, com.htc.modradio, and then doubleclick on BroadcomFMTuner.java
We're going to insert a breakpoint. Scroll down to line 3226 and on your keyboard press: CTRL-SHIFT-F8, select line in dropdown box and hit ok. (To keep it simple, I usually look for "invoke" instructions to set breakpoints at)
Now go to your phone and click on the physical "back" button on your phone. This will clear the radio,(you should still be able to listen to music). Drag your status bar down. You should see a radio icon. Click on it again. The radio backgroudn will appear, but you wont' see any text or anything. Now go back to your netbeans application. You should now see debug options highlighted! Click on Step Over (F8) to step through!
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
i found a few things.
http://pdf.eccn.com/pdfs/Datasheets/Broadcom/BCM4329.pdf
http://www.broadcom.com/products/Bluetooth/Bluetooth-RF-Silicon-and-Software-Solutions/BCM4329
Mad tutorial man! You have just opened up my world even more to Android. Thank you heaps.
BTW your freakin signature got me good damn you! I thought someone had hacked my PC LOL
Any chance that this will work with JB?. Can you post app?. Thanks.

Make Your Own Custom Keyboard Layout [For Noobs]

READ THIS ENTIRE GUIDE BEFORE ASKING QUESTIONS. READ THIS ENTIRE GUIDE BEFORE ATTEMPTING ANYTHING. READ THIS ENTIRE GUIDE FOR ALL THE HELPFUL INFORMATION CONTAINED IN IT. READ THIS ENTIRE GUIDE EVEN IF YOU KNOW WHAT YOU ARE DOING.
This guide is for anyone that would like to build their own custom keyboard with a customized layout with customized keys (hit one keyboard button and your entire email is filled in for you automatically). This method of hacking should work with other .apk files for similar endeavors. With this guide you should be able to create a custom keyboard based on the gingerbread keyboard. Read this entire guide before asking any questions. I have added information on the many things that have personally caused me errors. If you have problems with the program itself, post here asking for help, ask on the android developers's IRC channel, or read the FAQs posted about the different programs that must be used.
this is a windows 7 based guide; the only differences between W7 and other OS's is minor path changes and downloads (I don't think that android commander is available on Mac OSX)
Things that are required:
very basic commandline experience
APKtool
Signapk
android SDK installed and working (install all available packages if you do not know how to set up an emulator)
android commander -or- knowledge of how to install a custom .apk on your device
notepad -or- your favorite code editor
lots of debugging time, patience
an ability to navigate the above programs
**Common Commands**
1. apktool b <NAME OF DECOMPILED KEYBOARD FOLDER> <PATH LEADING TO YOUR FOLDER CONTAINING SIGNAPK (NAME THE FILE), READY TO COMPILE FOLDER>
2. java -jar signapk.jar testkey.x509.pem testkey.pk8 <NAMEOFFILE FROM ABOVE> <PATH TO YOUR ANDROID SDK TOOLS FOLDER>
3. adb install testsign.apk
#Protip: in Windows 7 (Vista?) hold the shift button as you right click in a folder to open a commandprompt in that directory
Command 1. is to be run from the directory holding your apk folder (do not go inside the decompiled apk folder; if you can see Android Manifest you've gone too far). The command will place the compiled apk folder into your signapk folder assuming you have set up the above commands correctly. As a side note, the compiled apk will be called "test.apk". If you want to decompile (go from an apk to "undone" folder just use "apktool d <NAME OF APK> <OUTPUT FOLDER NAME INCLUDING ITS DESIRED DIRECTORY {EX: c:\android-sdk\keyboard\gingerbredkeyboard}>
Command 2. will sign the apk file called "test.apk" and save the result in your tools folder inside your android sdk folder.
Command 3. will install the apk into your running emulator. This is optional since you can from here install the file onto your device to test things out. However, I highly recommend using the emulator because it is easier to deal with. This command will fail if your emulator has been left alone for a little while. Just do some sort of action in your emulated device to "wake it up" so that the command will find the running emulator. After you install the apk, you may need to delete the old apk before you install a newer version that you have created.
-----
Keyboard stuff
When you decompile the keyboard file, you'll see a bunch of folders, the main folders that you'll want to focus on are inside res\xml and res\values (res\drawable-Xdpi if you want to make a complete theme with new images). From here the xml files governing the keyboard layout should be readable by any xml editor (notepad). Some of my notes will be written below so you can use what I've discovered to generate your own code. As a quick note, the cases of letters count, you must be perfect in your xml code.
The xml files are all named with self explanatory names, just look down the list at the names and you should find what you're looking for.
values and xml folders with letters after it mean that those are aspects that are only going to work for a specific language; if you want to make global commands for any language on the keyboard use the xml files that do not have a suffix. From here you can be creative and hijack a language that you won't normally use and use it as your own personal keyboard with special keys and whatnot (a keyboard just for accented letters? personal word shortcuts?)
code examples:
android:keyLabel="Hi"
this line is what will show up on the keyboard key in question, as above, "Hi" will be printed on this key
androidopupCharacters="★"
this line is what will show up when you hold down the key in question, you will get options for ★ with this code; do not use commas to separate symbols/letters, each individual character will be it's own separate key
android:keyOutputText=";] " self explanitory, anything contained inside the quotes will be printed when the key is pressed, leave a space like I did after smilies so that you dont' have to hit the spacebar after using this key; see exceptions below
droid:keyEdgeFlags="left" is used in the <key> entry of anything on the left "edge" of a <row>
droid:keyEdgeFlags="right" same as above, but used on the rightmost key
EXCEPTIONS:
Certain characters are used in coding, if you don't enter them a special way, you will receive errors in your code when compiling or the key will simply not work. In order to use commands that "print" text with exceptions in them, prefix the exception with a "\". For example: android:keyOutputText="\@" will print the character "@". A list of known exceptions are listed below, there may be others. Special, special exceptions also exist where even prefixing it causes coding problems, in these cases, use its "name" in place of its actual character. For example: the ampersand character '&", you must use the code associated with it; see the "popup_punctuation.xml" file for some of these exceptions. There may be more exceptions that I have not come across. If you're having problems with your keyboard and cannot figure out why your key is not showing up correctly, try to treat it as an exception.
Characters that are exceptions:
#
@
?
"
IMPORTANT EXCEPTION:
I couldn't get the popup_comma.xml file to work with the above exceptions rule or with the keyoutputtext code
Putting it all together:
<Key android:keyLabel="\@G!" android:keyOutputText="cheval.de.jeanvaljean\@gmail.com" android:keyEdgeFlags="left"/>
The above will draw a key that's labeled "@G!" that yields "[email protected]" that is also the leftmost tag in a given row. Personally, I have added similar code to the above so that I have keys for the handles "@gmail.com" and "@yahoo.com" (along with my personal email so I never have to type it out all the way ever again) to the period key on the keyboard (in xml "popup_punctuation.xml"). I have also tweaked the smilies on the enter key to my own personal smilies. Assuming you've read the above and have some minimal xml experience you can figure out the rest for yourself. There are many other things that I have left out code-wise that I found to be extremely easy to figure out just by browsing the source code. As a personal tip to you, I recommend highly that you use the emulator as it is far easier than pushing files to your phone, deleting them, blah blah blah.
---
Have fun and good luck =]

Decompile/Recompile Jellybean APK's

Ok everyone, this is my first tutorial that I am ever putting out and I will try to be as thorough as possible. This tut is not so much for the people that dont know much about android, it is more for the people that understand most of it already. But as always feel free to read through it and start learning as most of us around here have! So without further a do lets get started!!
FIrst you need 7-zip!!! So go install it!!
So first, the first thing you need to do is go to this link and download the apktools and aapt that are in the zip:http://www.mediafire.com/?acrgcd0w850q0gj
After you extract this zip you will have a folder with all the tools we will need to do this!!!! Now, if you are doing this then you probably already have done it on Ice Cream Sandwich or Gingerbread. So the next thing we need to do is remove your "Environmental Variables". Environmental Variables are basically the commands that you can run in command prompt from any folder on the computer. If you have the android sdk or previously have tried to decompile and compile Apk's chances are you have the setups in the Environmental Variables.
Remove Unneeded Environmental :
1)Hit the start menu on the bottom left hand corner of Windows
2)Right-Click on Computer and select Properties
3)On the top left-hand corner select Advanced System Settings
4)A window comes up and select the button that says "Environmental Variables"
5)In the window that comes up there is two boxes. We are going to edit the bottom one labed "System Variables". Now grab the scroll bar and look for the variable Path. It should be under OS and above PATHEXT. Double-Click "Path" Variable
NOTE: Each path ends in a ";"
6) So now you will need remove every instance that would point to anything android related. For example one is "C:\SDK\platform-tools\;" If it has this then apktools will run the aapt.exe from that platform-tools folder instead of the one that is provided in the zip.
ALTERNATIVE: An alternative would be to delete the aapt that you have in your folder that you have in your Path System Variable.
I know this was not very clear but I again this is for the users a bit more advanced.
-------------------------------
DECOMPILE/COMPILE SystemUI.apk and other Apk's. EXCEPT framework-res.apk
Ok, you can do this however you want but for this tut I am going to extract apktools.zip and place the folder on my desktop. So we're going to open the folder and then place the APK we want to edit along with a JELLYBEAN framework-res.apk into the folder. For example if you want to edit a CM10 "SystemUI.apk" then you will pull the framework-res.apk from /system/framework/ folder nd place it in your desktop JBapktools folder.
Once you have both SystemUI.apk and framework-res.apk inside the JBapktools folder we are ready to start. First rename either one of these files "apktool149.jar" "apktool142.jar" "apktool144.jar" to just apktool.jar. REMEMBER only rename ONE cus we need to keep track of the versions of the apktools.
Next, bring up the folder window and anywhere on the white space hold SHIFT and Right-Click. Then youre going to choose open command window here.
The first command is going to be: java -jar apktool.jar if framework-res.apk
This is going to install the framework.
Now close out the window.
Next go back to the folder and make sure you rename the jar file you renamed earlier back to its original name. For example if you have apktool144.jar and apktool149.jar in the folder then you must rename apktool.jar to apktool142.jar because that is its original and actual version number.
To decompile and recompile SystemUI.apk you need apktool149.jar so once all three are named to their real names then rename apktool149.jar to apktool.jar.
Now,YOU ARE READY!!! Finally.
Again, In the folder SHIFT +Right-Click and select open command window here.
the command to decompile is: java -jar apktool.jar d SystemUI.apk
---------------------------------------------------------------------------------------
Then hit enter you should see something like this:I: Baksmaling...
testI: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\Jose\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
---------------------------------------------------------------------------------------
Of course it wont say Jose but it will say your User Accounts name.
Now in the folder you should see another folder in there called SystemUI. Now its DECOMPILED!!!!! WHOOOOO!!!!!!
You can make your edits and edit the pngs and xmls or the smali or whatever your guru-self wants to do.
Now to RECOMPILE!!!!!
To recompile we will still be using apktool149.jar so no need to rename anything back or whatever.
The first thing you should do is open the SystemUI.apk in 7-zip. You can right-click SystemUI.apk and in there, there should be a META-INF folder and a AndroidManifest.xml file. Select both of these be selecting one first(should be highlighted blue) the holding down Cntrl button and selecting the other file. Now that they are both selected click and drag out to apktools folder. We will need these files in a little bit.
Next in the command prompt window, or if you closed it, the reopen by SHIFT+Right-Click and selecting open command window here. The command to decompile is:
java -jar apktool.jar b SystemUI
NOTE:Make sure you use the letter "b" and dont add .apk to the end of it as we are recompiling the FOLDER and not an actual apk file like we do when decompiling.
It should say something like this:
I: Checking whether sources has changed...
I: Smaling
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...
Sounds very sexy when reading it I know but we aren't done yet. Remember the META-INF Folder and the AndroidManifest.xml file we pulled out earlier. Ok from the apktools folder select both files again by using Ctrl button. Now type Ctrl C. This will COPY these files to the clipboard. Now that we have the files copied go into SystemUI FOLDER and then go into build folder and then into apk folder. To make it look more neat navigate to /Desktop/apktools/SystemUI/build/apk/ . Now that you are in the apk folder hit Ctrl V. This will PASTE the META-INF and AndroidManifest.xml file into the folder. If a window comes up just choose COPY AND REPLACE.
Last thing to do before we can compile is to go into /SystemUI/dist/ and delete the apk file that is there. The recompiling process is almost complete!!! Go back to command prompt window and just push the ARROW UP on the keyboard. This should bring up the last command you typed in. If its not there then just type it in again:
java -jar apktool.jar b SystemUI
The final apk file should be in SystemUI/dist/ folder!!!!
If you are having any aapt problems then you probably still have a path in Environment Variables that has an aapt.exe in it. Other than that askk and I'm sure myself or someone else can help!!
I will be putting up the how to decompile/recompile framework-res.apk in 2nd post tomorrow or soon because I dont have time right now. The process is different. Have fun themeing and doing whatever it is you do!!!
Added a donate link guys. I'm only 16 so I can't say buy me a beer! So how bout half a gallon of gas? That would be great. Let me know if you donated to I can thank you and put you in my posts!! I have a passion for doing these things so I do not expect any donations from anyone. I do it because I love it and can't get enough of it!! Thanks everyone for being supportive
Donations: Marcismo55
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=GL7RKF2EGCH68
FUERRER!!!
1 more just in case
nice
Sent from my Axiom Infekted Razr Maxx using Xparent ICS Blue Tapatalk
Hey man, nice write up. Always good to see people share information.
However, you made it WAY more complicated than it needs to be.
+1 either way. Get you some gas.
_Burst_ said:
Hey man, nice write up. Always good to see people share information.
However, you made it WAY more complicated than it needs to be.
+1 either way. Get you some gas.
Click to expand...
Click to collapse
Sorry man I tried my best :b. And thanks!
Sent from my SPH-L710 using XDA App
Hi,
I was just wondering if the is anyway to decompile the framework-res.apk
I have been trying for ages, but it always gives me errors.
Thanks in advance
Cheers
Corey
fishingfon said:
Hi,
I was just wondering if the is anyway to decompile the framework-res.apk
I have been trying for ages, but it always gives me errors.
Thanks in advance
Cheers
Corey
Click to expand...
Click to collapse
Grab an ICS framework-res apk. Replace manifest resources.arsc and res from the ICS apk with the one from jb apk. Then dexompile with apktool142.jar and then edit. Then recompile with apktoll144.jar. then open the apk that recompiled and take out manifest resources.arsc and res and place back in jb framework sorry if its to confusing. But just a quick write up
Sent from my SPH-L710 using XDA App
monstaX said:
Ok everyone, this is my first tutorial that I am ever putting out and I will try to be as thorough as possible. This tut is not so much for the people that dont know much about android, it is more for the people that understand most of it already. But as always feel free to read through it and start learning as most of us around here have! So without further a do lets get started!!
FIrst you need 7-zip!!! So go install it!!
So first, the first thing you need to do is go to this link and download the apktools and aapt that are in the zip:http://www.mediafire.com/?acrgcd0w850q0gj
After you extract this zip you will have a folder with all the tools we will need to do this!!!! Now, if you are doing this then you probably already have done it on Ice Cream Sandwich or Gingerbread. So the next thing we need to do is remove your "Environmental Variables". Environmental Variables are basically the commands that you can run in command prompt from any folder on the computer. If you have the android sdk or previously have tried to decompile and compile Apk's chances are you have the setups in the Environmental Variables.
Remove Unneeded Environmental :
1)Hit the start menu on the bottom left hand corner of Windows
2)Right-Click on Computer and select Properties
3)On the top left-hand corner select Advanced System Settings
4)A window comes up and select the button that says "Environmental Variables"
5)In the window that comes up there is two boxes. We are going to edit the bottom one labed "System Variables". Now grab the scroll bar and look for the variable Path. It should be under OS and above PATHEXT. Double-Click "Path" Variable
NOTE: Each path ends in a ";"
6) So now you will need remove every instance that would point to anything android related. For example one is "C:\SDK\platform-tools\;" If it has this then apktools will run the aapt.exe from that platform-tools folder instead of the one that is provided in the zip.
ALTERNATIVE: An alternative would be to delete the aapt that you have in your folder that you have in your Path System Variable.
I know this was not very clear but I again this is for the users a bit more advanced.
-------------------------------
DECOMPILE/COMPILE SystemUI.apk and other Apk's. EXCEPT framework-res.apk
Ok, you can do this however you want but for this tut I am going to extract apktools.zip and place the folder on my desktop. So we're going to open the folder and then place the APK we want to edit along with a JELLYBEAN framework-res.apk into the folder. For example if you want to edit a CM10 "SystemUI.apk" then you will pull the framework-res.apk from /system/framework/ folder nd place it in your desktop JBapktools folder.
Once you have both SystemUI.apk and framework-res.apk inside the JBapktools folder we are ready to start. First rename either one of these files "apktool149.jar" "apktool142.jar" "apktool144.jar" to just apktool.jar. REMEMBER only rename ONE cus we need to keep track of the versions of the apktools.
Next, bring up the folder window and anywhere on the white space hold SHIFT and Right-Click. Then youre going to choose open command window here.
The first command is going to be: java -jar apktool.jar if framework-res.apk
This is going to install the framework.
Now close out the window.
Next go back to the folder and make sure you rename the jar file you renamed earlier back to its original name. For example if you have apktool144.jar and apktool149.jar in the folder then you must rename apktool.jar to apktool142.jar because that is its original and actual version number.
To decompile and recompile SystemUI.apk you need apktool149.jar so once all three are named to their real names then rename apktool149.jar to apktool.jar.
Now,YOU ARE READY!!! Finally.
Again, In the folder SHIFT +Right-Click and select open command window here.
the command to decompile is: java -jar apktool.jar d SystemUI.apk
---------------------------------------------------------------------------------------
Then hit enter you should see something like this:I: Baksmaling...
testI: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\Jose\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
---------------------------------------------------------------------------------------
Of course it wont say Jose but it will say your User Accounts name.
Now in the folder you should see another folder in there called SystemUI. Now its DECOMPILED!!!!! WHOOOOO!!!!!!
You can make your edits and edit the pngs and xmls or the smali or whatever your guru-self wants to do.
Now to RECOMPILE!!!!!
To recompile we will still be using apktool149.jar so no need to rename anything back or whatever.
The first thing you should do is open the SystemUI.apk in 7-zip. You can right-click SystemUI.apk and in there, there should be a META-INF folder and a AndroidManifest.xml file. Select both of these be selecting one first(should be highlighted blue) the holding down Cntrl button and selecting the other file. Now that they are both selected click and drag out to apktools folder. We will need these files in a little bit.
Next in the command prompt window, or if you closed it, the reopen by SHIFT+Right-Click and selecting open command window here. The command to decompile is:
java -jar apktool.jar b SystemUI
NOTE:Make sure you use the letter "b" and dont add .apk to the end of it as we are recompiling the FOLDER and not an actual apk file like we do when decompiling.
It should say something like this:
I: Checking whether sources has changed...
I: Smaling
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...
Sounds very sexy when reading it I know but we aren't done yet. Remember the META-INF Folder and the AndroidManifest.xml file we pulled out earlier. Ok from the apktools folder select both files again by using Ctrl button. Now type Ctrl C. This will COPY these files to the clipboard. Now that we have the files copied go into SystemUI FOLDER and then go into build folder and then into apk folder. To make it look more neat navigate to /Desktop/apktools/SystemUI/build/apk/ . Now that you are in the apk folder hit Ctrl V. This will PASTE the META-INF and AndroidManifest.xml file into the folder. If a window comes up just choose COPY AND REPLACE.
Last thing to do before we can compile is to go into /SystemUI/dist/ and delete the apk file that is there. The recompiling process is almost complete!!! Go back to command prompt window and just push the ARROW UP on the keyboard. This should bring up the last command you typed in. If its not there then just type it in again:
java -jar apktool.jar b SystemUI
The final apk file should be in SystemUI/dist/ folder!!!!
If you are having any aapt problems then you probably still have a path in Environment Variables that has an aapt.exe in it. Other than that askk and I'm sure myself or someone else can help!!
I will be putting up the how to decompile/recompile framework-res.apk in 2nd post tomorrow or soon because I dont have time right now. The process is different. Have fun themeing and doing whatever it is you do!!!
Added a donate link guys. I'm only 16 so I can't say buy me a beer! So how bout half a gallon of gas? That would be great. Let me know if you donated to I can thank you and put you in my posts!! I have a passion for doing these things so I do not expect any donations from anyone. I do it because I love it and can't get enough of it!! Thanks everyone for being supportive
Donations: Marcismo55
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=GL7RKF2EGCH68
Click to expand...
Click to collapse
Can you edit Contacts.apk?
I am trying to modifying Jelly Bean Contacts.apk. The original Contacts.apk is from Helly Bean. Using apktool that has been used for ICS and other Jelly Bean apks, I can decompile and then recomplie it without any error. However, the recompiled Contacts.apk would not work in cell phone, showing a message "Unfortunately, Contacts has stopped!".
To simplify the problem, I simply do decompiling and then recompiling without any modifications. I found that the size of resources.arsc has been changed from 1480 KB to 1525 KB. The new Contacts.apk causes FC!
Note: Files in smali folder can still be modified. After editing, use apktool to recompile and create a new apk. Then use WinRAR or 7zp to drag the newly created classes.dex into the original Contacts.apk. Such a "modified" Contacts.apk works properly. Note here that we did not modify resources.arsc.
This problem is only related to resources.arsc!!!!!!!
SunnyOKOK said:
Can you edit Contacts.apk?
I am trying to modifying Jelly Bean Contacts.apk. The original Contacts.apk is from Helly Bean. Using apktool that has been used for ICS and other Jelly Bean apks, I can decompile and then recomplie it without any error. However, the recompiled Contacts.apk would not work in cell phone, showing a message "Unfortunately, Contacts has stopped!".
To simplify the problem, I simply do decompiling and then recompiling without any modifications. I found that the size of resources.arsc has been changed from 1480 KB to 1525 KB. The new Contacts.apk causes FC!
Note: Files in smali folder can still be modified. After editing, use apktool to recompile and create a new apk. Then use WinRAR or 7zp to drag the newly created classes.dex into the original Contacts.apk. Such a "modified" Contacts.apk works properly. Note here that we did not modify resources.arsc.
This problem is only related to resources.arsc!!!!!!!
Click to expand...
Click to collapse
Not to sure bud. But try the Tut I put up before your post. If not it might need to be compiled from source so nothing will be broken
Sent from my SPH-L710 using XDA App
Thank you. Can I use Eclipse to edit the source code? Any ideas?
SunnyOK said:
Thank you. Can I use Eclipse to edit the source code? Any ideas?
Click to expand...
Click to collapse
Not to sure on that either man. Sorry
Sent from my SPH-L710 using XDA App
I get errors on installing framework!
Any ideas?
i am getting error is there any way to solve.... check attachment image
I'm gonna try this guide. It seems like the last step is something I haven't done in my current journey with recompiling apks.
tapatalked² from cowsquadGnex®
---------- Post added at 08:49 AM ---------- Previous post was at 08:48 AM ----------
sahil001 said:
i am getting error is there any way to solve.... check attachment image
Click to expand...
Click to collapse
Do you have java installed on your system?
tapatalked² from cowsquadGnex®
cowsquad said:
I'm gonna try this guide. It seems like the last step is something I haven't done in my current journey with recompiling apks.
tapatalked² from cowsquadGnex®
---------- Post added at 08:49 AM ---------- Previous post was at 08:48 AM ----------
Do you have java installed on your system?
tapatalked² from cowsquadGnex®
Click to expand...
Click to collapse
i haved installed but which particular version do you recommend me and if possible please share downloading link
sahil001 said:
i haved installed but which particular version do you recommend me and if possible please share downloading link
Click to expand...
Click to collapse
Just Google how to install java jdk in windows. There are plenty tutorials. You need java JDK
Edited:
Make sure your java is in your windows system variables. Step 6 on this guide
tapatalked² from cowsquadGnex®
cowsquad said:
Just Google how to install java jdk in windows. There are plenty tutorials. You need java JDK
Edited:
Make sure your java is in your windows system variables. Step 6 on this guide
tapatalked² from cowsquadGnex®
Click to expand...
Click to collapse
Ok ill try and let u know if it works or not
Ѕєит fяσм ๓ұ gαℓαχу S2®
sahil001 said:
Ok ill try and let u know if it works or not
Ѕєит fяσм ๓ұ gαℓαχу S2®
Click to expand...
Click to collapse
Did it work man?
tapatalked² from cowsquadGnex®
cowsquad said:
Did it work man?
tapatalked² from cowsquadGnex®
Click to expand...
Click to collapse
No
Ѕєит fяσм ๓ұ gαℓαχу S2®

Categories

Resources