Get Source Code from debug installed App - android

I have got an App installed on my phone (not rooted), this App was in Development at the time and installed in Debug mode.
I would like to know how to get the Java Code of this App, since it's in Debug mode.
I'm guessing some ind of reverse engineering but I'm not expert on this.

You need the APK (the application file) to do that. Since you are not rooted, you will not be able to get the APK.
With the APK, you can use tools like: www.decompileandroid.com/

Related

Will different machine installed Android app (via Android Studio) get a different signature?

I have an old app that I've written for personal use only, and never made as release to the Play Store. I installed it to my phone via Android Studio using run app command.
Many years later I want to modify the app, I try to pick up the app and run it again, this time using a different computer. I get the error saying:
"Installation failed since the device already has an application with the same package but a different signature. In order to proceed, you have to uninstall the existing application."
I definitely don't want to uninstall my app, this would cause me lost all the data I've entered to it. So I want to ask that isn't the debug keystore used by Android Studio to install app on device would create app of the same signature? Why it would be different? Is a different machine caused this issue? Thank you very much!
It sounds like you were using your debug certificate when you originally installed the app. This is unique to each machine when you install Android Studio.
You can copy the debug certificate from your old machine to your new one.
The file is located in your [userhome]\.android\debug.keystore

replace apk with new one but different signature

Usecase
I normally always use the debug versions of my own apps on my own phone while developing them. Before releasing a new version, I want to test the release on my own phone. That's not very convenient, I currently have to do many steps:
backup the debug version of my app
deinstall the debug version
install the release version
restore the data of the debug version
Current solution
I do the above steps manually with the help of Titanium Backup on my phone...
What I want
Important: I want to use the data from my debug app in the release app, so that I can test the release build with all the data from my debug app
I want to automate that process. The best would be a batch file, I can use on my laptop while the phone is connected via usb. Currently all I found is following:
%adb% install -r app-release.apk
But of course this fails because of wrong signatures. So actually need to delete the apk from the phone without deleting the data and copying the new apk to the phone. Is that somehow possible?
Possible solutions
Replace the apk on my phone without installing the app
Copy all app data to the laptop, uninstall the debug version, install the release version and copy back the app data to the phone
???
You wil always have the signature issue. But if you deploy your application with android studio (or eclipse) it will be faster : use debug or release to build your application and deploy it to your phone (local data will be lost).
You may want to try this method from another stack user Android – multiple custom versions of the same app. TL;DR: if you use your application as a library you can deploy a debug and a release version at the same time on your phone.

Package an Android app with Trigger.io Forge

I'm able to serve and run my app on Android (emulators, real device over ADB), but when I try to package the APk and install it on a device, I get an error. It seems like the package works just fine (an APK comes out with no error), but when I try to install my device says:
An existing package by the same name with a conflicting signature is already installed.
My sample app name is "boop" and I just made the keys/alias from scratch, so I'm not sure I really believe there is a conflict.
Anyone seen this before? Any ideas?
Doh! Figured it out.
I'd tested the application over ADB on this device. Seems like that actually installs the APK (which might be common knowledge, but I pictured some kinda temporary thing).
To get my actual signed APK to install, I just needed to uninstall the current version of "boop" on my device.

Deploying Android App To Multiple Test Devices

I exported an unsigned apk file that represents a test version of my Android application. I need to distribute this to quite a few users. Is there a simple method to distribute the apk file where it will install the app? I'm trying to avoid the test users from having to download something like Astro or the sdk. Any ideas? I tried putting it out on a global web server and the file downloads but doesn't install. Thanks for the help!
From the android documentation:
The Android system will not install or run an application that is not
signed appropriately. This applies wherever the Android system is run,
whether on an actual device or on the emulator. For this reason, you
must set up signing for your application before you can run it or
debug it on an emulator or device.
So even if your users have the "Allow installing non-market apps" checked, your application will still have to be signed with at least a test key before it can be installed on a physical device.
I just put my experimental apps on the Android market with a description that says "don't install this, it won't work for you" and then give an access key to my testers.

Re-installation failed due to different application signatures - AGAIN

I create an APK and install it on the device. All works OK.
Then I try and run the app from Eclipse and it gives the error above. I didn't make any changes or even need recompiling. I tried running it as debug as well as release and both have the same errors.
Something is messed up somewhere as this used to work :(
EDIT: If I want to send out a pre release to users that have a normal install from the market, does that work ok, if I just send them the APK?
This happens when you for example install or run applications with the same package but signed with two different(may be debug) keys. Just uninstall the application and run it from Eclipse againg.
You should be able to uninstall the application (either though the Android App Manager or apk uninstall <application package-path>) and then deploy it. It seems to get confused when you do a proper install then try to deploy a dev build over it.
You may have messed up your debug certificate. Try to remove it from ~/.android/debug.keystore (Linux/Mac OS X); or %USERHOME%/.android on Windows.
then uninstall using adb your app : adb uninstall yourpackagename
And try to launch it again from eclipse.
It is neither necessary nor desirable to perfom an uninstall of the application if, say, you want to preserve user data like settings.
I have had the same problem for a while, and my solution is simply exporting the app (like when publishing, with the release key) and intalling that .apk file on my phone (I attach it to an e-mail and send it to myself).
This will have the same effect as updating it normally through Google Play Store, and all previously saved data is retained.
It may not be as convenient as running it directly from Eclipse, but having to uninstall the application all the time is not such a great solution either.

Categories

Resources