smali
smali copied to clipboard
Android Studio Unable to open debugger port (localhost:8700): java.net.SocketException "Connection reset"
Unable to open debugger port (localhost:8700): java.net.SocketException "Connection reset" I get this error when i try it with android studio? Should i paste the whole folder or just the smali folder in the project?
I'm afraid this problem has nothing to do with smalidea :). This is related to IDEA's generic java debugging functionality.
Did you open ddms/android monitor and select the process to debug?
no. but i dont know what i did wrong
i did the steps like in this instruction
https://crosp.net/blog/android/android-reverse-engineering-debugging-smali-using-smalidea/
In order to debug a process, either the device must be debuggable (ro.debuggable=true), or the app itself must be debuggable (<application ... android:debuggable="true"> in the application's manifest)
Also, If you don't have a debuggable device handy, you can use the Android emulator instead.
i have a device. I think i have done something wrong at the begining. When i just import the folder without creating a new project, i have no gradle. So i am not able to run the application
You don't need to be able to run the application. In fact, I don't know of a way to set things up that allows you to run it from android studio, because the smalidea plugin doesn't currently support building/running applications. You have to start the process on the device yourself, and then use ddms to select that process, and then attach android studio's debugger to it
yes but to start the process i have to run or debug the app? And this is what it dont undestand.
I think i will install IntelliJ IDEA on linux and try it with that. With android studio i dont get it done
Just run the app. open the app drawer and tap on the app icon, or whatever :)
ok if i run the application i dont see the processess. Somebody know why? I added android:debuggable="true" to manifest
How did you add the debuggable attribute to the manifest? By disassembling and reassembling with apktool?
ah that was the problem. I changed it in the folder which i imported.
So right way was
decompile with apktool build with apktool sign the apk install apk
Now i see the process but how can i debug now? When i place breakpoint it does not stop
Should i click on the the run/debug button in android studio?
I solved it. But my solution is simple, I do not know why yet.
computer reboot....
Probably because the port connected to the device does not close properly.
ADD. Later I found the exact method but I did not confirm it.
https://stackoverflow.com/questions/21766228/unable-to-open-debugger-port-java-net-socketexception-socket-closed
I had to change the debug port to 8600
, but you can Run -> Attach Debugger to Android Process
instead of using a "Remote debug configuration".
I had to change the debug port to
8600
, but you canRun -> Attach Debugger to Android Process
instead of using a "Remote debug configuration".
It works well for me.