Related
Hey everyone! I've created a guide for themers that shows step-by-step how to decompile and recompile the GingerBlur framework-res.apk. With GingerBlur 4, decompilation and recompilation can be done without any errors. This should make it significantly easier to theme my ROM.
http://briefmobile.com/how-to-theme-gingerblur
If you're unclear on how to do something, you should ask me below and I'll write more to the guide. In the future I'd like to add these to the guide:
Step-by-step "How To" create a theme like GingerBlur
How to edit .9.pngs properly
How to create flashable .zip's
How to change text/menu colors
Make sure to throw your suggestions below!
You sure do alot for someone with limited time..... Thanks
Sent from my MB860 using Tapatalk
Gvndeb60 said:
You sure do alot for someone with limited time..... Thanks
Sent from my MB860 using Tapatalk
Click to expand...
Click to collapse
I love phones. And I love the people on the Atrix forums.
geez, man. could you do me a favor and let me know what phone you go to next. thanks for the guide too.
chaosjh said:
geez, man. could you do me a favor and let me know what phone you go to next. thanks for the guide too.
Click to expand...
Click to collapse
Not sure quite yet. We'll have to see what AT&T comes up with.
kennethpenn said:
Make sure to throw your suggestions below!
Click to expand...
Click to collapse
Any idea why the BlurDialer never decompiles correctly? Will there be a fix for that?
gera4ever94 said:
Any idea why the BlurDialer never decompiles correctly? Will there be a fix for that?
Click to expand...
Click to collapse
I'm not quite sure why Moto failed at creating the BlurDialer.apk. Don't expect a fix on Froyo. Maybe it'll be fixed on 2.3 Gingerbread.
Ok, so I'm not to familiar with themeing, but I figure replacing a few .png files in the drawable-hdpi folder can't be to hard... But every time I try re-compiling the framework-res.apk, I get multiple errors all having to do with the public.xml file, which I didn't touch.
I de-compile the apk just fine, replace the .png files with different ones (same names), and then get the error upon re-compiling. And then nothing appears in the build folder at all. Any thoughts??? Any help would be much appreciated. Thanks.
**Edit**
When I run the cmd to compile the framework-res folder, I get:
W: Could not find sources
I: Building Resources...
Swiftks said:
Ok, so I'm not to familiar with themeing, but I figure replacing a few .png files in the drawable-hdpi folder can't be to hard... But every time I try re-compiling the framework-res.apk, I get multiple errors all having to do with the public.xml file, which I didn't touch.
I de-compile the apk just fine, replace the .png files with different ones (same names), and then get the error upon re-compiling. And then nothing appears in the build folder at all. Any thoughts??? Any help would be much appreciated. Thanks.
**Edit**
When I run the cmd to compile the framework-res folder, I get:
W: Could not find sources
I: Building Resources...
Click to expand...
Click to collapse
Could you read out some of the errors?
Most .png files can be replaced within WinRAR or 7zip without decompiling the framework. Only ".9.png" files need decompilation and recompilation.
when decompiling i get this:
apktool d -f framework-res.apk
Code:
I: Loading resource table...
I: Loaded.
I: Decoding file-resources...
W: Cant find 9patch chunk in file: "drawable-hdpi/statusbar_background.9.png". R
enaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/title_bar_portrait.9.png". Ren
aming it to *.png.
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
that means it doesnt decompile correct the .9.png files?
when compiling, with minor changers in .9.png files i get these errors:
Code:
C:\FIXblur\framework-res\res\values\public.xml:3604: error: Public symbol drawab
le/sym_keyboard_space declared here is not defined.
....
le/tab_selected_bar_left_v4 declared here is not defined.
C:\FIXblur\framework-res\res\values\public.xml:3614: error: Public symbol drawab
le/tab_selected_bar_right declared here is not defined.
.....
.....
C:\FIXblur\framework-res\res\values\public.xml:3657: error: Public symbol drawab
le/zz_vzw_stat_sys_roaming_cdma_custom3 declared here is not defined.
btw the java jre i have is
Windows x64 16.09 MB jre-6u25-windows-x64.exe
(on my x64 win7)
Paschalis said:
when decompiling i get this:
apktool d -f framework-res.apk
Code:
I: Loading resource table...
I: Loaded.
I: Decoding file-resources...
W: Cant find 9patch chunk in file: "drawable-hdpi/statusbar_background.9.png". R
enaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi/title_bar_portrait.9.png". Ren
aming it to *.png.
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...
that means it doesnt decompile correct the .9.png files?
when compiling, with minor changers in .9.png files i get these errors:
Code:
C:\FIXblur\framework-res\res\values\public.xml:3604: error: Public symbol drawab
le/sym_keyboard_space declared here is not defined.
....
le/tab_selected_bar_left_v4 declared here is not defined.
C:\FIXblur\framework-res\res\values\public.xml:3614: error: Public symbol drawab
le/tab_selected_bar_right declared here is not defined.
.....
.....
C:\FIXblur\framework-res\res\values\public.xml:3657: error: Public symbol drawab
le/zz_vzw_stat_sys_roaming_cdma_custom3 declared here is not defined.
btw the java jre i have is
Windows x64 16.09 MB jre-6u25-windows-x64.exe
(on my x64 win7)
Click to expand...
Click to collapse
Make sure you're decompiling GingerBlur 4. Only GB4 has my new-and-improved framework-res.
If you have the android sdk installed, it's version of aapt might be causing conflicts depending on the version of apktool being used. Since apktool just grabs the first one it finds in it's path, keep an eye on that. For linux, there is no way to set the path for apktool, the code just calls aapt, to be found wherever on the system visible from within java, no shell PATH changes have any affect. I have a custom version I did up to force the location of aapt via command line option.
If you are using .9.png files, make sure they are .9.png files and not just regular files with that extension. Apktool is like Santa Claus, it can tell when you are being naughty or nice.
All the small xml files like strings.xml are jumbled together in resources.arsc, all the identifiers in your statusbar.xml etc are decoded and reassigned when apktool recompiles them. So keep a copy of your mods outside of the apk as backup, you might not be able to extract them exactly as you modified them. If you reference new drawables, make sure those files exist somewhere in the apk folder before compiling as well.
Cheers!
Ok, so I've never themed Android before, but I'd be interested in playing around with the option, there are a few questions I have though.
1) Do you have a downloadable framework-res.apk or do I need to just pull it via adb (I know how to do this, I was just wondering)?
2) If I push the new framework-res.apk what is the risk of getting the boot loop of death that tends to happen if you incorrectly theme a ROM?
3) If I were to be caught in a BLOD would that mean that I would need to restore via an sbf and start all over again or could I still access Tenfars CWM somehow during the boot process and restore to the last Nandroid backup?
4) Should the device be wiped before testing a theme, or is it OK to just push the new framework-res.apk over the existing without wiping?
I'm sure I will have more questions in the future. I just got apktools running on my Mac, but don't have much time at the moment to fiddle around with it. I'm a newbie when it comes to this stuff, but I do know enough to feel comfortable working with these files.
I want to thank you in advance, theming Android devices is something I've wanted to learn how to do since I started using Android and I look forward to dabbling with it. I also look forward to the information in the guides you list as wanting to write in the future. You are awesome kennethpenn.
I don't know who invented this .9.png file thing, but it's the stupidest thing I've ever encountered... so frustrating... ggrrr
lostinbeta said:
1) Do you have a downloadable framework-res.apk or do I need to just pull it via adb (I know how to do this, I was just wondering)?
Click to expand...
Click to collapse
You can grab it from the GingerBlur CWM update zip. It is inside /system/framework.
lostinbeta said:
2) If I push the new framework-res.apk what is the risk of getting the boot loop of death that tends to happen if you incorrectly theme a ROM?
3) If I were to be caught in a BLOD would that mean that I would need to restore via an sbf and start all over again or could I still access Tenfars CWM somehow during the boot process and restore to the last Nandroid backup?
Click to expand...
Click to collapse
If you keep a copy of GBlur on your sd then you can usually use CWM to recover from a BLOD. You may have to: disconnect from all power - pull the battery - with battery out plug into AC - CWM will start and you can reflash the working GBlur zip
lostinbeta said:
4) Should the device be wiped before testing a theme, or is it OK to just push the new framework-res.apk over the existing without wiping?
Click to expand...
Click to collapse
Since a theme is basically image modifications there is no reason to wipe. To go fresh after applying a theme flash the DeOdexed CWM zip.
Thank you for the info nottach, all seems pretty easy (I had already pulled the framework-res.apk from my phone, but I have the GB4 zip on my computer in case I need more copies).
There doesn't happen to be some sort of emulator for this is there? lol. I highly doubt there is, but it seems rather daunting to change a file, push the framework-res.apk then have to restart to see if the change was successful. All part of the game though, can't always expect things you aren't really supposed to be doing in the first place to be easy.
lostinbeta said:
Thank you for the info nottach, all seems pretty easy (I had already pulled the framework-res.apk from my phone, but I have the GB4 zip on my computer in case I need more copies).
There doesn't happen to be some sort of emulator for this is there? lol. I highly doubt there is, but it seems rather daunting to change a file, push the framework-res.apk then have to restart to see if the change was successful. All part of the game though, can't always expect things you aren't really supposed to be doing in the first place to be easy.
Click to expand...
Click to collapse
No problem, the more themes the better.
I dont think there is an emulator, but there is an app that supposedly restarts the framework-res.apk. Ive never used it so I can't say if it works. Basically I'll make a ton of notes about changes that need to be made then ill carefully do one at a time. I always keep the latest few working versions of my themes on my sd while creating in case something goes wrong.
Heres the app i was talking about incase youre brave.
http://forum.xda-developers.com/showthread.php?t=1028541
Ok, moment of truth... de-compiled & re-compiled framework-res.apk, changing multiple 9.pngs as well as normal .pngs... no errors on de-compile or re-compile... flashing now... Come on, no boot loop, no boot loop...
**Edit**
Success... thank God... think I got it down now... just takes some trial & error when beginning.
So for anyone interested, here is a little tidbit that is pretty useful on how the whole .9.png (Or 9 Patch images) work in android.
http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch
It helps understanding how to edit them.
It reminds me of the Scale9 method in actionscript (sorry, I used to be a web developer and actionscripter so I try and relate new code and methods to what I already know to understand them better).
So i googled how to theme Gingerblur and got the link you posted. I then became a member of this site for some clarification on the instructions and upon searching, i found this post which is pretty sweet. Anyways, back to the question.
I understand all the commands, seem pretty simple, except for step 2. Is this the actual theme file you're referring to? If so are there any restrictions to what theme I can use, or do only certain ones work with this rom?
Thanks in advance!
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.
I've seen previously that you can modify 'more_keys_for_smiley' in LatinIME.apk to modify the predefined smilies in the keyboard ( http://forum.xda-developers.com/showthread.php?p=23362533 ).
I'm trying to do this for LatinImeGoogle.apk.
I've got it decompiled with apktool, but I can't seem to find where 'more_keys_for_smiley' is defined to change it. The only reference to it inside of that apk is in key_styles_common.xml where it has:
<key-style latin:moreKeys="!text/more_keys_for_smiley" latin:backgroundType="functional" latin:keyOutputText=" " latin:keyLabel="" latin:keyLabelFlags="hasPopupHint" latin:styleName="enterKeyStyle" />
Can anyone help me locate more_keys_for_smiley so I can modify it? Does the "!text" refer to a different package?
Thanks in advance for any help.
Ok, thanks to someone's help I was able to figure out that the string is now located in the odex file for the keyboard. I was able to deodex LatinImeGoogle.odex using baksmali and edited the file com/android/inputmethod/keyboard/internal/KeyboardTextsSet.smali. I then used smali to recreate the odex file, but pushing it to my device and rebooting causes the keyboard to not load. Do I need to do anything special with this new odex file?
I tried following tutorials ( http://forum.xda-developers.com/showthread.php?t=1208320 ) and using automatic batch scripts ( http://forum.xda-developers.com/showthread.php?p=31360029 ) for recreating the new odex file and copying the signature from the old one, but I could not get it to work. At best I got the keyboard to load and instantly crash, at worst it wouldn't even load the keyboard upon boot.
Anyone want to offer some advice or take a stab at this?
Seems like your doing exactly what i'm trying to accomplish, and had success, so i'm gonna ask a couple questions, but first some background info.
I'm using a (Verizon) Galaxy Nexus, CM10.1 Clockwork Recovery, GAPPS. (no custom Kernels, etc)
I'm a windows guy, definitely a noob to linux, i'm comfortable following the more complicated instructionals, but traveling off the beaten path is difficult for me.
I was able to use apktool tool to decompile Latinime.apk, and i found KeyboardTextsSet.smali, and the smileys i want modified.
Is it as simple as recompiling and installing it? (remove/uninstall keyboard via TitaniumBackup first?)
You refer to a LatinImeGoogle.odex, is this only relevant to someone using an odexed rom?
I appreciate greatly any assistance you are able to provide!:good:
PrettyPistol555 said:
Seems like your doing exactly what i'm trying to accomplish, and had success, so i'm gonna ask a couple questions, but first some background info.
I'm using a (Verizon) Galaxy Nexus, CM10.1 Clockwork Recovery, GAPPS. (no custom Kernels, etc)
I'm a windows guy, definitely a noob to linux, i'm comfortable following the more complicated instructionals, but traveling off the beaten path is difficult for me.
I was able to use apktool tool to decompile Latinime.apk, and i found KeyboardTextsSet.smali, and the smileys i want modified.
Is it as simple as recompiling and installing it? (remove/uninstall keyboard via TitaniumBackup first?)
You refer to a LatinImeGoogle.odex, is this only relevant to someone using an odexed rom?
I appreciate greatly any assistance you are able to provide!:good:
Click to expand...
Click to collapse
Yes, you should be able to modify KeyboardTextsSet.smali and then recompile and install the keyboard. I never achieved any success because I'm on an odexed ROM and couldn't get reodexing to work properly.
Tried but no joy, then realized it could be because the apk was from a previous nightly (couple days) than the one currently installed. Crossing my fingers that it's the reason it didn't work.
I'll try again.
sent from my vzw Galaxy Nexus / CM10.1 (nightlies)
Is there any universal framework-res.apk that can be used trough apktool, to retrieve xml files? because I am confused, I don't want to install my app on any mobile device!! (just to play around with code) and everywhere people write about ROMs and getting the framework from my device, in order to get my apk to compile with apktool? WHAT?! believe me, i am doing my research but I just cant seem to find a connection between the needed framework.res, and some randomly downloaded camera.apk?
How am I supposed to find appropriate framework for any downloaded .apk from internet? is it possible? I have tried with obviously non appropriate framework-res, it gives me lots of errors, after -apktool d example.apkk. Again, I don't have intention of installing it on any device, yet. as I said before, I would like to get code, to learn from it and to play with it, xml is the issue now, because of this framework-res stuff!! While java non 100% code I have!
Thank you for your time
Hello XDA-Members,
I want to add some function to my system music player app. So I decompiled the classes.dex with dex2jar, copied the source code and add the code for my functions. Now my problem is that I do not know how to recompile the app. I can't compile it with Eclipse because it uses some system namespaces (in Eclipse it is an error so I can't compile) How can I recompile the app? I only have the *.java files.
Or can't I use the java files and have to edit the smali files? Of course that's much harder...
Greetings Cilenco
Do you mean this music player? https://github.com/android/platform_packages_apps_music or the google play music one? If you mean the first one, try to edit the original source as it's provided by google and if you don't manage to compile it, send it to me and I'll give it a shot At the moment, I'm building PA so my linux system is busy, but if it's done I'll try to get your files compiled
If the second is the case, one problem is that google play music is not open source (afaik) and java files sometimes aren't decompiled right. Anyway, if you sent me the java files I could try to compile them as well
Sorry that I didn't named the app. I have a custom ROM and it is the music app from Sony Ericsson. Here is the apk:
http://goo.gl/GwdqYU
David:D said:
If you don't manage to compile it, send it to me and I'll give it a shot
Click to expand...
Click to collapse
What would be your way to compile the source files? Is there a way to compile the java files with Eclipse although the app uses system resources and libraries? Of course I can get all resources, the manifest and so on from apktool. I mean if you can get it work I want to learn it too. I think this is a very exciting piece of coding / reverse engineering. I'm able to decompile system apps, change their resources and so on but I do not know how to compile them from java source.
I'm building some ROMs on my PC so if the app uses some system resources and libraries, they should exist in this build environment I would basically try to put your files as an additional package in my build environment.
Ah okay I believe I understand: To build an system apk from java code I have to build the whole ROM again? Is the flashable zip enough to compile the apk? Probably not, right? I use a custom ROM from the forum here so I think I don't get the source. Or can I use the source from the sony developer site?
Is there any tutorial or guide how I can do this? Maybe I want to do this with more apps so it would be great if I can do it for my own and do not have to ask you all the time
p.s maybe we should write PNs then we don't spam the forum and we can write on German
Ok, I had a look at the apk and it seems like it's not correctly decompiled. I could easily import it to eclipse but the problem is, that some types aren't named correctly. That caused about 3000 errors No system files are missing, it's just not possible to completely decompile it. Maybe some parts of it are obfuscated (one problem was, that there was a com.scalado.a package and a com.scalado.a type etc.)
At least, I wasn't able to completely decompile it... I used dex2jar to convert it to a jar file, then I decompiled the class files using jd-gui and got the resources + androidmanifest.xml from apkool. How did you decompile it?
Probably, you'll have to edit the smali code...
Or maybe it's possible to just compile the files you need. Maybe it's enough to place the jar-file in the classpath so you don't have to decompile all dependencies. What files did you edit?
Hi,
Could anyone help me with my problem?
I'd be eternally thankfull
See: http://forum.xda-developers.com/showthread.php?p=48976088#post48976088