How-To's - Motorola Photon 4G

How to modify your framework-res.apk
There are plenty of "How-to's" out there that I've seen for modifying the framework-res.apk. I've tried probably 20 of them...all resulted in getting stuck in a bootloop. Finally figured out a method that works.
Here goes:
THIS IS FOR LINUX BASED USERS
Go to www.jokersax.com and grab my tool.zip under Th3Bill Mods
Extract it in your HOME folder
Inside it you will find 2 versions of apktool. There is a good reason for that, which you will see later.
You also need a good xml editor like Editra (available in most distros packages)
Need an archive manager as well (I recommend File Roller)
[COLOR="green"[B][U]]Initial Setup:[/U][/B][/COLOR][/SIZE]
[SIZE="3"]1) Open your Home folder and select to show hidden files
2) Open your .bashrc file
3) Add the following lines to the bottom of the file
export PATH=${PATH}:~/bin
export PATH=${PATH}:~/tool/reg
export PATH=${PATH}:~/tool/ics
Then save the file
4) Open your .profile file
5) Add the following line to the bottom of the file
PATH="$HOME/tool/ics:$HOME/tool/reg:$PATH"
Then save the file.
Now, on to editing
1) Navigate to the framework folder that your framework-res.apk is in.
2) Open a terminal
3) Type in "reg if framework-res.apk" no quotations and press Enter
4) Type in "reg d framework-res.apk" no quotations and press Enter Now minimize terminal (you'll use it later)
5) You should see in your file manager the folder called framework-res. This is your decompiled framework-res.apk
6) Make your edits. be careful....this file controls a TON of things in your system, and you can make some major problems for yourself if you edit things incorrectly.
7) Once your edits are done, go back to your terminal session
8) Type in the following "ics b framework-res" no quotations (where *username* is your account username) and press Enter.
9) It should recompile correctly. You'll have a framework-res.apk in the /framework-res/dist folder. DO NOT USE THIS ONE WILL CAUSE BOOTLOOPS!!
10) Open it with an archive manager and extract the resources.arsc as well as any files you edited in the xml folder.
11) Go back to your ORIGINAL framework-res.apk and open (not extract) it in your archive program
12) Add in the files you extracted from the edited framework-res.apk, placing them in the appropriate folders
13) You're done!
Cheers!
P.S. If you get a recompile error that mentions plurals, you have some work to do. Go to the values folders one at a time and look for the plurals.xml files. You will see a bunch of entries....scroll all the way down till you see a section that looks like this:
<plurals name="matches_found">
<item quantity="other">%d of %d</item>
<item quantity="one">1 match</item>
you need to edit this section to look like this:
<plurals name="matches_found">
<item quantity="other">%1$d of %2$d</item>
<item quantity="one">1 match</item>
This must be done for EACH plural.xml file...placing 1$ behind the first % and 2$ behind the second one. Save each as you go. Then recompile, and you should be good to go.
HOW TO LOGCAT PROPERLY
Here's how to logcat so that a dev can actually help fix your issue
SETUP
1) Download Android SDK from HERE
2) Place it directly in your HOME folder
3) Extract the file there and rename the folder android-sdk
4) Go to the platform-tools folder and double-click android
5) Download at least the tools and platform-tools. You can download other stuff, but that's unnecessary for this exercise.
6) Close SDK when it's done
Now to LOGCAT
1) Navigate to the /platform-tools folder.
2) Open a terminal
3) Type in either A or B depending on your system
A) (works on Ubuntu derivatives)
sudo ./adb kill-server
sudo ./adb start-server
B) (Suse, Fedora, etc)
su
(enter your password)
./adb kill-server
./adb-start-server
Now, the server should be running....leave it open!
4) Plug your phone into the PC (making sure that if it's ON, that you have android debugging enabled...or the proper edit in build.prop listed below)
5) If your phone is OFF(meaning you can't get it to boot from a rom/mod you did), follow A). If your phone is ON (meanint working but has a FC somewhere), follow B)
A) Type into the terminal the following
./adb logcat -C
and press enter. Should say waiting for device. Turn on your phone. When it gets to a section where you see a large amount of red pass by on the screen (like 8-10 lines), go to step 6
B) Be sure to turn off ALL apps that are NOT related to your FC (this makes it nice and neat for us to read the logcat)
Open terminal and type in the following
./adb logcat -C
and press enter. You should see it start to log stuff...it'll be going by really fast...don't worry about that right now.
NOW, do whatever it is that fcs (open the app, process, etc) and wait for it to FC. When it does, go to step 6
6) With the Terminal being your primary window in the PC, Press Ctrl +Z. This will stop the logcat output
7) Search through the logcat for the section with all the red (you'll see a bunch of E's). Don't cut this up on us...we may need some of the other info
8) Select about 30-40 lines ABOVE the red error section through about 10-20 lines AFTER the error section
9) Paste this into Pastebin. Please don't send us this in an e-mail...it just looks a hot mess that way.
10) Link to the Dev.
CHEERS!​

Blank flashable zip
For all of you out there wanting to flash an app or framework file, here is a flashable zip that is blank. It contains instructions inside it, so PLEASE
READ THE FILE LABELED "READ ME FIRST!!!!"
This will make a simple process of flashing the items you want to flash.
CHECK POST 8 FOR CORRECTED INFORMATION
Any questions...ask me

Could we use this to turn our phones into a space/time bending machine??
Lol jk. Thanks for the information and flash able zip!!!
Sent from my MB855 using XDA

tsdeaton said:
Could we use this to turn our phones into a space/time bending machine??
Lol jk. Thanks for the information and flash able zip!!!
Sent from my MB855 using XDA
Click to expand...
Click to collapse
Don't I wish...or an intelligence enhancer...LOL
Glad to share

th3bill said:
don't i wish...or an intelligence enhancer...lol
glad to share
Click to expand...
Click to collapse
lmao! +1476930593

Bad ass thread buddy thanks for the how to's and blank flash zips these will surely come in handy....
MIUI/ICS for the Photon
http://forum.xda-developers.com/showthread.php?t=1536161

For deodexed I'm guessing.

Th3Bill said:
For all of you out there wanting to flash an app or framework file, here is a flashable zip that is blank. It contains instructions inside it, so PLEASE
READ THE FILE LABELED "READ ME FIRST!!!!"
This will make a simple process of flashing the items you want to flash.
If you wish to flash other items, you simply need to make sure that the item you want is in the folder it would be in within your phone, so if you want something to go into /system/lib, make sure that you create a folder /lib inside the /system folder in the zip and put the file inside that folder.
Any questions...ask me
Click to expand...
Click to collapse
Also, I should add that I forgot something in the explanation for this file. Wherever you are putting the file you're flashing (app, framework), you will need to adjust the permissions portion of the updater-script to show that file. Otherwise, you will set your entire /system to those permissions and you will get wonderful boot-loops
So, for app Music.apk, that line would look like:
set_perm(0, 0, 0755, 0644, "/system/app/music.apk");
Here is the updated file with the corrected instructions inside it Sorry for any issues fellas!
Blank CWM2.zip
Go to the site to download the file
Cheers!

TOOLS
Who doesn't love tools?
I've seen a lot of confusion over which versions to use for decompiling. Magic values being off with the current version of Android being pushed to 4.0.4.
Here's a helpful little tool kit. Disclaimer: It's for Linux based systems(save for the Androidsuite). I will try to find all these for Windows at some point, but with MIUI for Photon and Atrix, CNA for Photon, and Kitchen Sinks for both Photon and Atrix, I'm spread a little thin for some of these how-tos. I will post more soon once Kitchen Sink is Beta.
Tool.zip
Go to the site and download the file.
There's a small file inside with an explanation of each tool. NOTE: I put that Android suite works in Wine. It does not. It will OPEN and look like it might work, but does not recompile or decompile anything. It's a windows only wonder...LOL

