I'm currently trying to modify the way the Vivid displays its network status indicators (the E, 4G, 4GLTE, etc.), and was hoping for a little help from somebody more experienced in the details than I. I'm aware of the methods to simply replace images by swapping PNG's in framework-res.apk and SystemUI.apk, but what I'm trying to do here is actually change the way it's displayed, so it'll show 3G/U or H like most other Android phones will. From the research I've done, I know this would involve some decompiling, which I've never done before. So my question is:
There seem to be two files that deal with the way Android displays network and signal status: SystemUI.apk and services.jar. (There's also services.odex, though I'm not sure how this fits in.) I've seen methods that decompile both, and I was wondering if anybody had any experience here to clarify which one I should focus on. (And additionally, isn't a .odex simply a variation on a .dex classes file, which would be contained inside a .jar anyway? So how does that fit in?)
You may ask why I want to do this! I'll tell you:
I've always found it midly annoying that to the Vivid a network is one of three things: EDGE, 4G, or LTE. What happened to GPRS, UMTS, or HSPA?
I know android reports at least the difference between UMTS & HSPA, thought I'm not sure about HSPA+, so it should be possible since most other phones do show it.
Now that I have a permanent root, I'd like to customize my phone to my liking
Several others have expressed an interest in making the network status icon actually work properly
I want to learn more about the nitty gritty details of how Android works, with the goal of getting more into ROM developement.
I can't find anybody else who's done it
Why not?
Thanks! Any help would be greatly appreciated!
PS - I know this is dev related, but I didn't make anything, and we don't have a Q&A, so I put it in general
if you deodex your /system then you dont have to worry about the .odex file at all.
i think it boils down to systemui.apk and the smali contained within.
if you dont know how to decompile, i suggest you learn how. start with some basic stuff, because editing smali is a pain in the ass.
http://forum.xda-developers.com/showthread.php?t=695701
http://apkmultitool.com/
learn how to use those tools. you will need them and you will also need to set up a few other things.
if you are on Windows, you need the JAVA JDK, and ADB SDK installed
it would help if you have Notepad++, as it is much better than any other notepad application on windows (IMO)
learn some smali/baksmali <this is the part i actually struggle with, i am still learning
ALSO, 7zip is the best archive tool on windows, bar none...
Pirateghost said:
if you deodex your /system then you dont have to worry about the .odex file at all.
i think it boils down to systemui.apk and the smali contained within.
if you dont know how to decompile, i suggest you learn how. start with some basic stuff, because editing smali is a pain in the ass.
http://forum.xda-developers.com/showthread.php?t=695701
http://apkmultitool.com/
learn how to use those tools. you will need them and you will also need to suet up a few other things.
if you are on Windows, you need the JAVA JDK, and ADB SDK installed
it would help if you have Notepad++, as it is much better than any other notepad application on windows (IMO)
learn some smali/baksmali <this is the part i actually struggle with, i am still learning
ALSO, 7zip is the best archive tool on windows, bar none...
Click to expand...
Click to collapse
Hey, PG, thanks for the pointers! Understanding how to decompile the apk's is one of the main things I'm interested in learning, so I appreciate the links you provided, as I hadn't stumbled on them yet! And I agree about NP++, great program! I'll see what I can do playing with it, but if I have questions, may I pm you with them?
I will help out where I can.
Sent from my HTC PH39100
Related
Right away, forgive my ignorance on the subject, I'm sure I can spend 10-12 hours searching forums and figure it out or someone can take 2 min and just answer it.
Lets say one was to take an app from the market and unzip it into a folder to see what it's made out of. Let's also say that one has absolutely no clue about android, Linux or programming in general, just too much curiosity and a phone to play with. So that certain individual (and I will not admit that it was me, it was.... my friend) found .dex file inside and thought of editing it, nothing fancy, just replace some URLs with other URLs. Here the question: How would I (I mean... my friend) would edit .dex file? Notepad seems to do it but something tell me (I mean... my friend) that it's not the right way. How would I put that app back toghether into .apk format after I'm done with it (Agh, screw it, it's me, it's not my friend). I should also note that I'm not trying to do this for profit or trying to steal someone's app.
Any help is greatly appreciated
You my friend are a Grade A tard.
apk files are not unzipped.
Decompiled maybe?
topdnbass said:
You my friend are a Grade A tard.
apk files are not unzipped.
Decompiled maybe?
Click to expand...
Click to collapse
Whatever you would like to call it. If it make you happy, I "decompilied" apk file using WinRAR to get a number of files including above mentioned .dex file.
Now that we have that figured out, how do I edit .dex file and repack everything else into .apk?
Thanks
First off, yes you can open the .apk file and see the other files but the files for the actual app are compiled. They arent editable. You would need the source to edit the app in any way.
As to the .dex file if you can open it with a text editor and change stuff all you are likely to do is break the app. As for putting it back together and getting it to install, good luck. You will probably need to get it resigned or something.
If you are wanting to learn how to make apps for android you should download the SDK. I believe there is a tutorial with some example apps that you can make out there somewhere also.
Dharkaron said:
First off, yes you can open the .apk file and see the other files but the files for the actual app are compiled. They arent editable. You would need the source to edit the app in any way.
As to the .dex file if you can open it with a text editor and change stuff all you are likely to do is break the app. As for putting it back together and getting it to install, good luck. You will probably need to get it resigned or something.
If you are wanting to learn how to make apps for android you should download the SDK. I believe there is a tutorial with some example apps that you can make out there somewhere also.
Click to expand...
Click to collapse
Agh, now we are getting somewhere.
Just for the record: I do not want to make apps, I'd rather leave it to pros and pay few bucks for working app that has no bugs.
The app I am referring too is StreamFusion which is a streaming audio player. Initial install puts about 30 preloaded stations in the playlist, none of which are of any interest to me. I unzipped apk and found this .dex file (resources.dex? not at home, can't check) which contained URLs for default-loaded streams. All I want to do is replace them with URLs of my own so I don't have to search shoutcast,add my stations and delete defaults everytime I decide to wipe my phone. Sounds like such a simple task, yet there's no clear documentation on how to do something like that (at least for the non-dev crowd).
With that said, I don't want to change the way StreamFusion, they do give you an option to remove defaults manually (one by one!) and they do give you an option to add your own stations in the playlist. It just takes too long and I've done it a few too many times already.
I'll keep playing with it, let me know if anyone for sure knows how to do it, otherwise I'll report when I figure it out or when I get tired of it.
Sorry for being rude earlier, i was in a bad mood
If you mean StreamFurious all you need to do is long press the radio station and hit delete
topdnbass said:
You my friend are a Grade A tard.
apk files are not unzipped.
Decompiled maybe?
Click to expand...
Click to collapse
Have you actually tried renaming an .apk file to .zip and opening it? In short, apk is just like a jar. They're just zip files with specific metadata requirements.
“Always keep your words soft and sweet, just in case you have to eat them.” -Andy Rooney
borodin1 said:
edit .dex file? Notepad seems to do it but something tell me (I mean... my friend) that it's not the right way.
Click to expand...
Click to collapse
when in doubt .. HEX .. hex editing of a file can maintain its purest essence and prevent it from crashing .. provided of course that you edit the right parts .. i've done this thousands of times in computer games .. change one little thing and POOF! your scrawny little piss-ant becomes mighty hercules and you can slay the dragon - LOL - ok .. so maybe not so korny
borodin1 said:
With that said, I don't want to change the way StreamFusion, they do give you an option to remove defaults manually (one by one!) and they do give you an option to add your own stations in the playlist. It just takes too long and I've done it a few too many times already.
Click to expand...
Click to collapse
The defaults that are hard-coded into the apk are loaded on first run into a sqlite3 database. Sure you could edit the hard-coded defaults, but this would be an unclean solution. A better solution would be to backup the sqlite3 database to your computer and restore it with adb whenever you reinstall. You can also easily edit the database conveniently on your pc as well.
The location of the db is /data/data/com.streamfurious.android.free/databases/streamfurious.db
By the way, the SF defaults already include KQED, BBC WS and TWiT. What more could anyone possibly need
You can decompile apk class files from the dex file.
http://zeaster.blogspot.com/2007/11/how-to-decompile-dex-file-on-android_28.html
As for repacking it after the edit.....check this out this might help...
http://forum.xda-developers.com/showthread.php?t=503007
or ask strazzere
I want to make a thread for both those that are already Dev'in themes, and those that want to start, can trade info and techniques. For example:
(Program)
Photoshop Editor:
Then a description of a given process...
Etc.
I know that there are How To's, http://forum.xda-developers.com/showthread.php?t=471586 but I'd like a more direct, and detail orientated place to discuss the specifics. I've tried a few attempts myself and found that some programs work, some don't. Plus, since the prices of some of these programs are as high as $600, and the fact that there are thousands of web-based programs, it'd would be nice to see what works best for who, and how.
Hopefully, this will turn into a good resource, and we'll soon have a forum full of the most excellent themes.
MODS: Let me know if I'm outta bounds and I'll fix. This is my first time makin a thread so it ain't all that.
To Do:
*search and post Theme Developement info for Windows, Linux, and Mac
These are links to useful threads related to different parts of theme developement...
Key Files Chart:
http://spreadsheets.google.com/pub?key=r_ua-t_U23ci5_oxwQ4mGrg
Creating your boot animation:
http://forum.xda-developers.com/showthread.php?t=527200
Progress circle style/color editing:
http://forum.xda-developers.com/showthread.php?t=540830
Editing .XML's:
http://forum.xda-developers.com/showthread.php?t=479019
How to use baksmali/smali:
http://forum.xda-developers.com/showthread.php?t=537779
General Theme Developement:
http://forum.xda-developers.com/showthread.php?t=467639
Using DrawPatch-9:
http://developer.android.com/guide/developing/tools/draw9patch.html
Signing made easy:
http://forum.xda-developers.com/showthread.php?t=473580
photoshop is my primary weapon of choice but I've also found that for minor edits like color changes touchups transparency changes and resizes photoscape and fotoflexer work pretty well especially when I'm at work and decide to mess around because I can't install photoshop on my work computer due to administrator locks I just downloaded photoscape and installed to the documents folder and fotoflexer is an online image editor and both are free
Okay... here is something very usefull...
You know those pesky indexed files right? they corrupt if you open them in photoshop?... I figured out how to remove the indexing... first you need to download and install Paint.NET off of the web... and then install(of course)... and then open any indexed file in Paint.NET... then save it... and it will be un-indexed... ... this will be very usefull for lots of people... cuz it is for me!
I like paint.Net myself. Its free and if you load the plugins available you can get a lot done quickly and easily.
Best tip is to make sure you save stuff in layers so that if you only need to edit part of an image you can.
Another tip is after you finish your edits you can expand the canvas on all sides by 1 pixel then use solid black for doing the .9 marks. Once done you can dump your files right into the latest eclipse and draw9 isn't even needed which saves a lot of time.
Also 7-zip is just amazing. You can use the file manager to move files between zip files and apk and even jar files without unpacking or packing over and over.
I agree with beagz 7zip is a must it makes it a hell of a lot easier when porting your themes for new builds another life saver is the android sdk lot s of useful information in there and eclipse for compiling .9 images which there are samples of in the android sdk to show you how to do the guides properly like beagz was talkin about in his previous post because if you mess one of those your phone can end up totally screwed
This is easy
Apps
.zip/.apk management: 7-zip (the most important part of theme development)
image manipulation: GIMP
Software
sign/resign files: Java JDK
.9.png editing: Eclipse to compile the apk
Pre-reqs
ADB working properly through the command prompt
Applications that make theming possible for Jonnybueno
I use Photoshop for images. Hue and Saturation(ctrl+u) is my best friend for changing the color of stuffs. For hex editing, I use HXD, outlined in this thread by Stericson: http://forum.xda-developers.com/showthread.php?t=479019.
For signing, I use Stericson's Autosign.bat. If you don't know, you can double click on this to pull up the command prompt rather than launching the command line and then typing "autosign". Also, you can copy the file path by right clicking while holding the shift button on Vista.
And finally, for notification text, I use Ohsaka's colorChange.jar. Along with this really simple batch file.
White text:http://sharebee.com/b6b43290
Which is just one line(that I'm too lazy to type everytime I update)
Code:
java -jar colorChange.jar theme.zip ticker=FFFFFFFF clock=FFFFFFFF date=FFFFFFFF ongoing=FFFFFFFF latest=FFFFFFFF clear=FF000000 network=FFFFFFFF roam=FFFFFFFF
Resources
For viewing source to reference those xml files, I use these sites
Cyanogen source:http://github.com/cyanogen
Android reference (stock): http://developer.android.com/reference/android/R.attr.html
And then this website for finding just the right RGB codes: http://www.colorschemer.com/online.html
Tips
I've learned that it is totally possible to rotate .9.png files using windows without having to redraw them and that images don't have to be the original size. There is a limit to how big you can go... but i have no idea what that limit is.
Oh and for different colored(other than black) notification text for downloads, edit the only xml file in DownloadProvider.apk/res/layout. For example, 0800001C 000000FF becomes 0800001C FFFFFFFF. In case you're confused, whats happening is that you're changing an ARGB code (which is backwards, so you're looking at BGRA... see stericson's thread please) from black (000000FF) to white (FFFFFFFF).
Working from Linux (Ubuntu) I've found File Roller to work as nice and easy as 7zip in Windows for working with zip/jar/apk.
GIMP is my gfx editor of choice in both worlds. Glad I discovered you don't need draw9patch to put the .9 guides in - draw9patch is a pain to use!
In Windows I use XVI32 a hex editor, ghex in Linux.
testsign.jar is all you need to sign - very simple from command line in both Linux and Windows
/Mats
I use Adobe fireworks for image editing a little easier then photoshop and has styles for lazy ppl like me and winrar full version for managing the apk's and zips and png crush setup to right click and crush pngs for compression if your update is too big.
I know this thread has been dead for a while but I see new phones linking to it as a resource for themeing, so I wanted to let you know that I have compiled a huge amount of information into one guide, see http://forum.xda-developers.com/showthread.php?t=667951 for detalis
As a side note: you might want to note the fact that my tutorial for changing/creating boot animations is for pre-2.1 builds (unless someone really decides they want a pre-2.1 boot animation on their phone, of course). I havent got around to updating the boot animation tutorial for 2.1+, cause thats going to be a looooong post.
Hi All,
i was wondering if there is a way to open a .apk file and see the coding for the app. Thanks in advance for your help all.
You mean like reverse engineering? It's a pretty fine line around here...
Not tryin to do anything bad or illegal..just wanted to see what an app code looks like...how its broken down....thats all
most apks arent just one thing. the apk acts like a zip file, containing potentially lots of files inside. you can use winrar to open them just fine.
thanks just tryin to learn what makes an app and how it works
jef8310 said:
thanks just tryin to learn what makes an app and how it works
Click to expand...
Click to collapse
http://developer.android.com/guide/developing/tools/index.html
thats where you should go then lol
Thanks B-man007...i will check that out
Just rename your .apk extension to .zip and unzip it. You will get to see some stuff there.
Stuff you can't see readily:
The manifest file can be viewed with some tools available on sourceforge (very easy). You can disassemble/reassemble the .dex file(s), but I warn you that this is a pain in the A. I have done it several times and cursed all the way through each time.
What are you trying to do?
Easy apk dissassembler.
The most easy way to dissassemble APK is using this app:
Is easy and intuitive.
http://code.google.com/p/easy-apk-dissassembler/
You have this thread too
http://forum.xda-developers.com/showthread.php?p=14049173
reverse engineering is how i learned to write my own programs for my ti-86 graphing calculator back in high school. seeing how/why things work inside an established program helped me figure out what i needed to make what i wanted. i wish app development was as easy as basic haha. of course, i say that with no knowledge of java or android programming. i plan on going to school starting next year to learn it though.
While I'm new back in playing with the Android OS, I spent a ton of time modifying my iPhone when I had it, creating custom icons, wallpapers, overlays, etc.
What I've noticed recently is that most of the icons in the Android OS really don't have much synergy in their designs. Every widget maker has something a little different in what they see as their own design, but they often times don't make all of the widgets that I would like, and I'm stuck with a hodgepodge of different looking icons and widgets cluttering my screen.
I'm curious if there is a somewhat easy way to modify the graphics files of these widgets so that I can create a very clean theme. To give you an idea of what I would enjoy creating, I'll attach a before/after picture of some modified icons that I was using on the iPhone. While they retain the color schemes for the most part, I felt like I was able to make everything feel a bit more cohesive in a theme, and I would love to continue that trend on my Hero.
So the eternal question.... can it be done? And if so, is it something a mere noob back to the Android OS can make happen?
it is actually pretty easy, i will explain as good as i can. there are some drawbacks:
you need to resign the apk. there is testkey available at this forum, and i think you can generate your own with the sdk (not sure if and how). but after resigning the apps are signed with the testkey, not the developers key. i do not really understand what that means, but it was a hint i read somewhere...
i am not sure whether the apps will be flagged by the market as "update available", but i don't think so because they won't appear in your downloads list, since you have to install them "manually".
that is AFAIK all for the cons, here's the how:
1. extract the .apk, rename to .zip if necessary.
2. find the image you want to be replaced, should be somewhere in [extracted folder]/res/drawable/
3. edit the image to your needs and save it.
4. re-zip the contents of the folder (including the not changed elements of course) to whatever.zip
5. rename whatever.zip to whatever.apk
6. sign whatever.apk
as for signing, here is how to do:
http://forum.xda-developers.com/showthread.php?t=551711&highlight=howto
the process for apps is basically the same as for update.zips, just don't use with recovery image but filemanager to install as regular app...
i think there is a theme howto out there on this forum, maybe that helps too.
kendong2 explains it well .... it is easy when it all clicks into place check my siignature for more help
Hi,
I just started a new project.
It's a little piece of software that can be used to easily interchange image files in framework-res.apk and other files. Currently it's just a proof of concept. The software is able to pull the files from phone, extract them, exchange the statusbar (just for my phone right now) and push it all back to the phone.
I first wanted to make it wysiwyg... But that won't work because the devices are too different after all. And I still have to find a way to deal with odex'd files.
However, I think it will be one of the more comfortable ways to exchange resource files.
To check it out or for feature requests and stuff look at https://sourceforge.net/projects/droidthemetool/
Hope you are interested...
Not sure if I am gonna use it myself! Apart from replacing my notification bar with a black one.
Cool, would love to see something easier to mod / customize the status bar. I gather you would have to be rooted for this?
Yes you have to be root. It is necessary to remount the system partition writable and replace the resource files.