Export apk from phone? - android

I compiled and ran a project on my phone through eclipse which is still install there currently. While doing some directory cleaning I accidentally deleted the source code so the only remaining version of the code is in the apk installed on my phone. Is there anyway to export the app back to my computer?? It isn't signed or anything either.
Thanks!

You can set up to be able to copy files on/off your phone via the USB connection - heres where you can look to find it:
Does Android keep the .apk files? if so where?
Then after you get the .apk off look at these questions for decompiling:
Is it possible to decompile an Android .apk file?
decompiling DEX into Java sourcecode

You CAN pull the APK off of the phone, but it's going to be Java Bytecode, not your source code (regardless of whether or not it's signed). You would have to reverse-engineer the classes to retrieve your code. If it's not a VERY large app, I'd say your time would best be spent simply re-creating it.

Related

How to extract source code from installed app?

I was developing an Android app for more than a month, but my computer crashed and I lost all the code from it. I have a compiled app installed on a test phone and tablet. Is there any way to extract source code from it?
I followed some guide for game modders (they are probably doing something similar), and I have extracted .apk with an app called Total Commander. Now the guide states that I should extract it with the apktool. But all files are still in binary (when I opened them I got random chars). Now, is there any tool (for Linux) that can decompile .apk back to source code, or maybe some feature of apktool I miss?
Note: I also tried this answer from 10 but also without success.
EDIT: javadecompileonline also did not decompile binaries correctly,
so this should be .json file:
<m*/��%kي%jTƴ���69/�t��
č �Cx���Q�đš?������i�
ć���/��i�JRᙱg�.�s
First you go to Android studio's welcome page there is a option to extract source code from APKs.
Another way is to install this apk extractor application from play store then you can extract source code from APKs Link : https://play.google.com/store/apps/details?id=com.ext.ui

App Recovery - Decompiling Android Project Classes From APK

I am currently working on an android app but my hard drive unfortunately crashed and I lost all the data on it... I am trying to recover my source code from the debug APK I had installed on my phone (using dex2jar and jd-gui) however, it seems like the classes are not present in the classes.dex and classes2.dex (both files are tiny and do not contain any of the classes in my code, see photo).
I used apk extractor to get the apk from my installed app and I cant seem to get anything close to my original classes... I am wondering if I am doing something wrong to get the APK from the installed app; any help would be greatly appreciated.
Thanks.
For de-compiling your APK to Java classes you can go to this site -
http://www.javadecompilers.com/apk
Just upload your apk and click on decompile. It should work for you !

Encoding issue of AndroidManifest.xml file

I'm building phonegap app using phonegap-build.
I need to make some changes to the manifest of the android apk.
After i download the apk of my phonegap build, i rename it to .zip file to see the contents of the file.
When i open it, there i see the xml file there, and when i open that one, it has encoding problem.
This is what i see:
I understand it's a binary, but i need to see the content in plain english, if possible.
1) How can i encode it to see what is the content of this file properly?
2) After a change that i do on it, can i "decode" it back to binary?
So from what you wrote you wrote, you want to edit the AndroidManifest.xml from an APK file AFTER you built it, which is quite complicated. I suggest you editing the source AndroidManifest.xml and then re-building the APK. If you can't do this then please do the following.
(1) First, download and install Apktool. It is a free Android tool for decompiling and recompiling apps quickly. It provides access to .class files, resources and XML's. Here's a tutorial on how to install Apktool.
(2) Then you want to decompile your APK file (tutorial).
(3) Edit the AndroidManifest.xml file.
(4) Re-build the application (tutorial).
(5) Finally, you will have your APK file but it will be mostly useless as it is un-signed. You can't install un-signed apps as you will get an error (it may be possible to force-install it using root or adb tho) and you can't publish them. To sign it you can check out this link.
IMPORTANT INFORMATION: Your app will have to be signed with the same certificate with which it was signed the first time, otherwise it will be considered a different app. Not completely tho, you will have to un-install previous versions in order to install this one.
And yes, I know it's a very long and time-taking process but it is supposed to be, only if you have the source you should be able to edit the app.
As mentioned above, the tool you are looking for is Apktool.
You need to use --force-manifest flag when you decompile to decode AndroidmManifest.xml.

Where do I find Androidmanifest.xml on my device?

I'm trying to modify the Androidmanifest.xml for the browser on my device so that I can execute an app by loading a URI in the browser.
I've been running around the file system in ADB SHELL all day, but can't seem to find it. Plus there is no FIND, nor LOCATE command on the system.
You can theoretically find the Androidmanifest.xml file in the APK.
Every APK contains the compiled source code of the application. There is no useable decompiler for APKs at the moment so it is not possible to change the content of one.
In addition to the compiled code and the other resources of the application, an APK also contains a signature from the developer, which will become invalid when the content is changed to verify the source of an APK. An Android system won't install an APK with an invalid signature, so even if you could change the content of the APK, you still couldn't use it.
The conclusion: You cannot do what you are trying to do.
Android Studio on Windows 10/11, it’s in: app/src/main.

Accessing source code using .apk file

I am currently developing an android application and every now and then I am checking my application if it runs smoothly on my android phone. Now, my problem is my desktop computer crashes and all the files on my computer were deleted including the source code of my application. I am wondering if I have a chance in accessing my source code just only by using my .apk file installed on my android phone?
Bummer about the computer crash. I'll mostly skip the lecture on always committing your code to source control somewhere, or backing up with something like Google Docs or DropBox, something.
Anyway, an APK file might be able to save your source code, yes. An APK is just a modified JAR file that includes the DEX bytecode (classes.dex). If you use something that can decompile the dex back to java bytecode, and then decompile that, you'll be back at Java source -- theoretically (I haven't tried to do this).
For more information about getting started see this question: decompiling DEX into Java sourcecode

Categories

Resources