Is there a way to open .apk and find the code - G1 Q&A, Help & Troubleshooting

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.

Related

Starcraft Java

Im not sure if this is considered warz so I am sorry in advanced if it is.
http://dibosmobile.blogspot.com/2007/09/mobicraft-starcraft-java-game.html
would it be posable to port that over to the kaiser? I dont know anything at all about java so sorry if this is a stupid question.
This would be awesome!!! I am an avid Starcraft fan. I have played it many many times and I have even downloaded many different missions.
I have downloaded the provided link but there doesn't seem to be any executable or .jar file? I wonder how this app works?
if anybody figured out how to play this game, let us know...
Starcraft is one of the best games ever!!
I am proud to report I made some progress I couldent figure out how to make a .jar file so I downloaded anoter game in .jar format and I prettymuch hijacked it I got starcraft to open now im trying to figure out how this game works. I have the .jar if someone could tell me how to post it.
The download I recieved was a password protected zip file called _dibosmobile.blogspot.com_-MobiCraft_Starcraft.zip. I unzipped it with the given password 'dibosmobile'. Inside of that there was a MobiCraft_Starcraft.zip file. It's actually a jar file (has the classes and manifest file). So, just rename it to be .jar instead. Copy that to your mobile and click it from File Explorer.
I've got MobiCraft menu up running at 24fps.
hf gl
bad news
Sorry to say this to you all but mobicraft is pretty frozen. I joined the beta test team for it right before development stopped, and havent seen any updates since. SF link
The bad news is, its not playable. Really the only thing that worked was the chat, but its down now since they lost hosting. You could bug em I guess? Sorry.
OK I have changed the zip file to jar and it installs and runs the menu at 32fps. The problem is I can't get it to accept the new game. It doesnt recognise the d-pad fully? What button do you press for OK to begin new game?
Use # as ok and * as back/cancel the game was not designed for our phones so it operates on numbers 0-9, #, * and the d-pad.

Question for developers

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

Text Editor on Android...

... with a search feature. Does it exist?
I'm currently using Text Edit, but it's pretty horrible for large text files, and doesn't have searching. I use Vi sometimes, but that's just a pita.
Anyone know of a free text editor with search capabilities?
I gotta say, vi, though even more vim (the "enhanced" version) is probably one of the very best (if not ABSOLUTELY the best) text editors ever written. Yes, it does have a *VERY* steep learning curve, but when you really get to know it well, there is absolutely no faster or more powerful way of editing text files.
Yeah, I'm not a fan of Vi.
Does anyone know any other alternatives? Perhaps, is there a way to use nano?
Is there *ANY* other way to edit a text document aside from Text Edit and Vi??
documents to go?
quickoffice?
djind said:
documents to go?
quickoffice?
Click to expand...
Click to collapse
QuickOffice can only open/view files; it cannot edit at all. And Documents to Go is too expensive for my budget. (I only need .txt file editing anyway.)
I guess I should rephrase: Is there ANY other FREE way to edit a text document on the G1 aside from Text Edit and Vi?
Are the text editing options on the G1 really that limited?
Pick your favorite open source console text editor and compile it for arm.
lbcoder said:
Pick your favorite open source console text editor and compile it for arm.
Click to expand...
Click to collapse
How would I go about this? Any guides on here that explain this?
Yeah give me pico.
This task really isn't for newbs, but here's an idea of what is involved anyways:
http://android-tricks.blogspot.com/
I have done some searching, I cant find a text editor that I like. I would like one that can run with SU privileges so I can modify scripts I keep in /system/sd. If I need to I can remount it so that it would save, that wouldnt be a big deal, I would just like to not have to move them to my sdcard, edit, then move back.
I am also not familiar with linux so vi isnt for me if that would work, just looking for a decent alternative with a GUI if possible.
There used to be a cool app in the market called ptexteditor or something but its gone now
Somebody please compile nano... If I knew how to do it... I would... but I'm too noob for the instructions that were given a few posts back...
ES File explorer
For editing text files you could use ES File explorer. I found I was able to open, edit and save my userinit.sh and user.conf. This is quite enough for me!
Sure enough, it is not able to open /system/sd, but it's ok, because you can copy the files from the terminal. You could even make a simple script that would do it for you..
Until someone compiles nano or vim
I'm bringing this thread back from the dead simply because this thread is the first Google result from XDA for text editors, and the discussion here is the exact one that was going on in my head (around vi and nano). I eventually found 920 Text Editor, which has programmatic syntax highlighting, root mode, and is free:
https://play.google.com/store/apps/details?id=com.jecelyin.editor
Thanks,
Ben
also to be considered is this thread about 'nano' the terminal-based editor -- http://forum.xda-developers.com/showthread.php?t=552287

[Q] Help with Changing Status Bar Signal Icons, Files to be Modded

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

[Q] Associate file endings to certain App

Hi there,
is there a way to associate a file ending to a certain app? That is, if the app does not appear in the suggested list of Android?
Thanks a lot!
File associations in android do not work like they do in Windows, and sometimes, they do not work well at all. Astro works for opening certain types of files. I think it uses a different scheme for determining which apps can open which files. Specifically, what type of file are you trying to open?
Sent from my SAMSUNG-SGH-I537 using Tapatalk
dibeachdude said:
Specifically, what type of file are you trying to open?
Click to expand...
Click to collapse
It's obvious I come from the Windows World, isn't it? I just started using Android a few weeks ago.
Anyway, thanks for the quick answer: I am trying to open a *.freshroute file with Navigon. In the navigation forum I was told that this might be a way to open files with Navigon in Android. This used to work with winmobile Navigon, but there seems to be no way to open files in Android Navigon. Now one user descibed that a file sent to an IOS Navigon by e-Mail opened the Navigon software and the route was there. So I thought maybe this works with Android too? And that is why I am looking for a way to associate a file with Navigon.
Thanks
Jürgen
I doubt you would be able to open files like this across platforms even if they had the same extensions. OS architectures are too different for an iOS file to be readily accessible on another platform and vice versa without some kind of conversion being necessary.
The file structure is not the problem as it is xml, so should be cross platform. I would only like to open this file with navigon, but do not know how.
Thanks anyway!
westfielddriver
westfielddriver said:
The file structure is not the problem as it is xml, so should be cross platform. I would only like to open this file with navigon, but do not know how.
Thanks anyway!
westfielddriver
Click to expand...
Click to collapse
Does Navigon support xml files? If not, then there's no way to make it support them. If it does and still can't open it then there is obviously something about the file it does not like.
I was afraid someone would say something like this. Still thanks for keeping me from wasting more time on research.
Best regards
Jürgen (westfielddriver)

Categories

Resources