问题
I used the instruction here : Is there a way to get the source code from an APK file? It was really good. I got almost everything of my lost project but no R.java file. It is nececery to import the project to eclipse. How can I extract this file from apk file? Where can I find it?
tnx.
回答1:
R.java is created automatically on Eclipse and other IDEs. Removing the line from my main activity that says import R.java usually helps my IDE recognize that it's not there, and it recreates it when you try to run the program. If that doesn't work, try Project, Clean... and try running it again.
回答2:
You cannot directly extract r.java
file, but the contents of r.java file can be extracted using 'aapt' tool. the following command gives list of all resources and their respective IDs as present in r.java
file:
aapt d resources name_of_apk
回答3:
You don't need the R.java
file. It is automatically generated by the Android SDK when you try to run your android application.
来源:https://stackoverflow.com/questions/11596141/android-getting-source-code-from-an-apk-file-with-r-java