3

I deal with Android reverse engineering at my school. I want to try this plugin: https://github.com/JesusFreke/smali/wiki/smalidea

I use the last version of A.studio and Win7. I went with the guide on Github (Debugging an application) up to point 5. I can't do point 6, because I don't have any running configuration in the IDE. I have tried to create the configuration, but then I received an error: no module specified. I am not sure if I understand it well, should I run the application from studio of from the phone?

JesusFreke
  • 19,784
  • 5
  • 65
  • 68
woodpecker
  • 53
  • 1
  • 5
  • you should have a running project on Android Studio – Vivek Mishra Mar 09 '16 at 11:54
  • I created a simple application. I opened it in Android studio. I have run it in emulator. Then I used baksmali to get smali files. I created a new project from smali files. But the project with smali files seems to be dead, because it isn't a standard Android application. I can't use DDMS. – woodpecker Mar 09 '16 at 15:53
  • I'm stuck on step 7, the Android menu is missing when I import the source code for some reason. – Arya Jan 11 '18 at 20:20
  • i stucked at point 2. How do you import that smali files? – otto May 17 '18 at 16:08

1 Answers1

5

For step 6, "Install/start the application on the device", you manually install the apk and run it on the device. E.g. "adb install my.apk", and then launch the apk by opening it from the launcher.

Once the application is running on the device, you can select the application in ddms/android monitor, which will associate port 8700 on your local computer with that application.

Once you've done that, go back into IDEA and create a new run configuration of type "remote". i.e. run->edit configurations, and then click the "+" icon in the top left, and choose remote. The default configuration should be fine, just make sure you change the port to 8700.

Now you should be able to start debugging (i.e. run->debug)

JesusFreke
  • 19,784
  • 5
  • 65
  • 68
  • When I open ddms the "Threads" panel says "no client is selected". I can see my connected Android device in the devices list and it also shows when running "adb devices". The app that I want to debug is running as well. Any idea what I might be missing? – larsbeck Jul 07 '16 at 05:29
  • 1
    thanks. it works. in case you don't see android device monitor in `tools/android` you should open new workable android project, then open android device monitor. (in new version of android studio, if that project is not android project, android studio will automatically hide android menu). – hqt Dec 15 '16 at 19:50
  • @hqt Alternately, you can just run the "monitor" tool from the android sdk (/tools/monitor) – JesusFreke Dec 15 '16 at 20:19
  • Hey Jesus, I am able to get to ddms. But when I am trying to start the remote debug configuration its showing connection refused – Yashdeep Hinge Apr 23 '17 at 08:30
  • @YashdeepHinge Did you change the port in the remote debug configuration? – JesusFreke Apr 23 '17 at 18:30
  • where? do I need to change? Even I tried with the port shown in logcat 8100 – Yashdeep Hinge Apr 23 '17 at 23:50
  • @Yashdeep Hinge (1) make sure you have a debuggable apk like so https://blog.netspi.com/attacking-android-applications-with-debuggers/ (2) go to your phone or emulator and start your apk. (3)run the command `adb.exe jdwp` it will list the debug port of your apk.(4)Forward this port to your ide (intellij IDEA) using the command `adb.exe forward tcp:8700 jdwp:`. (5) profit!!! – Dr Deo Jan 06 '18 at 18:38