Is there any way you'd be able to write up a How-To on how to use Diff/Patch in the laments terms, with Android specific type files directions cuz I'm trying to figure it out but since all the info I find is for applying it to everything other than Android. I'm on a mac and have it all setup correctly but I fk shyt up cuz I lose a step or something.
By the way, thanks for this How to also. Awesome.
MoPhoACTV Initiative

moonzbabysh said:
Is there any way you'd be able to write up a How-To on how to use Diff/Patch in the laments terms, with Android specific type files directions cuz I'm trying to figure it out but since all the info I find is for applying it to everything other than Android. I'm on a mac and have it all setup correctly but I fk shyt up cuz I lose a step or something.
By the way, thanks for this How to also. Awesome.
MoPhoACTV Initiative
Click to expand...
Click to collapse
What are you trying to do? You looking to do rom porting? Try to change some features? Change colors in a menu? Need a bit more info. Depending on what you're wanting to do will determine what the steps will be.

Idiots guide to porting ROMs for Photon, now THAT would be great. Sure it'd be a PITA and 3/4 to make though lol, great work on keeping up this how-to thread and all your ROM work!

w0lf215 said:
Idiots guide to porting ROMs for Photon, now THAT would be great. Sure it'd be a PITA and 3/4 to make though lol, great work on keeping up this how-to thread and all your ROM work!
Click to expand...
Click to collapse
<<<[----RECOGNIZED CONTRIBUTOR now
I feel bad that I haven't written more "how to's" in a while, but with 6 downloads I'm currently doing (MIUI Photon, MIUI Atrix, CNA Photon, Kitchen Sink Photon, Kitchen Sink Atrix, TabletUI Photon), I'm being spread pretty thin....LOL. It's all good. I love doing this stuff.
I promise to write more of these as I get a chance. I like to have more people help with stuff.

Th3Bill said:
<<<[----RECOGNIZED CONTRIBUTOR now
I feel bad that I haven't written more "how to's" in a while, but with 6 downloads I'm currently doing (MIUI Photon, MIUI Atrix, CNA Photon, Kitchen Sink Photon, Kitchen Sink Atrix, TabletUI Photon), I'm being spread pretty thin....LOL. It's all good. I love doing this stuff.
I promise to write more of these as I get a chance. I like to have more people help with stuff.
Click to expand...
Click to collapse
I noticed that a little while ago, Congrats on the new title thats whats up.
btw check your pm

moonzbabysh said:
I noticed that a little while ago, Congrats on the new title thats whats up.
btw check your pm
Click to expand...
Click to collapse
Check yours...got a book in there for ya...LOL

Updated OP How Tos.....Framework-res edit and Logcatting

Th3Bill said:
Updated OP How Tos.....Framework-res edit and Logcatting
Click to expand...
Click to collapse
Just setting up on pc. Ready to try this. You may be hearing from me! LOL

Related

You're all going to hate me, but how do I go about creating a CM7 Theme?

I looked around and found a whole lot of nothing.
halp
Re
To create a theme your going to want to edit the visual ui of the phone. A good place to start is the systemui.apk and the main theme of the phone, in cm7's case, the cyanbread and system themes witch you can also find in system/app. Bassically with the systemui.apk and theme you are editing of your choice will be the finished product if your just starting, making a theme from scratch is a bit more complicated. As for boot animations that I believed is located in data/local and fonts should be in a folder for them selves I cannot think of the topr off of the top of my head but it is easy to identify I'm sure.
the way I edit and make themes is use the above apk's and just go crazy with transparencys and colors in gimp. Be in mind your going to need a Linux based os to edit the apks and place and take them from your zip rom your theming. I also think ther might be a apks editor for windows but idk what it is called.
Re
To create a theme your going to want to edit the visual ui of the phone. A good place to start is the systemui.apk and the main theme of the phone, in cm7's case, the cyanbread and system themes witch you can also find in system/app. Bassically with the systemui.apk and theme you are editing of your choice will be the finished product if your just starting, making a theme from scratch is a bit more complicated. As for boot animations that I believed is located in data/local and fonts should be in a folder for them selves I cannot think of the the closer off of the top of my head but it is easy to identify I'm sure.
the way I edit and make themes is use the above apk's and just go crazy with transparencys and colors in gimp. Be in mind your going to need a Linux based is to edit the apks and place and take them from your zip Tom your theming. I also think there might be a apks editor for windows but idk what it is called.
ya you are going to need to have the android sdk setup for the ADB and then you will use something like apk manager for pulling, extracting, decompiling, image edits, or xml edits which you can find here:
http://forum.xda-developers.com/showthread.php?t=695701
you will need the SDK setup first
which can be found here:
http://forum.xda-developers.com/showthread.php?t=834748
and here
http://developer.android.com/sdk/index.html
then you need to know simple ADB commands like:
"adb pull /system/app/Mms.apk" and push command which is "adb push Mms.apk /system/app/"
more commands here:
http://developer.android.com/guide/developing/tools/adb.html
and
http://androidforums.com/evo-4g-all-things-root/187820-how-adb-commands.html
it is also a GOOD idea to learn to use Eclipse for the compiling of the .9.png files which cannot be just simply edited and saved like a normal .png file can.
NOTE: the best way to edit the .9.png files are going to be with the Draw9Patch tool that is included in the SDK and draw the black lines (guides) this is located in the tools folder and then you use Eclipse to compile .. get rid of the black lines pretty much.
info about the .9.png can be found here:
http://forum.xda-developers.com/showthread.php?t=487001
info for eclipse, like how to set it up and download it is here:
http://developer.android.com/sdk/eclipse-adt.html#installing
does say to use the classic version of Eclipse.
once you have all of that figured out then you are pretty good. But there are other stuff to learn to like the programs themselves and stuff .. you will have to look on Google a lot .. I know that there isnt anything much there about any of this stuff .. I kid you not .. it took me a good 2 days to figure out how to use the apk manager and eclipse and how to alter the .9.png files. That was from getting bits and pieces off the web and a lot of trial and error .. the support around here sucks so dont expect much.
there is also a video that shows you how to setup the sdk along with the eclipse that is here
http://www.youtube.com/watch?v=OIL1UouA4dE
just use the previous links above to get the stuff like the sdk is at version 10 now and then the Eclipse Classic.
If this is too much for you to do and figure out then you are out of luck.
Yeah, I've used ADB and Eclipse before. I'm quite ****e at Eclipse, but I guess I could mozy around a bit and see if I could get the hang of it enough to do themes. I'm really eager to do that stuff.
Anyway, is there anything I'll have to look out for in regards to turning my phone into a lovely paperweight?
wauterboi said:
Yeah, I've used ADB and Eclipse before. I'm quite ****e at Eclipse, but I guess I could mozy around a bit and see if I could get the hang of it enough to do themes. I'm really eager to do that stuff.
Anyway, is there anything I'll have to look out for in regards to turning my phone into a lovely paperweight?
Click to expand...
Click to collapse
eh nothing that I have come across or know about.
so if you know ADB and a little with eclipse . what exactly are you trying to figure out?
Right now I'm trying to figure out how to open the APK. I used WinRAR to open the file and now when I try to open it in Eclipse, it just opens WinRAR. >_>
wauterboi said:
Right now I'm trying to figure out how to open the APK. I used WinRAR to open the file and now when I try to open it in Eclipse, it just opens WinRAR. >_>
Click to expand...
Click to collapse
the easiest and the best method is to use that apk manager that I linked in there and use that to extract the apk after you pull it from the phone using ADB
I usually use the adb pull /data/app and adb pull system/app to get all the apk files out at the same time.
after they are out you will put the ones you want to alter (up to 10 at a time) into the place apk here for modding folder and then open apk manager terminal ..
1) type 22 to select the apk that you want to mod.
2) then you will type 1 to extract it.
3) then you can go to the projects folder to see the extracted apk contents.
- usually the images that you want to alter will be in the res/drawable or the
res/drawable-hdpi or res/rawable-hdpi longfinger
- also some of the apps that do not use the .9.png files you will have to find
the image in two folders ... one for portrait mode and landscape mode.
alter the images you want and put them in the original folder.
4) then you will optimize the images which is option number 2.
5) then you will sign the apk which is number 3.
- if it is a system app select the correct option
6) then you will see an unsignedsomething.apk in the place apk here for modding.
7) to sign the apk you will hit number 4.
8) and then number 5 to zipalign the apk.
when you go back to your place apk here for maodding folder you will see that the unsignedsomething.apk is now signedsomething.apk
then you will push that to your phone using the adb/push something.apk /sdcard
then simply install the apk from the phone ... may have to uninstall the original app first.
winrar will not open the apk .. 7zip will . but i rarely use this as I cannot see the thumbnails for the images and cannot optimize the apk with it or anything else for that matter.
Here is a link to the wiki for the T-Mobile Theme Engine.
http://code.google.com/p/tmobile-themes/w/list

