Every time I decompile an APK with apktool it screws up the order of drawables in public.xml, and it is really tedious to have to go line by line and reorder the file so that it compiles correctly. I'm not really sure why it does that, but I made a little site to easily fix it on the fly. Just paste the entire contents of your public.xml. No more reordering of the public.xml file is necessary because the site can reorder it for you by type/name and ID. After you reorder your results you can just click a copy button and it will copy it to your clipboard. The copied data is not perfect, you will probably have to do one or two find/replace's on it to get all the lines straightened out but the ordering will be done for you. Thought this might be of some use to themers that decompile a lot of apk's and run into this problem.
http://evanborden.com/main/reorder/
What are you decompiling? I've never had this problem.
Sent from my SCH-I500 using XDA Premium App
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
Well my old thread got deleted, So i decided to redo it.
I am sure by now most of you know that editing .9.pngs cause some ill effects on certain images. Well i found a way to edit these images and make them look as good as Google's!
What you need:
Android SDK - Will be using the draw9patch tool in the tools folder.
Eclipse IDE - We will need this to compile the .9s
Photoshop or other image editing sfotware - with PNG compression.
Setting up the enviroment:
When i setup the SDK and Eclipse, i put them inside of C:\Android. Make sure to follow the instructions from here, it will walk you through setting up Eclipse to work properly with Android.
::Tip:: When you get to the part "Installing the Eclipse Plugin (ADT)" the URL "https://dl-ssl.google.com/android/eclipse/" sometimes gives an error, just change https to http and it should go through without an issue.
Now basically put a .9.png is an image with guides that tells Android where the image can be stretched and where the content will be placed inside the image. An easy example is a button, some fit only one word and others stretch across the whole screen and Android will put the text in the middle of the button.
When you open a .9.png you do not see the guides, that is because they are hidden. When you want to add the guides to an image, you have to drag it into the draw9patch tool. Now the tool has a hidden secret i figured out.(not really hidden, but not well described) If you open an image with the .9.png extension it just opens it. But if you open an image without the .9.png extension, it adds 2 pixels to its width and height. These 2 pixels are for the hidden guides. For example the btn_default_normal_disable.9.png in framework is 44x48. But if you remove the .9 from the file name and drag it into the draw9patch tool it changes to 46x50. Which you will notice after you save the image from the draw9patch tool. Also it will add the .9 to the file name.
Howto: draw9patch
The idea of the draw9patch tool is very simple, you drag an image into it you create the guides and you save the image. But the guides are very specific and if you do not do them properly your image will look strange. So follow these few rules about the tool.
Remove the .9 from image name before you drag it into the tool.
The top and left side guides set where the image can be stretched. Where ever you put a guide is where the image will stretch. Do not put more then 2 next to each other.
The bottom and right side guides set the content area(where the text will go). Now you can only put the guides in the outer border, once the image is compiled this border will be hidden. The tool will not let you put any guides anywhere but the outside border. Now usually you will put a 1x1 guide on the top and left sides, on the right and bottom you want to draw a full line. I have tried putting multiple guides on the top and left but the aapt tool seems to stress out and crash before compiling.
Once you save the image the draw9patch tool should of added the .9 to the name. That is all to adding the guides to the image.
So now your saying ok, i have the image and i still see the guides. To get rid of these lines we need to compile them with Eclipse. Basically we add them to a project in Eclipse and create an apk. During the compile the aapt tool from the sdk will set the image back to its original resolution and hide the guides.
(I am hoping to figure out some command lines for the aapt tool so we can skip this step. But until then editing these .9s are a big pain in the arse!)
Howto: Compiling in Eclipse.
I am assuming you followed the link above for setting up Eclipse and can create a new Android project.
Once Eclipse is open you want to go to "File\New\Android project". Select "Create project from existing source". It should default to the path of the samples in your SDK directory, but if it doesn't just browse to them. I have been using my own project but any sample should be fine. Choose "Finish" and on the left hand side under Project Explorer, you will see the name of the project you opened. Expand the project, then Res and you will see the Drawable folder. You will want to drag your edited .9s here. Once all of the images are in the drawable folder you want to right click the top level folder(Project name) for your project and choose "Android Tools"(second from botom) then "Export Unsigned Application Package..." Save the apk where ever you'd like, just remember where you put it. Cause you will want to open it and take the images out of the drawable folder. You will notice now that the guides are gone and the resolution is back to the normal size. Drag the images into your theme and you are done.
The images below are some screen shots of the draw9patch tool. The first one shows how most of the .9s should look with guides, the second shows with the Show Content checked and the third is what happens when you put your mouse inside the outer pixel range.
Attached is a zip with the drawables from framework-res, launcher, contacts and phone apks from the source. It has the .9s and xmls before being compiled, so you can use these images instead of having to use the draw9patch tool. But it doesn't have all of the same images, there are some missing and some that are not in our firmware yet. So do not just copy and paste all of the images, i have been just copying certain ones into my theme directory and editing them there. Also becareful when editing these images, if any of the guides color changes Eclipse will throw an error. This is easily fixed by using a 1 pixel pencil tool in photoshop and going over the guides with black. Also you need to make sure that there is not anything other then the black guides in the 1 pixel border of the images. you will get errors before compiling if there are. I normally use the rectangle marquee tool to highlight the edge and use the Del key to make sure nothing is in the outside edge.
I wonder why the other thread was deleted?
Anywho, thanks again for all the help on the .9.png files, I know its probably one of the biggest frustrations for new theme makers like me. I'll be working more with them on my second theme, the first one will just have to do without I suppose.
Thanks for all the contribution to the theme community!
Nice find, thanks for the info!
Seems like a lot to do, I've had no problems at all with my .9.png's, but this is good to know.
Bookmarked.
Thanks Man I have been trying to piece this info together with the thread and was getting nowhere. thank you for putting this out here.
A lot of work for sure, but if you're going for a full system theme you'll pretty much have to take the time to do things right. Very good info.
There are a few .9s you can change with minimal defects but things like buttons and tabs its pretty tough to get them perfect
when I try to export it fails because it says the .apk doesn't exist. What am I missing here? Thanks for your help.
it says the bin folder doesn't exist. but if I try to create the bin folder it says it already exists. confusing. what should I do?
Hmm not familiar enough with Eclipse to help out with this. But make sure there are not any errors on the images or any part of the app.
when I open up all of the sample apps they already show errors. Any thoughts on that? They show errors in the srs and the Android Manifest. I checked all of them. They all do.
Do they show warnings or errors?
they have a red box with an X next to them. What does that mean?
says I have to fix the build path for java.lang.object - any idea how I do this? Sorry for bothering you.
Ahh its no problem. The red X's are errors, yellow triangles are warnings.
You might want to run thru the steps of setting it up again and see if that fixes it.
Sounds to me something is missing. You did set the path of the SDK in Eclipse right?
haha... nope.. that fixed it - thanks so much. As you can tell you're talking to a real nube here that just tries to get things to work when he needs them.
ok, 1 more question. If I'm using the images that you provided in the zip, what are the necessary steps to edit them? Not sure I'm clear on that
for example. I want to make the search_bg.9.png in the drawable-port transparent. What's the steps? (I of course know how to edit it in photoshop so you can skip that step)
parmenti said:
for example. I want to make the search_bg.9.png in the drawable-port transparent. What's the steps? (I of course know how to edit it in photoshop so you can skip that step)
Click to expand...
Click to collapse
you set the layer to whatever % you want it at. then save for web and devices.(make sure you replace the right image) remove the .9 from the name, open it in the draw9patch tool, set the guides, save the file, drag it into the drawable folder for any android project, right click the root folder in the project, choose Android tools, choose export unsigned apk, save the apk, open it in winrar take the .9.png you just put in it and replace the original in the update.zip.
done =)
what would cause the images not to compile when exporting from eclipse? I moved the images over, went through the steps to export and opened the apk but the drawable folder does not contain my edited images I added
I need or hope to find a dummy app that will peak into an apk and grab the icon and decoded AndroidManifest.xml.
I have looked at apktool and some others but have encountered various problems. Like I have 100 apk I want to run this against and running apk tool 100 times is inefficient.
Any pointers are appreciated.
And what data do you need from AndroidManifest.xml?
I am currently messing around creating my own personal theme. I have been successful in changing every image except the buttons. For example, this one: btn_default_normal.9.png
I did a little Googling and understand the concept about 9 slicing. I have done flash for years and it pretty much does the same thing when scaling objects.
However, when ever I modify one of the button images, even just changing the color, the slicing goes to crap. It just scales the entire images instead of slicing it up.
If anyone has run into this before, I'd love to hear your solution.
Sent from my FroyoEris using XDA App
rhamej said:
I am currently messing around creating my own personal theme. I have been successful in changing every image except the buttons. For example, this one: btn_default_normal.9.png
I did a little Googling and understand the concept about 9 slicing. I have done flash for years and it pretty much does the same thing when scaling objects.
However, when ever I modify one of the button images, even just changing the color, the slicing goes to crap. It just scales the entire images instead of slicing it up.
If anyone has run into this before, I'd love to hear your solution.
Sent from my FroyoEris using XDA App
Click to expand...
Click to collapse
.9 images are a pain to work with, but here's what you need to do...
1- download the android sdk kit
2- in the android sdk, there is a program called draw9patch. This let's you edit .9 images for scaling.
3- you will need to download a 9image compiler. There's one called xultimate-d9. This will compile the images for use on your phone.
First, modify your image and save it. Next, open draw9patch and drag the image in. Place a solid border on the bottom and right sides. Place a single dot middle left and middle top. Save the image. Finally, put the modified images in the compiler folder (example1/res/drawable-hdpi) and run the compiler. It will put the final image in a "done" folder. Put that in your theme and your done.
If your doing a large theme with alot of 9images, this will take hours... been there!
You can bypass some steps if you decompile the apk using apktool in the sdk kit. This retains the patch borders, but you have to make sure the borders stay black or you'll have trouble compiling them.
Good luck! Its alot of fun!
Sent from my FroShedYo.V8-ERIS using XDA App
Thank you! That is exactly what I needed to know
Sent from my FroyoEris using XDA App
Macrodroid said:
.9 images are a pain to work with, but here's what you need to do...
1- download the android sdk kit
2- in the android sdk, there is a program called draw9patch. This let's you edit .9 images for scaling.
3- you will need to download a 9image compiler. There's one called xultimate-d9. This will compile the images for use on your phone.
First, modify your image and save it. Next, open draw9patch and drag the image in. Place a solid border on the bottom and right sides. Place a single dot middle left and middle top. Save the image. Finally, put the modified images in the compiler folder (example1/res/drawable-hdpi) and run the compiler. It will put the final image in a "done" folder. Put that in your theme and your done.
If your doing a large theme with alot of 9images, this will take hours... been there!
You can bypass some steps if you decompile the apk using apktool in the sdk kit. This retains the patch borders, but you have to make sure the borders stay black or you'll have trouble compiling them.
Good luck! Its alot of fun!
Sent from my FroShedYo.V8-ERIS using XDA App
Click to expand...
Click to collapse
i cant seem to find that compiler. a link?
Hello everyone......if youre like me and just want to beat the crap out of a game that ticks you off sometimes then this is for you. This guide will explain how to edit the apk for fieldrunners hd. I will not supply or distribute the apk, so please do not ask.
First you will need the apk file you have purchased from android market. If you have an apk from amazon app store it will not work.
Start by changing the file extension from apk to .zip. Next, extract the contents of the file to a new folder on your desktop. (Folder can be named anything you like)
Open folder Assets>Data>HighResolution>Maps
Here you will find 4 folders....Cave, Crossroads, Drylands, Grasslands
Open the Folder for the level you wish to edit. (I will use grasslands as example for this guide)
Look for the files that have a ~map.mp3 extension. Open this file with a text editor like notepad. A few lines into the file will see this "startingHealth="20" startingResources="15". Change these values to anything you want them to be.
If you would like to modify the specs for the towers you can do this as well. I find it fun to make one weapon that just kills everything in one blow.
Open folder Assets>Data>HighResolution>Towers. Look for the tower you would like modify and open the file with a ~tower.mp3 extension in a text editor like notepad. Each tower will have one of these files for it. When opened look for <minDamage="129" maxDamage="129"> There will be a line like this for each level of tower, 1,2&3. Change he values to whatever you like, the higher the number the stronger the weapon.
Now that you have editied all maps and towers you want to it is time to button this up. Select all the files and folders you extracted from the zip file and create a new zip file. I use winzip with no compression. Name your new file whatever you like and save it to the desktop or a place you can find it. Now change the file extension of the new file from .zip to .apk. You will now need to sign the file, you will have to learn that in a different writeup. Once the file is signed it will install and you will see the changes in the game.
Good luck tinkering, do not post apk's here, and please act responsibly.
Could you please explain how to mod subway surfers for unlimited money ,they are found at many sites on net but i want how do they mod it
Sent from my GT-S6802 using Tapatalk 2