0

I extracted a game from my android mobile using APK extractor. I wanted to get my hands dirty with the code by opening the file in Android Studio, but i am unable to run the apk file.

I did add "Gradle" to the project module and it failed with message "The project 'Candy Crush Saga_com.king.candycrushsaga' is not a Gradle-based project".

When I tried run the apk file without "Gradle" I am hitting the error "Error: Please select Android SDK". Can anyone guide me on how to make this apk run ?

excerpts from androidmanifest.xml file

xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="1137101"
android:versionName="1.137.1.1"
android:installLocation="0"
package="com.king.candycrushsaga">

<uses-sdk
    android:minSdkVersion="16"
    android:targetSdkVersion="26" />

1 Answers1

0

It is imposible to read code of apk in AndroidStudio without some changes , you can try this to see java code:

  1. Download dex2jar tool from dex2jar.
  2. Use the tool to convert the APK file to JAR:

    $ d2j-dex2jar.bat demo.apk
    dex2jar demo.apk -> ./demo-dex2jar.jar
    
  3. Once the JAR file is generated, use JD-GUI to open the JAR file. You will see the Java files.

The output will be similar to:

JD GUI

  • Thanks, I will make use of this utility and convert the code. This means that once I make few changes I should re-generate the apk file right ? – Ashlesh Kumar Nov 04 '18 at 09:42
  • Any advice on how to make the APK file "Run" in Andriod Studio Emulator ? – Ashlesh Kumar Nov 04 '18 at 09:43
  • apk file is using when you finished work , when you want to verify if your code is correct you just run app on emulator or smartphone,you do not need to regenerate every time your app to apk. To install APK file in emulator read this https://stackoverflow.com/questions/3480201/how-do-you-install-an-apk-file-in-the-android-emulator – Andrei Gospodarenco Nov 04 '18 at 09:54