an issue about extract source code of an apk - android

Hello I lost my last backup of my project and there is just installed the app on my phone so I need to rescue my codes.
I searched dex2jar,apktools etc but they did not work.
In my apk there is 6 dex class so I can not reach my code

You can extract your code from http://www.javadecompilers.com/apk this link
Note: It can give you all your java classes and resources, but you
have to work on it for some missing constraints. Please do not make
misuse of that....
But its better to have something than nothing.

Related

android app particular java file used

How can i know which java file is used at the current time at that current interface. I know we can do this with a logcat when we know the source code , we can make everything log.i and stuff. but what happens when we don't know the source code or while assessing a black box android app
If you don't have access to the files how you supposed to know which file you are getting?
The best way to achieve what you want is to use a decompiler in your APK and do a debug.
http://www.decompileandroid.com/

APKTool error ricompiling apk

I' m trying to modify the application's graphic. So when I decompile the apk using apktool with apktool d myapp.apkeverything goes well. I can see the resources and the smali folders so it's perfect. So I can modify the colour code that I need to change.
When I try to build back the application using apktool b myapkfolder no errors are displayed from apktool. But when I try to install it on my phone it says "Parse error there has been a problem for analysing the packet". So I though it use my fault modifying something wrong in the application so I tried to decompile the apk and then recompile it without touching anything in the apk folder. What I can see is that the original apk size is 5.78MB and the recompiled one is 5.77MB (and I didn't touch anything literally) and when I try to install it, the phone gives me back the same error "Parse error there has been a problem for analysing the packet".
So I can't figure out what the problem is. I thought the problem was related to code obfuscation but I' m note sure. Is there a solution for that?
Well If you have lost you project and you want to import it to eclipse then you can use this link: click here
And Yes ill tell you your question is valid ( and by the way there's nothing to do legal or illegal here as this forum is to clear your doubts )
The link will have two parts on importing your decompiled files and yes if you are unsuccessful in decompiling then this link will help you out click here
And yes you try these things anywhere..( and personally you MUST KEEP A BACKUP ON CLOUD STORAGE , WHERE YOU CAN ACCESS IT FROM ANYWHERE )

Unable to see all the classes in an android application using AndBug tool

I tried to see the list of classes inside a package in an android application using AndBug command 'classes com.package.name.example'.
The output shows only one class file.
But when I decompile the apk using dex2jar and view the classes inside the package com.package.name.example using JD-GUI, I can see two class files.
The class file that I want to trace is not being shown in AndBug, while it is shown in JD-GUI.
What could be the possible issue?
It's very likely a bug with AndBug. You should at least submit an issue to the project page along with a dex file, if possible, so that they can reproduce the issue: https://github.com/swdunlop/AndBug/issues
For bonus points, debug the issue yourself and submit a pull request. :D
There are always bugs with disassemblers and decompilers. Some people intentionally find and exploit them to prevent others from reversing their applications.

Running decompiled file

I was working on an Android app but yesterday my Hard disk got crashed and all the data has been gone. What I'm now left with is a .apk file which I kept as a back up. I somehow managed to get my code back from that .apk file but not sure of how to import the whole project in Eclipse. The source along with other folders like drawables, values, manifest etc are saved in one folder. Any help would be highly appreciated.
I have two methods :
Download APKTool (url) and decompile your apk package. Here you have a tutorial.
After this you should can import your code into Ecplise.
Go to a specialist and try to restore your harddisk.
I hope I helped
ok, first of all, if you tried to decompile an app, I suposed you have used apk-tool or smali/backsmali tools for the code.
AFAIK you can't get your java code back. after decompile, you get smali code, which is some dalvik assembly language. I don't think you want to write apps in that.
If you were the developer of the app, you would've make a backup of your code, not APK. So, are you sure you're not lying to us?

How to Create an application build securing the source code?

Generally we can get source code from the android installation package as shown in this reference link.
But, is it possible to secure the actual program code (source code) from a reverse engineer ?
The code that you write is converted into class files then dex files, so directly viewing the code is not possible. but however dex compilers can be used to de-compile the source code but that requires some good knowledge so for that you have to obfuscate the code. Google by default provides proguard so that you can protect the code
you can read about proguard from here
In simple words you cannot hide the source code, but just add this line proguard.config=proguard.cfg to your project.properties file so making it difficult to be decoded . You can check here for an example
No, because the android system has to be able to read it in order to run it. You can obfuscate it with tools like Proguard to make it harder to decompile, but there's no way to make it completely impossible.

Categories

Resources