Editing APK files - Android General

Hi i have read a few posts about editing apk files but most are only about editing the image files. i need to edit the classes.dex file inside the apk i have done this but when i try and install the apk it doesnt work is this possible to do? thanks
this is not to do anything illegal it is simply to make an android app i use equal to the iphone equivalent (there are less servers for the android app) so i basically want to change the url from the apk to the iphone url)
Cheers

morgs640 said:
Hi i have read a few posts about editing apk files but most are only about editing the image files. i need to edit the classes.dex file inside the apk i have done this but when i try and install the apk it doesnt work is this possible to do? thanks
this is not to do anything illegal it is simply to make an android app i use equal to the iphone equivalent (there are less servers for the android app) so i basically want to change the url from the apk to the iphone url)
Cheers
Click to expand...
Click to collapse
Tried signing the file after modding it?
Sent from my GT-S5360 using xda premium

Hi thanks for your reply, yes i have and it still doesnt work unfortunately

Use apktool to extract the APK, you'll get .smali files instead of classes.dex (this is the decompiled version). Edit these files appropriately, then repack the APK with apktool and sign it. Should work.

Does apktool require command line? if so it is too complicated for me

Yes, it does. If command line is too difficult, it's probably unlikely you'll be able to get this working I'm afraid. You could try this: http://forum.xda-developers.com/showthread.php?t=1619473
It's an IDE for editing APKs, might help. But honestly, the command line part is the easy bit

Just never had any luck with any command line stuff for android never works for me and i hate all the extra crap you have to install to use it. Thanks anyway ill see how i go.

morgs640 said:
Just never had any luck with any command line stuff for android never works for me and i hate all the extra crap you have to install to use it. Thanks anyway ill see how i go.
Click to expand...
Click to collapse
If you wanna do basic stuff wid apktool then its a reaaly easy tool.. The commands are really very small!
Apktool d xxxx.apk for decompile
Apktool b xxxx for compiling n ur done!
Even the complex ones arent difficult! Only the installing of apktool takes time and its the hardest thing in the whole procedure
Sent from my GT-S5360 using XDA

in theory apktool is faily simple. but if you compile for android 4.0 better prepare yourself for huge headaches and a couple of white hairs as this thing wont work. i know two solutions, one consists of a really stupid juggling with two versions, one old which you can barely find, and one new, decompile with the old one, compile with the new one. some guy made a mod though and it finally ends the trouble, but i haven't seen it officially pronounced, which made it so damn hard to find it, hidden in some internet forums. another problem was that aapt needs to be present in the same directory, error codes will just spew out a bunch of gibbersish and you will never know whats wrong so all thats left is trying. but once you got it working it is as easy as pie.

molesarecoming said:
some guy made a mod though and it finally ends the trouble, but i haven't seen it officially pronounced, which made it so damn hard to find it, hidden in some internet forums. but once you got it working it is as easy as pie.
Click to expand...
Click to collapse
You mean this: http://forum.xda-developers.com/showthread.php?t=1551236 ? (It was about two threads below this one at the time I posted this )

nice! i made myself little batch files for this. i just go "apkd skype" to decompile skype.apk and apkb skype for building it, zipping it, signing it. didnt even know theres a guy out there now.

SifJar said:
Yes, it does. If command line is too difficult, it's probably unlikely you'll be able to get this working I'm afraid. You could try this: http://forum.xda-developers.com/showthread.php?t=1619473
It's an IDE for editing APKs, might help. But honestly, the command line part is the easy bit
Click to expand...
Click to collapse
This program worked perfectly thank you so much

Related

Building android: noob warning