[HOW TO] Make your own Splash Screen

First off, none of this is my work, I just did some leg work to find the bits and bring them together here for the Shift. This is not difficult, if you have a little 'puter know how you should be fine.
Disclaimer: You break your $hit, maybe you should re-evaluate your life and all things android, I am not responsible.
Things you will need:
Computer (may seem obvious, but you never know)
Image editing software: Gimp, Photoshop, Etc...
nbimg converter: This is a command line tool, no it will not do anything if you dl it and double click the icon.
7Zip or other compression client.
1 PG06IMG.zip file
If you don't have a computer, stop now...
If you don't have editing software, do a search for Gimp dl (free)
Make sure your graphic is 480x800 pxls and saved as a .bmp @ 24 bit (chk the advanced settings when you save)
nbimg is the program that converts the .bmp into a useable format for the phone. This can be found here, Thanks pof, a link to the linux version is there as well. Mac users can look here, Thanks romracer. I haven't used a mac in almost 20 years, someone please report back on your experience with this.
7Zip you can find online, or use whatever you prefer.
PG06IMG.zip can be picked up here,Thanks riggsandriod. The ini file inside it is the important thing, we are simply swapping out the .img file w/ one of our making.
Now nbimg is dl'd, no don't double click, it will not install
Move nbimg to folder of your choice (might I recommend your andriodsdk folder, or sub folder)
Move your finished pic to the same folder.
Rename pic to: Splash1.bmp
Open command line (start-> run-> type: cmd)
cd to appropriate folder, e.g. cd D:\AndroidSDK
type: "nbimg.exe -F Splash1.bmp" <no quotes>press enter.
A note here, I have had success w/out adding any extra commands, results may vary.
Now you have a new file: Splash1.bmp.nb in that folder, rename the ext from .bmp.nb to .img
Right click PG06IMG.zip, 7Zip, open archive: drop in your new Splash1.img file.
Done, now just need to move the zip to the root of your SD card, boot to bootloader & accept the update.
Other options...
Maybe this is a bit much for some folks, im.nick.hello has graciously offered to make these for folks here, be sure to thank him if he helps you out.
TruBlue_Drew has made a script to automate this process here, I haven't tried it, might help some folks out.
If I missed anything, let me know.
Reserved:
Hopin some folks give insight to mac & linux variations.
Sent thru the "tubes" via my shifty speed brick.

Theming Guide Help.. These are the things I dont see How-Tos for.. plus some thoughts

