How to get the R.java file when decoding apk file?

android, apk

Solution

You cannot directly extract `r.java` file, but the contents of `r.java` file can be extracted using 'aapt' tool. The following command lists all resources and their respective ID's as present in `r.java` file:

aapt d resources name_of_apk

Problem

I just decode one apk file, but issue is that I can't get the R.java file. The `R.java` file is created automatically in the application, but when the apk file is decoded, it gives the hex value that is created in `R.java` instead of @string/abc or @color/white etc .... When we create string or color or any other resources in the application, android platform assigns some hex value to that string or color in `R.java`, so when we decode the apk file, it gives that hex value, so how can we decide that particular hex value is for that string or color ?

Original source

Related problems