Howdy,
I just built and installed android 1.1 on my dev w/o major problems. But how do you create an update.zip? I tried dumping system.img,userdata.img and root.img into a zip file, but it failed to verify with a signature error.
Thanks for any help!
Might sound like a silly question, but did you sign the update.zip?
Meltus said:
Might sound like a silly question, but did you sign the update.zip?
Click to expand...
Click to collapse
Nope. Is there a tutorial on how to sign? (btw, I'm on either OS X or Linux).
Thanks!
all u had to do is take a look over at the theme subforum and u would have found this:
http://forum.xda-developers.com/showthread.php?t=471586
it has apk signer and .zip signer as well
Thanks! I appreciate it
haitiankid4lyf said:
all u had to do is take a look over at the theme subforum and u would have found this:
http://forum.xda-developers.com/showthread.php?t=471586
it has apk signer and .zip signer as well
Click to expand...
Click to collapse
Ocalap2p said:
Nope. Is there a tutorial on how to sign? (btw, I'm on either OS X or Linux).
Click to expand...
Click to collapse
Never mind. It looks like the sdk has the java tools I'll need
reviving old thread, i searched and this is all i could find related to what i'm asking. I downloaded a system.img and boot.img that are very, very, very bare. They're almost stock android (nothing but the system, phone, camera, settings, calendar, calculator, and alarm). there aren't even any ringtones, notifications, ui sounds, or alarms. nothing. the thing is bare, i think even the drivers are broken because i can't end calls. anyway, this is perfect for me because i want to use it to study android and get more acquainted with it before i start actually building from source. I pretty much want to know what every single file does and what files apks depend on. Anyway, this rom is good for study, but i want to be able to make an update out of it once i start adding things, but how do i go about extracting all files from the system and boot imgs?

AvaboxV2. Dev toolbox for Windows

This is a toolbox i put together for windows users that want to get involved with theming porting etc..
With that said lets see some innovation with theming and porting. now theres no reason to not learn how to do these things. trial and error.
This update now includes a deodexer folder that will allow people to deodex apks. I have also included more boot.img perl scripts to unpack specifically what you want. and there is now one to repack the boot.img's. Be careful as there can be errors while reading the kernel during extract.
I hope this can further development for the hero. goodluck!
Download-AvaboxV2.zip
Sounds awesome. I'll take a look at it tomorrow after class. Thanks!
Always willing to try something new. I have no reason for fresh kitchen, but i got it. lol
Downloading now
I had the first version. It would of been handy awhile back, I forgot i had it.
Sounds Good! Goin 2 Check It Out..
Avalaunchmods said:
This is a toolbox i put together for windows users that want to get involved with theming porting etc..
With that said lets see some innovation with theming and porting. now theres no reason to not learn how to do these things. trial and error.
This update now includes a deodexer folder that will allow people to deodex apks. I have also included more boot.img perl scripts to unpack specifically what you want. and there is now one to repack the boot.img's. Be careful as there can be errors while reading the kernel during extract.
I hope this can further development for the hero. goodluck!
Download-AvaboxV2.zip
Click to expand...
Click to collapse
Appreciate the help, thanks Avalaunch.
man this thread was hidden.
glad to help people.
Finally found this... Ok I have been trying to deodex on my own with NO success, I tried AvaboxV2, and everything looks good, says it's ok, but when I look inside the newly created apk it is missing the classes.dex which I believe is needed and required to work right...
What I am exactly trying to do is De-Odex HtcLockScreen.apk from ZenEXP-0.9.6.2 so I could then possibly fix the stupid Menu Menu Unlock issue. Any help would be most appreciated, I have also tried xUltimate with no success either.
Thanks man!!!!! This is awesome!!!! I'll be up and theming in no time!!!!

[Q] Extracting source from APK

Hi, I am trying to get the source code of the ToggleWidgets.apk that cames with my Motorola Defy+. I already read many things (since I am new user, I am not able to post outside links) but I was not succesful on doing it. What I did so far:
Copied the frame moto-res.apk, framework-res.apk, and blur-res.apk from my Rom.
Installed it on the apktool, apktool if ...
Runned apktool d ToggleWidgets.apk and it was correctly extracted into the dir ToggleWidgets
Now I was expecting to find a classes.dex file. But there is not, and I got stuck. If someone knows what should I do, or a link with things to clarify, I would be thankful.
I just renamed one of my apps with .zip and opened it, and the classes.dex file was in there. not sure if that helps or not.
@ronaldguilmet: It was the very first thing I tried. Interesting that in my case the file present. Thanks!
I guess the class files generated with the Android SDK uses obfuscation through Proguard. I think you cannot disassemble it.
PS: If you approved the previous answer please click on thanks.
thgramos said:
I guess the class files generated with the Android SDK uses obfuscation through Proguard. I think you cannot disassemble it.
PS: If you approved the previous answer please click on thanks.
Click to expand...
Click to collapse
I do not know why ToggleWidgets.apk does not include classes.dex file. But when I tried different applications, I could get the source code using dex2jar, and then jdgui.
eduardomucelli said:
I do not know why ToggleWidgets.apk does not include classes.dex file. But when I tried different applications, I could get the source code using dex2jar, and then jdgui.
Click to expand...
Click to collapse
did you manage to deodex it? if so, can you tell me how? I've tried differents methods with no success. My ultimate goal is to be able to use the Toggle Widgets in a custom ROM like CM9, I don't even know if this is possible without using the motoblur launcher. Could it be that you are trying to do the same thing? it's just that I like those widgets so much and I would like to keep them in a different ROM.

[Q] Recmod and Reversmode not working

I am using a couple of really old programs called recmod and reversmod and I am having trouble getting them to work. When I use the recmod tool, I do get a .dll file out of it, but the file is always 1kb and if I open a bunch of them in hex edit, they are nearly identical and each mentions that "this file cannot be run in DOS mode". Other than that, the rest of the file is almost entirely zeroes, so the code is null. Also the reversmode crashes when I try to use it on the .dll files I created, most likely because the files are busted.
In this thread: http://forum.xda-developers.com/showthread.php?t=1251237 OndraSter mentions something about recmod/reversmode using type 5 and 7 instead of just type 3. I don't really know what to make of this and Google leads me only to things that don't pertain to recmod at all.
Does anyone know how to make recmod work nowadays? Thanks in advance for any help provided!
ckv said:
I am using a couple of really old programs called recmod and reversmod and I am having trouble getting them to work. When I use the recmod tool, I do get a .dll file out of it, but the file is always 1kb and if I open a bunch of them in hex edit, they are nearly identical and each mentions that "this file cannot be run in DOS mode". Other than that, the rest of the file is almost entirely zeroes, so the code is null. Also the reversmode crashes when I try to use it on the .dll files I created, most likely because the files are busted.
In this thread: http://forum.xda-developers.com/showthread.php?t=1251237 OndraSter mentions something about recmod/reversmode using type 5 and 7 instead of just type 3. I don't really know what to make of this and Google leads me only to things that don't pertain to recmod at all.
Does anyone know how to make recmod work nowadays? Thanks in advance for any help provided!
Click to expand...
Click to collapse
The only thing i could find on it was ... http://forum.xda-developers.com/showthread.php?t=576027 and it hasnt been updated in awhile.
Diablo67 said:
The only thing i could find on it was ... http://forum.xda-developers.com/showthread.php?t=576027 and it hasnt been updated in awhile.
Click to expand...
Click to collapse
Yeah, that's the thread that first got me into the recmod tool. Great thread, just out of date. /:
Thanks for the reply though.
This may help
This may help someone help me a little. When I use recmod through the command line, I get an error saying "Error! ProcessCase0: bit 5 is zero!"
and this is the .dll file that I get out of it:
View attachment a.zip
I renamed the file name to a so it would be shorter to type because I was trying a lot of different command prompt things. It was originally k.senscmdd.dll, not that it really matters. All of the modules I tried came out almost exactly like this.

Need help modifying an APK

Hello! Sorry if this is the wrong place to post this I just registered to the forum!
To keep it short I am a frequent player of the game 'Idle Heroes' and I got the idea to take the APK, modify it (for private use of course) and give me resources in the game so I can try out different heroes etc etc.
So I read up on the APKtool and all that but I am having some trouble, I can't find the framework I need.. I am just getting errors when trying to decompile and I can't find any framwork in my phone or online to download..
Any help is appreciated! Thanks!
If it's any help I have a Galaxy S9 (not rooted)
For apk tool you need to write it in the following format in command prompt... (assuming you are using apk tool 2.2.4)
Java –jar apktool_2.2.4.jar d C:\<path to apk file>
But this would give you stuff like the android manifest. If you want the raw source code itself, you would need to use something such as dex2jar. Format is below.
d2j-dex2jar.bat C:\<path to apk file>
mohhaxs said:
For apk tool you need to write it in the following format in command prompt... (assuming you are using apk tool 2.2.4)
Java –jar apktool_2.2.4.jar d C:\<path to apk file>
But this would give you stuff like the android manifest. If you want the raw source code itself, you would need to use something such as dex2jar. Format is below.
d2j-dex2jar.bat C:\<path to apk file>
Click to expand...
Click to collapse
Thanks for your reply! Unfortunately I'm still struggling.. As you said it's the source code I am after. If you haven't played the game I'll try to explain what I am after.
Every day you get daily missions you can do, I'd like to simply change the rewards from let's say 1 summoning scroll to 1000 so that each day I can get 1000 scrolls, and I also want to change the other rewards to give me a couple of thousand gems instead of the 20 I get each day, that will give me enough to get the heroes I am after!
Would you care to help me a little more specifically on how to achieve this? Right now I have put the .apk in "C:\android\apktool" along with the apktool itself (apktool.jar).
But I don't have a .bat file, what kind of .bat file do I want to create? Also I don't have any other folders or such. And yes I have the newest version of Apktool!
No matter what I write in CMD it gives me an error, I don't have any framework files etc and I don't know where to get them.. I did also use the code you gave me (java -jar etc etc) but it also gave me errors .. If you'd like me to try something else and/or post the errors here I'd gladly do so!
Sorry for being such a noob but I have never done anything like this before, I recently started learning C++ but it's mainly simple games (for PC) in UE4 and stuff like that, but nothing for mobile.
Thanks a lot for your time!

Categories

Resources