This guide will assume the basics (image editing, apk manager setup, adb, etc..) are understood. Minus 9png's, I will go over that. The point is to have a base here for discussion on how to edit things properly. If anyone has something to add, please do.
OK, lets start with something that caught me off guard when switching to a phone with blur... there are certain apps that have dependencies. You have to set those dependencies up. The easiest way to do this is, from whatever ROM you are running, open the zip up with 7zip. Also open up your APK Manager and go into the "other" folder. From your ROM grab framework-res.apk, blur-res.apk, moto-res.apk, settings.apk and systemUI.apk and copy them into the "other" folder. Once there, open up a command prompt. change directories until you are in the "other" folder. Once there do this for each item. apktool d framework-res.apk and hit enter. Then, apktool if framework-res.apk. Do that for the rest.
9pngs.. Everyones afraid... they are a walk in the park. 1 extra step and its done. Decompile your apk, Edit it to your liking and save it. Open it up with draw9patch and add the guides back in and save it. The right and the bottom just make a big ass black line from one side of the image to the other (most of the time). The left and top side require a little fine tuning. Basic rule is to stick a dot in "the middle". Over on the right, see if it looks right. If it doesn't, adjust it. Once done, save it. Recompile and you are done. If using apk manager 4.9 or newer, make sure you delete the images you edited in the keep folder.
Editing xmls....
You are going to be editing xmls to either change background color or text color. Heres a general rule that will help... open the xml in notepad++ and hit ctrl +f. search for android:background .... you can change whatevers there to a hex color. like, if you wanted a dark red.. #ffbc1010. if changing text colors, do a search for android:textColor. Do the same thing with searching and changing.
Some edits will be found in the values folder... this would either take place in Colors.xml, drawables.xml or styles.xml
As I have found, some xmls just dont have a call to a bacground or text color so.. you just have to make one yourself. I always stick those in right after the androidrientation stuff. For example, you want a red background and nowhere in the xml can you find a spot to change it. No worries.. add this... android:background="#ffbc1010" . Good to go.
Some apks wont decompile with apk manager 5.01. You get an out of bounds error. Use apk manager 4.9 for those.. it will open them.
If you try to install an app and something doesnt work.. 1 minor thing, even though the rest does work.. do not try to install another re-edit until you have gone back to a fully functional version. Otherwise, none of your new edits will take hold even if they are correct. (Learned that one the hard way)
Remember, trial and error siis the Android Way!!!
Lastly, I leave you with this... each app has its own "fun-ness" to it. If you are ever stuck and need help, please feel free to ask. I can't do magic.. like looking at Sense... cause I dont have it.. but if you are running GB stock, Blur or its just an app for any phone.. please ask. I will answer, even if I dont know the answer and we have to work together to figure it out.
This is my contribution to XDA. Let's keep progression moving forward. I want to see more themers and more options!!!!
EDIT:
NEW INOFRMATION
I copied this over from my how to on DF... The links are probably still good (I just updated them) but just make sure you are getting the latest version... I wrote the how-to in January.
Since I see a lot of people trying to figure out how to get into theming and such, might as well share my knowledge...
I would also like to thank Devildog8791 and say that he went thru and added a lot to this via PM (which I then pasted here). He also made it a lot more detailed and easier to follow along for everyone.
Things you will need:
-APK Manager located here. It is the one from post #226. It uses apktool version 1.3.1 instead of the newest one, 1.3.2. The new version has some bugs that have not been worked out yet.
-Android SDK located here. There are two different files for Windows: a zip file and an .exe file. I downloaded the zip file, but you can try the .exe file.
-7zip located here. Make sure you pick the right installation for your setup (32-bit or 64-bit)
-Java JDK located here. Make sure you pick the right installation for your setup (32-bit or 64-bit)
Before I begin, please keep in mind that this is just how I did it. Maybe it's perfect, maybe its wrong, BUT... it worked for me.
NOTE: PLEASE READ THIS
Unless you are going to be pushing apks to your phone or pulling them directly from the phone, you do NOT need to bother with steps 3-6 and 9-11. You also only need to add the Java stuff to your Environment Variables.
OK here is how I set all this up and in the order that I did it.
1) Install the Java JDK. You probably don't need to, but I rebooted after the installation was complete.
2) Install 7zip.
3) Extract the android SDK file and move the extracted folder to the root of the C: drive. I renamed the folder "androidsdk", but you can rename it whatever you want. On my computer, the SDK is at C:/androidsdk (whatever you name this and anything in its filepath, make sure there are NO SPACES).
4) Go into your sdk folder and run "SDK Manager".
5) When the "Android SDK and AVD Manager" screen opens up, select "Available packages". Select the packages you want to install and click on "Install Selected". If the "Choose Packages to Install" screen comes up automatically, then select "Accept All" and click "Install". This will take a few minutes. Go ahead and get a drink and stretch your legs.
6) When your packages get done downloading and installing, close the "Installing Archives" and the "Android SDK and AVD Manager" screens.
7) Extract the APK Manager zip file and move the extracted folder to your user file. Mine is located at C:\Users\Tim\apk_manager_4.9.
8) Now you need to set your environment variables. To do this, click on "Start" and then right click on "Computer". Left Click "Properties" and in the left pane you will see "Advanced system settings". Click on that and it will open up a new window called "System Properties". Click on "Environment Variables" at the bottom of the screen.
9) Now that you are in the Environment Variables screen, you want to look at the top part of the screen first. Under "User variables for <your name here>", click on "New...".
10) In the "Variable name" section, type in ADB.
11) In the "Variable Value" section, type in C:\androidsdk\platform-tools\adb.
12) Now go to the bottom part of the screen and find "Path" on the left side under "Variable".
13) Double-click that "Path" section and it will bring up the edit screen.
14) Go to the end of the "Variable value" section and add the following: ;C:\Program Files\Java\jre6\bin;C:\Program Files\Java\jdk1.6.0_23\bin;C:\androidsdk;C:\androi dsdk\platform-tools;C:\androidsdk\tools. Verify that the bin file locations for java are in the same place as indicated here. They should be the same, but check it to be safe. Also, don't forget to change the name to whatever you named your sdk folder. One last thing is to make sure you have a semi-colon in between each path as indicated.
15) Click "OK" when done and close all the windows.
16) Reboot your computer.
Now that you have your environment variables set, you should be good to go to use APK Manager. One thing that you might have to do is set up your adb drivers for your phone. I have a Droid Incredible and I went to this site to get mine set up. If you have a Motorola Droid 1 (which most on this site do), then it should set up with the proper drivers when you plug it in the computer. My wife has a Droid 1 and that is what happened for me.
So, now you have 7zip, SDK, Java and APK Manager installed, setup and ready to use. Fantasmagorical!
Great, now, what the hell do you do with it...lol
1) You decide on an apk file (let's choose phone.apk) to use. You can grab it from the stock ROM your using, pull it off your phone, whatever...
2) Now that it is on your computer, move it into the APK Manager's "place-apk-here-for-modding" folder.
3) Run the script.bat and select option 22. Then choose the apk (project) you want to work with.
4) Now select option 9 to decompile the apk.
5) Once that's done select option 11 to recompile the apk. If it asks you if it's a system app (y/n) then you are in business. If it says there is an error, it is most likely that the apk has some .9.png images without guides. If this occurs, grab the stock images and stick them in by using 7zip and choose "open archive".
6) OK, so it works fine, now what? Just choose "N" and when it's done, go to the "place-apk-here-for-modding" folder and delete the "unsignedphone.apk" file.
7) Now go back to the script and choose option 9 to decompile again.
8) Once it's decompiled, navigate to the "projects" folder and go into the phone.apk folder.
9) Make all your xml edits.
10) Now, go back to the script and choose option 11. Choose "Y" and then choose "Y" again.
11) Now, go into the "KEEP" folder and delete the resources.arsc file and also delete every single xml you edited. Then go back to the script and "press any button to continue".
12) Once that is done, you are done. Go into the "place-apk-here-for-modding" folder and you will see an unsignedphone.apk file.
13) Put it in an update.zip that you can install to your phone and then rename it to phone.apk.
14) If you are wanting to now stick your own images in, use 7zip and select "open archive" and then drag your images into the proper folders.
15) Close 7zip and select "yes" to the box that pops up.
16) Now you are ready. Move the zip file to your phone, reboot into recovery and install it.
Going to add something blur related here. AK Manager 4.9 will give you errors recompiling phone, contacts and dialer. To fix it, go into the decompiled apk and open apktool.yml with notepad++ or similar. You will see 3 lines.. -1, -3 and -2. Put them in order.. -1, -2 and -3. Good to go.
Very nice thanks for this
Sent from my DROID X2 using Tapatalk
No problem. Get out there and make some good stuff!!
Hey thanks for the guide. I have a lot of programming experience but I am fairly new to android.
With that said, you state that: "This guide will assume the basics (image editing, apk manager setup, adb, etc..) are understood."
Is there a page were this things are explained, I have the image editing down, but have no idea about the apk manager,adb,etc...
I found this and I was wondering if this is the apk manager:
http://forum.xda-developers.com/showthread.php?t=1227179
Thanks, and sorry if this sounds too noobish.
Yes, that is apk manager. I would use 4.9 though because 5.01 will give you a lot of "out of bounds" errors when decompiling. 4.9 wont. And the apps work.
There is also another thread here on XDA .. So you want to make a theme.. or something like that.
I also wrote a How-To on installing java, apk, adb and setting all of your environment variables. That is in the "Team Inversion Conversion" area on droidforums.net.
Edit: Added the how to to the original post.
Question
So i wanted to theme and started reading guides on xda and came to the conclusion that it was a lengthy process requiring knowledge of may different programs, most of which was over my head. Just recently i started digging into roms wanting to change the lockscreen background and incall backgrounds. using 7z i located the lockscreen background file at system\framework\framework-res.apk\res\drawable-hdpi\zz_moto_gradient_bg2.png I then copied the file out and opened it and using paint, changed the image to a different one and then pushed the modified file back into the zip and then flashed the rom. I was very happy to end up with this
.
My question is, not using apk manager or apktool or a command prompt or any of the methods that ive read, am i doing something wrong? Will editing roms in this method run me into problems? Or is it just a noobish approach that actually works?
afm1118... There is absolutely nothing wrong with the way you are doing things. Just make sure you don't mess with any 9pngs. if you edit those with your method, it will break the signature. The image would still work but the guides would be gone. When I first started learning to theme, I didn't understand what a guide was. So, heres my explanation... look at your keyboard... in landscape mode, the buttons are bigger than they are in normal view. guided 9s will make the images stretch perfectly to fit the required dimensions. unguided 9pngs will just take the actual image and make it bigger. Kind of like if you went into an image editor and re scaled a 40x40 pixel image to 100x100 pixels. It would still be there but it would be a little distorted.
Yeah i just stay away from the 9pngs because i dont understand them and just know not to touch. You definitely helped me understand them better tho. What i dont understand is the need to use apk manager, or what recompiling/decompiling is. Like just using 7z i modified phone.apk in the same fashion i did the lockscreen, changing the incall background. Im guessing apk manager is necessary for editing xml. I really want to understand all this.
afm1118 said:
Yeah i just stay away from the 9pngs because i dont understand them and just know not to touch. You definitely helped me understand them better tho. What i dont understand is the need to use apk manager, or what recompiling/decompiling is. Like just using 7z i modified phone.apk in the same fashion i did the lockscreen, changing the incall background. Im guessing apk manager is necessary for editing xml. I really want to understand all this.
Click to expand...
Click to collapse
I dont do .9 pngs and I still create alot of themes, dont be scared to theme cuz u cant do .9.
TheMuffStuff said:
I dont do .9 pngs and I still create alot of themes, dont be scared to theme cuz u cant do .9.
Click to expand...
Click to collapse
Im not scared of um, i just thought i would figure them out when i wanted to change one. but so far,with nitros rom and with muffstuff xkape and funkencools themes along with uot kitchen ive been very happy. The themes are great, im looking forward to whats next.
afm1118 said:
Yeah i just stay away from the 9pngs because i dont understand them and just know not to touch. You definitely helped me understand them better tho. What i dont understand is the need to use apk manager, or what recompiling/decompiling is. Like just using 7z i modified phone.apk in the same fashion i did the lockscreen, changing the incall background. Im guessing apk manager is necessary for editing xml. I really want to understand all this.
Click to expand...
Click to collapse
TheMuffStuff said:
I dont do .9 pngs and I still create alot of themes, dont be scared to theme cuz u cant do .9.
Click to expand...
Click to collapse
.9s are integral to theming....cheating them and not doing them arent an execuse
Nitsuj. Instead of bringing negativity into the thread, try being useful. This is a help section not a your doing it wrong thread. If you would like to discuss it further pm me.
Sent from my Nexus S using XDA App
Nexus S.. Ha.. Editing the build.prop har further reaches than I thought.
Anyway, yes, editing an xml requires decompiling and recompiling... or does it? Not so fast. You can use a Hex editor to edit those colors but, I have no clue. I never went that route.
I guess the easiest way to think about apks that are compiled or decompiled is like this... lets say you have a game.. Football.exe on your computer. you click it, it opens. Now, to save space, you zip it up and its now in a zip file called Football.zip. You click it, it does NOT open. The OS cant read a zip file as an executable file.
You open a compiled xml, can't read it. you open a decompiled xml.. its all right there in plain English. Why would you want to edit an xml? Many reasons. I am going to give you an example right here...
This is the decompiled progress-horizontal.xml from the framework. It controls the color of the bar when you are dwnlading an ap, adjusting the ringer or media volume, etc..
<?xml version="1.0" encoding="UTF-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@id/background">
<shape>
<corners android:radius="0.0dip" />
<gradient android:startColor="#ffdfdfdf" android:endColor="#ffdfdfdf" android:angle="270.0" android:centerY="0.75" android:centerColor="#ff000000" />
</shape>
</item>
<item android:id="@id/secondaryProgress">
<clip>
<shape>
<corners android:radius="0.0dip" />
<gradient android:startColor="#ff000000" android:endColor="#ffbf0d0d" android:angle="270.0" android:centerY="0.75" android:centerColor="#ffbf0d0d" />
</shape>
</clip>
</item>
<item android:id="@id/progress">
<clip>
<shape>
<corners android:radius="0.0dip" />
<gradient android:startColor="#ffbf0d0d" android:endColor="#ffbf0d0d" android:angle="270.0" android:centerY="0.75" android:centerColor="#ff000000" />
</shape>
</clip>
</item>
</layer-list>
Im not going to go look at a hex chart but I think this is from when I was making an orange theme the other day. You can see there are 9 hex codes for color. You can edit those and make the progress bar have a different background and color. If I remember correctly, the first 3 control the background and the other 6 control the color of the bar. Play around and experiment til you see one you like. you can also add in transparencies and such to get fading and whatnot. like #80dfdfdf instead of #ffdfdfdf.
Some xmls wont be as clear cut.. it mught say something like android:background="@drawable/status_bar_bg"
This still can be changed. You can actually add something to a folder..image, color, etc.. but you also need to make an xml for it too. (I think, never done it).
You can make it point at a different item or, you can just give it a hex color.
ok so with the lockscreen i did, i could have done it two different ways. i could have changed the xml to target a different file or what i did, modify the image file itself. its just like html or any programing, its been a while.
correct man. Deciding which way to go is key. some of those images show up all over the place. In each instance just have to decide if its better to point it something else or just change what its pointing to looks like.
When I first themed ShapeWriter(back when I hadn't even heard of a .9) I got into a whole new mess with .smali, turns out that's where the tracer color was defined. You could never edit smali without decompiling first, although for theming its rare to have to.
Once you start theming you start learning little things here and there. And usually if your theming, it's cause your trying to do what no ones done yet; so most of what your going to learn is from a LOT of trial and error.
I'm not good at writing guides or anything but anyone can feel free to ask in my thread or pm me if you have some specific questions, etc..
Sent from my DROID X2 using XDA App
Also just thought I'd add: things may seem confusing sometimes but so would basic algebra if it hadn't been etched into your brain already.
Sent from my DROID X2 using XDA App
I was wondering is someone could explain to me a little better as to how to make a flashable zip.
I wanted to change the background image of the dialer, but when I have a finished apk I dont know hot to make it flashable.
Thanks
Electroniko said:
I was wondering is someone could explain to me a little better as to how to make a flashable zip.
I wanted to change the background image of the dialer, but when I have a finished apk I dont know hot to make it flashable.
Thanks
Click to expand...
Click to collapse
Well I could get pretty indepth but if you just want one that works you could borrow mine or probably anyone else's and change it for your needs(deleting my files adding yours).
without getting into the actually scripting the basics are:
A script that tells you what files/dir go where(among other things) and the files.
Usually it will just unpack everything in the zip to the "root" of your system partition. So if you were to use my zip i would keep my dir's and just delete the actual files.
basically if you want to put a file in "/system/framework/" on your phone you would put the file in "/system/framework/" in the zip.
also a note if you use mine; it will only copy to the system partition and not sd or sd-ext. even with that it should fit your needs.
Hope that all helps

CRT Animation

Is there a way to get this without rooting/custom rom? Much appreciated if someone could give me step-by-step instructions as I'm still a noob.
BestInGalaxy said:
Is there a way to get this without rooting/custom rom? Much appreciated if someone could give me step-by-step instructions as I'm still a noob.
Click to expand...
Click to collapse
You need to be rooted and deodexed at a minimum. Stock roms out there that just deodex and root with no other changes. Reason is you need CWM to flash the modified framework-res which would be easiest since your not used to all of this. Also deodexed is a must in order to theme roms.
Here is rough instructions if your on stock rom with root and is deodexed:
First download APK Multi Tool and extract it to a folder on your desktop
Download APK Multi Tool
Download Notepad++ google for the download
Download this update.zip from my ICS theme.
Open the Multi Tool folder and open folder Place-apk-for-modding-here.
Next open the ZIP for the rooted/deodexed ROM your running. Browse to System > Framework and drag framework-res.apk from the ZIP to the Place-apk-for-modding-here folder.
Now in go one folder to the main folder of Multi-tool and click script.bat at the bottom of the folder. It will open a cmd prompt click continue to bring up the menu.
Type in option 25 and hit enter.
Type in 1 hit enter(you've selected framework-res)
Now type in 9 and hit enter to decompile. Give it a few minutes when your back at main menu and its waiting for input minimize the cmd prompt(do not close it).
Open projects folder then browse in this order framework-res.apk > res > values. In values folder open bools.xml with notepad++.
With bools.xml opened in Notepad++ browse to Line 16: it should look like this:
<bool name="config_animateScreenLights">true</bool>
Click to expand...
Click to collapse
Change from true to false and save XML.
Now open Multi apk cmd prompt type in 11 and hit enter. Give it a few you will be asked if its a system apk input Y then hit enter. Next screen input Y and hit enter. Let it do its thing and you will see a small paragraph stating pretty much delete what you've changed and delete resources.arsc if you've edited an XML.
Anyhow dont hit any keys leave that paragraph up for the moment. Minimize cmd prompt then get to main folder of Apk multi tool you will see a keep folder. Inside the folder delete only Resources.arsc then pull back up CMD prompt. Hit any key let it finish up.
Now minimize cmd prompt and go back into Place-apk-for-modding-here folder you will see unsignedframework-res.apk.
Delete original framework-res.apk and rename the unsignedframework-res.apk to framework-res.apk.
Open the ZIP package you downloaded from my theme browse to System > framework.
You will see only framework-res.apk in there drag the modded one you just did into there and then drag this zip to your SDCARD and flash from CWM.
What in the world... my head hurts LOL. Um what does deodexed mean and how do I know I'm "deodexed"?
BestInGalaxy said:
What in the world... my head hurts LOL. Um what does deodexed mean and how do I know I'm "deodexed"?
Click to expand...
Click to collapse
Google sir. That is a step by step I typed up. I recommend ignoring it until you learn more about the phone though.
Sent from my SAMSUNG-SGH-I777 using xda premium
K, I'm willing to learn. Uh, let's start with baby steps, lol. If I root my device, will I be able to update to ICS 4.0 when it becomes available?
In short, yes. There are other threads that answer that fully.
You will always be able to take your phone 'back' to stock like it was when you first got it, to be able to install ICS from At&t.
Though you will be able to install ICS before it is released from At&t by installing a custom rom. It's not a possibility, it's a fact. Just be patient.
Sent from my SAMSUNG-SGH-I777 using XDA App
jivy26 said:
You need to be rooted and deodexed at a minimum. Stock roms out there that just deodex and root with no other changes. Reason is you need CWM to flash the modified framework-res which would be easiest since your not used to all of this. Also deodexed is a must in order to theme roms.
Here is rough instructions if your on stock rom with root and is deodexed:
First download APK Multi Tool and extract it to a folder on your desktop
Download APK Multi Tool
Download Notepad++ google for the download
Download this update.zip from my ICS theme.
Open the Multi Tool folder and open folder Place-apk-for-modding-here.
Next open the ZIP for the rooted/deodexed ROM your running. Browse to System > Framework and drag framework-res.apk from the ZIP to the Place-apk-for-modding-here folder.
Now in go one folder to the main folder of Multi-tool and click script.bat at the bottom of the folder. It will open a cmd prompt click continue to bring up the menu.
Type in option 25 and hit enter.
Type in 1 hit enter(you've selected framework-res)
Now type in 9 and hit enter to decompile. Give it a few minutes when your back at main menu and its waiting for input minimize the cmd prompt(do not close it).
Open projects folder then browse in this order framework-res.apk > res > values. In values folder open bools.xml with notepad++.
With bools.xml opened in Notepad++ browse to Line 16: it should look like this:
Change from true to false and save XML.
Now open Multi apk cmd prompt type in 11 and hit enter. Give it a few you will be asked if its a system apk input Y then hit enter. Next screen input Y and hit enter. Let it do its thing and you will see a small paragraph stating pretty much delete what you've changed and delete resources.arsc if you've edited an XML.
Anyhow dont hit any keys leave that paragraph up for the moment. Minimize cmd prompt then get to main folder of Apk multi tool you will see a keep folder. Inside the folder delete only Resources.arsc then pull back up CMD prompt. Hit any key let it finish up.
Now minimize cmd prompt and go back into Place-apk-for-modding-here folder you will see unsignedframework-res.apk.
Delete original framework-res.apk and rename the unsignedframework-res.apk to framework-res.apk.
Open the ZIP package you downloaded from my theme browse to System > framework.
You will see only framework-res.apk in there drag the modded one you just did into there and then drag this zip to your SDCARD and flash from CWM.
Click to expand...
Click to collapse
Wow that's one hell of a step by step, and here I was Modding apks in 7zip
sent from the Dark Obelisk.
You're good Jivy26
hey there Jivy.. i'm a Sensation noob, but all was going too well with your step by step process parameter, untill i got the following error
Could Not Find C:\Users\SUMICO\Downloads\Apk_Multi-Tool_Alpha_02\Apk_Multi-Tool\place-apk-here-for-modding\../place-apk-here-for-modding/signedframework-res.apk
Could Not Find C:\Users\SUMICO\Downloads\Apk_Multi-Tool_Alpha_02\Apk_Multi-Tool\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedframework-res.apk
'java' is not recognized as an internal or external command,
operable program or batch file.
am i missing something?????
d.durrani said:
hey there Jivy.. i'm a Sensation noob, but all was going too well with your step by step process parameter, untill i got the following error
Could Not Find C:\Users\SUMICO\Downloads\Apk_Multi-Tool_Alpha_02\Apk_Multi-Tool\place-apk-here-for-modding\../place-apk-here-for-modding/signedframework-res.apk
Could Not Find C:\Users\SUMICO\Downloads\Apk_Multi-Tool_Alpha_02\Apk_Multi-Tool\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedframework-res.apk
'java' is not recognized as an internal or external command,
operable program or batch file.
am i missing something?????
Click to expand...
Click to collapse
Do you have java installed on your computer?
Sent from my GT-I9100 using Tapatalk

Help work out bugs in CM9/10/sense4/aokp- smali/baksmali and more to come..

How can I contribute to development?
Post #1 is a tutorial for how to decompile/recompile jar files to help with the project.
Post #2 will have information on how to pull a proper logcat and how to post your logcat
___________________________________________________________________
I'll write up a quick little guide for smali/baksmali that can be used with the previous resource I posted.
First, windows will work just fine. You will have to install the java JDK(not sdk, you can have both however), this is straightforward, just google and follow directions.
Next, download http://smali.googlecode.com/files/smali-1.3.2.jar and http://smali.googlecode.com/files/baksmali-1.3.2.jar (both are also attached)
If you can already type "adb" in the command prompt of windows, then the path was set for the tool.. find where you have ADB at, and paste those files into the same directory. If not follow the directions in the following quote, except you will be putting the above downloaded files in the directory you chose.
There's two simple ways to get there:
1 way = click Start > Control Panel > System icon.
2nd way = click the Start button, right-click “My Computer”(Computer for Vista/7) and select “Properties”.
If your using XP, your there. If your using Vista/7, click on Advanced system settings on the left side.
You should now be in the System Properties window.
Click on the Advanced tab.
Click on the Evironment Variables... button
In the System variables(lower box), scroll through the list until you see Path under the Variable column.
Click on it to highlite it, click on the Edit... button.
We are going to add our path to adb, where we installed the SDK, in the Variable value: box.
Make sure your cursor is at the end of the last entry, and type this:
;C:\android\tools\
Click to expand...
Click to collapse
Press the windows button or click start button, type cmd and press enter(to open command prompt), and type "java -jar baksmali-1.3.2.jar -o out/rogers/dexout/rogers-classes.dex" and see if the error it gives you shows you that there is no "rogers-classes.dex" file, if so then you've done everything right thus far.
Now you should look at the resource I had posted before, so you don't have to search, here it is again http://rootzwiki.com/topic/19262-protip-getting-data-working-on-that-epic-port-you-just-did/
For this example, look under where it says "Data:", I am going to do what it says for the framework.jar file. Jar files are basically zip files, rename framework.jar to framework.zip, then unzip it with whatever program you use, making sure you know where it is located. Do this for BOTH the cm9 rom, and also with the stock rom(we should be able to use any rom we currently have, ARHD, energy, speedrom, etc). I would name the stock rom zip folder "base" and the cm9 zip folder "port", so you can keep track easily.
If you have followed along this far, you will have a file called classes.dex, this will be what we are decompiling for both cm9 and stock, then we will copy files as needed, and recompile just the cm9 classes.dex, so again, pay attention to which is which, and what the path is. Ignore the other file that was unzipped for now, just know when you rezip it, you have to replace the original classes.dex file and zip it up with the other file that it was unzipped with.
So lets say this is the result, I have a folder c:\android\porting\base folder that contains a classes.dex file, and a c:\android\porting\base(I renamed the unzipped folder after I unzipped each) that also contains a classes.dex file.
Here is a post that explains what we are about to do if you need a reference. http://forum.xda-developers.com/showpost.php?p=4152564&postcount=2
To decompile(if you correctly installed the java jdk and set the path correctly for baksmali/smali) you would type this in:
Code:
java -jar baksmali-1.3.2.jar -o out/base locationOFyour/classes.dex
the "out/base" is where it will put the output files, in a directory called OUT in your USER folder. Quick protip if you are unsure how to type in the location of the classes.dex file, just type in "java -jar baksmali-1.3.2.jar -o out/base" and then DRAG the classes.dex file from your file explorer to the command prompt window, and IT will put the correct path(it should be something like ~/android/porting/base if I remember correctly). I am working on OSX, so you may have to do this if the example isn't helpful enough. Protip #2: Write all this $h*t down! Create a text document with every step you do, then you can just copy/paste the line above, and modify it as needed- this also helps keep track of what you are doing- aka a changelog.
If you followed protip #2 above, copy the same command you just typed in, but change where it says "base" in the path, to "port". If you have two folders in your OUT folder, one called base, and one called port, you have done everything correctly thus far.
Since this is an example, this is what the resource I posted above on rootzwiki says to do with the result output files:
android/net - the ConnectivityManager classes and interfaces as well as all the NetworkStateTrackers.
android/telephony
com/android/internal/telephony
Click to expand...
Click to collapse
So basically I am just copying everything from the above folders from my BASE, to the PORT, overwriting each file in the port. Once done, you will type this:
Code:
java -Xmx512M -jar smali-1.3.2.jar out/port -o new-classes.dex
This is because we are recompiling the files in our PORT, and it will create a file in the root of your USER folder called new-classes.dex. Rename the file classes.dex, unzip the CM9 framework.jar and replace the original classes.dex, rezip it, then rename framework.zip to framework.jar.
This concludes the tutorial. Once you have everything setup, if you follow protip #2, the matter of baksmali/smali is a quick copy/paste into command prompt, so modifying a jar file will take less than 5 minutes. Push the resulting jar file into the appropriate folder on your phone, reboot your phone, run a logcat(I have a good guide linked in the BIBLE in my signature how to logcat like a pro), and see if data(for this example, you could be working on GPS or whatever) is working any better.
Protip #3: You've just learned quite a bit, the same can be done to most apk's- rename whatever.apk to whatever.zip, unzip it, then baksmali the resulting classes.dex file- this is how many programs are backported to older versions of android, hacked, etc. If you want to see the simple edit that was made to the ext.jar using this same process that got data working, you can see it here: http://forum.xda-developers.com/showpost.php?p=25786037&postcount=13
If anyone wants to try to push the file I just created and attached, feel free.. if you have major issues, create a logcat, if not, post your result. My changelog:
In android/net I copied over ConnectivityManager.smali and each file beginning with "NetworkState"
In android/telephony I copied over all the files
There was no com/android/internal/telephony directory, so it was skipped
Click to expand...
Click to collapse
This is all I have time for at the moment, I have to go to work soon so I cannot test the file.. this tutorial took a bit to do, so I am hoping someone at least gives it a try to make it worth my time. I can give some assistance, but would prefer that if it is something you can figure out on your own with some basic googling, please do so.
I will update on different methods to pull a proper logcat in the near future, for right now please post what rom you are on, and what you expect the log to contain such as "I was enabling data"..
Also reserved just in case
As posted in the previous thread, there are probably 250+ more constants in the base rom than there is the in the cm9 RILConstants.smali file. Are these the kinds of glaring differences we need to look for, or is this just the difference between sense/aosp...
I'm pushing your framework.jar and seeing how it works out. I'll get back to you in a moment.
Just boot loops...
Hey, just wanted to throw this out there. I found an amazing studio that makes digging around in apk and jar files incredibly easy to do.
You can check it out here - http://www.virtuousrom.com/p/ten-studio.html
I haven't tried any jar files with it but it says they are supported. Might be worth checking out.
Ok I just tried switching it our with your framework.jar and it got to upgrading the 82 apps now it's stuck in a bootloop after that
Sure wish we could get some if those Kats over here. The virtuous team always had something cool for the g2
Sent from my HTC_Amaze_4G using xda app-developers app
craigtut said:
Hey, just wanted to throw this out there. I found an amazing studio that makes digging around in apk and jar files incredibly easy to do.
You can check it out here - http://www.virtuousrom.com/p/ten-studio.html
I haven't tried any jar files with it but it says they are supported. Might be worth checking out.
Click to expand...
Click to collapse
Yep, I saw that and saved it to my read it later account.. but I never even boot into windows anymore, lol. If someone wants to try it out, if it streamlines things.. would definitely be pretty awesome. I didn't know it did jars, I thought it just did apks.
Learning how to do it still has its own value I think tho Thanks for sharing craig
bos2333 said:
Ok I just tried switching it our with your framework.jar and it got to upgrading the 82 apps now it's stuck in a bootloop after that
Click to expand...
Click to collapse
I noticed afterwards that I included a few too many files, I should have done just the one file rather than 3.. I think we will have much more success by making single changes, seeing if it improves things, or at LEAST continues to boot, rather than making broad sweeping changes.
Even if it gets stuck in a bootloop, see if it will post a logcat, the errors it puts out will help figure out what was too much.
Also, I think the mentioned guide would be MUCH more direct for porting sense4- as both have all proprietary htc files, and therefor the different flags in the smali file will help a ton.. as far as porting cm9, we will likely have to be much more concise about the changes- it likely won't take much, just a few changes here and there.
bos2333 said:
Ok I just tried switching it our with your framework.jar and it got to upgrading the 82 apps now it's stuck in a bootloop after that
Click to expand...
Click to collapse
Here's the logcat from replacing framework.jar with the one you supplied...I had to zip it though because it's too big apparently
Silentbtdeadly said:
Yep, I saw that and saved it to my read it later account.. but I never even boot into windows anymore, lol. If someone wants to try it out, if it streamlines things.. would definitely be pretty awesome. I didn't know it did jars, I thought it just did apks.
Learning how to do it still has its own value I think tho Thanks for sharing craig
Click to expand...
Click to collapse
i guess ill give it a go
ill mess with it too once i get my straight talk plan. (cause right now i dont have a plan so i cant check data )
you can use Winrar to extract .jar files so you don`t have to rename to .zip http://www.rarlab.com/download.htm download it here
Ok, so again, very new to this...I just merged the 4 MobileDataStateTracker files from Android/net from speedrom 5.1 to the cm9...same thing, boot loops.
bos2333 said:
Ok, so again, very new to this...I just merged the 4 MobileDataStateTracker files from Android/net from speedrom 5.1 to the cm9...same thing, boot loops.
Click to expand...
Click to collapse
Then you likely have the cause of the original boot loop. Two things you can do, check the logcat - it may tell you something useful.. another thing to do is get software to compare the files, I think for windows there's a free one called winmerge... The output files are usually text, and you may see some specific lines that would help us from the stock file and change those(things relating to data), leaving everything else alone.
Someone recently posted how to do a log for data errors, but I have a really good tutorial in the bible in my signature, logcat like a pro.
Sent from my HTC_Amaze_4G using xda app-developers app
i'm trying to learn my ways around the android ecosystem... please correct me if I have any incorrect info below
bascially, what you're doing for this tutorial is trying to decompile and debug problems, only going up to the assembly level (smali)
jar/apk = container like a zip... contains resources like compiled binaries and images etc
dex = compiled binary for the android system
you first disassemble the dex files to smali ("assembly") files
-> a developer here would make changes to the smali... lets say you don't make any
you reassemble back to dex, gather it into a jar/apk file to put on the phone
-------------
for porting a phone to use CM9/10/aokp, you basically use the base CM9/10/aokp system, copy over relevant jar/apk, and debug to fix any problems (like function calls, data etc)?
using logcat, you can see where function calls fail (or when you have a exception), and then try to fix it?
how good is debugging? basically you can see most of the source code?
would it be also possible to go dex->smali->java? like this post, though it says its not ideal either http://stackoverflow.com/questions/5582824/decompile-smali-files-on-an-apk
Silentbtdeadly said:
Then you likely have the cause of the original boot loop. Two things you can do, check the logcat - it may tell you something useful.. another thing to do is get software to compare the files, I think for windows there's a free one called winmerge... The output files are usually text, and you may see some specific lines that would help us from the stock file and change those(things relating to data), leaving everything else alone.
Someone recently posted how to do a log for data errors, but I have a really good tutorial in the bible in my signature, logcat like a pro.
Sent from my HTC_Amaze_4G using xda app-developers app
Click to expand...
Click to collapse
Yeah, I attached a logcat last page and looked at it, saw the errors. I'll do some searching tomorrow to see if I can work my way through some of them.
Sent from my HTC Ruby using xda app-developers app
paperWastage said:
i'm trying to learn my ways around the android ecosystem... please correct me if I have any incorrect info below
bascially, what you're doing for this tutorial is trying to decompile and debug problems, only going up to the assembly level (smali)
jar/apk = container like a zip... contains resources like compiled binaries and images etc
dex = compiled binary for the android system
you first disassemble the dex files to smali ("assembly") files
-> a developer here would make changes to the smali... lets say you don't make any
you reassemble back to dex, gather it into a jar/apk file to put on the phone
-------------
for porting a phone to use CM9/10/aokp, you basically use the base CM9/10/aokp system, copy over relevant jar/apk, and debug to fix any problems (like function calls, data etc)?
using logcat, you can see where function calls fail (or when you have a exception), and then try to fix it?
________________________________________________________________________________________________
how good is debugging? basically you can see most of the source code?
would it be also possible to go dex->smali->java? like this post, though it says its not ideal either http://stackoverflow.com/questions/5582824/decompile-smali-files-on-an-apk
Click to expand...
Click to collapse
Everything above the line=yes(ish). That is a fair explanation of things. If you mean how good is the debugging on smali'd files.. you should do it to some and find out
I'm not sure I understand what you mean by dex>smali>java.. dex is the compiled, smali is decompiled, it can't be more decompiled than smali to the best I can see. What that link you posted was talking about was different tools to get the job done- some can be helpful, tho many don't work properly with ICS as of yet.
Sorry if my answers are unclear, I wasn't sure of the questions perhaps..
So there are some smali edits in this miui4 porting guide that can be looked at to help understand how/what files matter.. furthermore, all ril specific edits could be looked at for our phone http://forum.xda-developers.com/showpost.php?p=28885450&postcount=2
Also, the third post has some great info on debugging and reading logs.. http://forum.xda-developers.com/showpost.php?p=28885450&postcount=3
That entire guide is extremely comprehesive, and the language isn't more complex than what you are already doing, so you will learn quite a bit. I may pull relevant info from that guide to the second post when I have more time.
Silentbtdeadly said:
Everything above the line=yes(ish). That is a fair explanation of things. If you mean how good is the debugging on smali'd files.. you should do it to some and find out
I'm not sure I understand what you mean by dex>smali>java.. dex is the compiled, smali is decompiled, it can't be more decompiled than smali to the best I can see. What that link you posted was talking about was different tools to get the job done- some can be helpful, tho many don't work properly with ICS as of yet.
Sorry if my answers are unclear, I wasn't sure of the questions perhaps..
Click to expand...
Click to collapse
my question is whether we decompile all the way back to the Java source instead of stopping at the assembly(smali) stage
from doing more searching, it looks like you might be able to get readable Java source code, but you can't recompile them as it'll be incomplete and as you said might not work on ics
I assume one would need to to flash the cm9/10 and then get those logcats
Silentbtdeadly said:
Then you likely have the cause of the original boot loop. Two things you can do, check the logcat - it may tell you something useful.. another thing to do is get software to compare the files, I think for windows there's a free one called winmerge... The output files are usually text, and you may see some specific lines that would help us from the stock file and change those(things relating to data), leaving everything else alone.
Someone recently posted how to do a log for data errors, but I have a really good tutorial in the bible in my signature, logcat like a pro.
Sent from my HTC_Amaze_4G using xda app-developers app
Click to expand...
Click to collapse
Ok, so I tried again this morning by only adding "HtcMobileDataStateReceiver.smali" to the port in the android/net, and I got the boot loops again. Checked the logcat and found this...
I/ServiceManager( 144): service 'media.audio_flinger' died
I/ServiceManager( 144): service 'media.camera' died
I/ServiceManager( 144): service 'media.player' died
I/ServiceManager( 144): service 'media.audio_policy' died
I/Netd ( 496): Netd 1.0 starting
D/AndroidRuntime( 497):
D/AndroidRuntime( 497): >>>>>> AndroidRuntime START com.android.internal.os.ZygoteInit <<<<<<
D/AndroidRuntime( 497): CheckJNI is OFF
I/dalvikvm( 497): Zip is good, but no classes.dex inside, and no valid .odex file in the same directory
D/dalvikvm( 497): Unable to process classpath element '/system/framework/framework.jar'
I/ ( 498): ServiceManager: 0x1293958
E/JNIHelp ( 497): Native registration unable to find class 'android/debug/JNITest', aborting
Any ideas? It seems like it's not taking my new classes.dex file for some reason.

Categories

Resources