How to decompile apk from Play Store

This is how you can decompile an application you have installed on your phone. My phone is rooted, uses RootBox 3.5 and has BusyBox installed. You may need to have that too if you want to follow my steps completly. Let's start: 1. Install application from market 2. Download apk to computer First you need to locate the apk on the phone. Connect to the phone: adb shell Find the apk in the folder the apk are downloaded to. It is ussualy in '/data/app/' or '/system/app/'. The apk is called as the id from the Play Store, for example 'com.something.someapp.apk'. You can see this in the url from Play. Next you need to pull it to the computer. Once you have located the apk and know it's name exit adb. On your PC execute: adb pull /data/app/com.something.someapp.apk 3. Transform apk to jar I use dex2jar dex2jar-0.0.9.11/d2j-dex2jar.sh com.something.someapp.apk 4. See the code inside the jar I use Java Decompiler Just open the

How I configure Intellij Idea 11 for Android, AndroidAnnotations 2.6 and maven

I know there are many many posts about this. This is a summary of how I do, so I can have a place for copy paste.

1. Create your project with Android Maven Plugin

Read the GettingStarted

You can run this command to get the basic structure:

mvn archetype:generate \
  -DarchetypeArtifactId=android-quickstart \
  -DarchetypeGroupId=de.akquinet.android.archetypes \
  -DarchetypeVersion=1.0.8 \
  -DgroupId=com.tagonsoft \
  -DartifactId=ExampleApp

Add/Edit the dependency to android:

 
    com.google.android
    android
    4.0.1.2
    provided
 

2. Add AndroidAnnotations to maven pom.xml

  
                                             
    com.googlecode.androidannotations 
    androidannotations          
    2.6                               
    provided                              
                                            
                                                         
                                             
    com.googlecode.androidannotations 
    androidannotations          
    api                         
    2.6                               
                                            

3. Configure Idea compiler

Like so:
I couldn't get it to work with processor from classpath, so I use the path from maven repo:
/work/libs/mvnrepo/com/googlecode/androidannotations/androidannotations/2.6/androidannotations-2.6.jar
Add as processor FQ name:
com.googlecode.androidannotations.AndroidAnnotationProcessor
Add your module to the Processed modules section. Set Generated Sources Directory Name to:
target/generated-sources/annotations

4. Tweak your module to regenerate R file in the new location:


I use <project path> + /target/generated-sources/r
Remove the normal R folder from sources.
Sometimes Idea thinks it knows better and when it updates the maven project it overwrites your changes. The solution I found on the internet is to leave gen as sources and to exclude the folders beneath it. Like so:
Hope someone else finds this useful. Feel free to add or correct me.

Comments

Popular posts from this blog

Ways to map and query many-to-many in GORM

Update: Intellij 12 + Android Annotations 2.7 + maven

How to decompile apk from Play Store