is it possible to get android socurce code from apk.

i had seen on some tutorial that shows the way to get code from apk just guessting if we can do it really .

please guide they way to do it if possible

i was able to get source code but issue is that when i try to run it in eclipse i see lots of error .

  • 2
    But you said that you have already seen the tutorial. Why then an explicit but unnecessary guide is needed? What's the issue with those tutorials you have seen? – Firelord May 5 '15 at 12:33
  • @eldarerathis it's not duplicate check link it has not asnwer all links to answer is now expirer – gaurav May 11 '15 at 8:12

This is called Android Reverse-Engineering.

There are a lot of tools out there that could decompile your apk or any apk in seconds.

An example is APK Studio which even comes with cross-platform support.

There are various IDEs for decompiling/editing & then recompiling of android application binaries.

There are even ones that completely are re-written using QT for cross-platform support. This will permit you to have multiple frameworks installed & to pick a particular one on a per project basis.

A one solution to prevent Android Reverse-Engineering is to just get patents for your code, and it will save you from a lot of trouble.

  • What about obfuscated code? Technically you can use the code, but you'd have to guess every class and method in order to get things to work. How do these decompilers handle de-obfuscation? – Edwin Lambregts May 5 '15 at 14:08
  • @EdwinLambregts Obfuscation with android is very complex, because it has a lot of xml code, and with xml code it's not recommended, all for the part of variable references, so it's nearly impossible to achieve. Like proguard can let the xml part and all the related variables un-obfuscated, which in general they constitute more than 60% of the code would be out of the process and vulnerable thus it reflects on overall result which eventually will let go the thought of obfuscating for android hence from the beginning. – Human Being May 5 '15 at 16:23

There are decompilers out there, but it's very likely that what you get out of it will be a garbled mess. If the developer used Android's ProGuard, you may not be able to reverse engineer the resulting code. The only site I know of for decompiling is this one. Be careful and keep it legal. Source code is intellectual property. If the developer has a website or says their code is open source, contact them to find their github repo.

Not the answer you're looking for? Browse other questions tagged or ask your own question.