Reputation: 38583
I just used the new ProGuard tool in eclipse to obfuscation my application. The I decompiled it using dex2Jar and JD-GUI to inspect what happened.
I noticed that everything from the R class has been converted to a random number like the following.
new SimpleCursorAdapter(localActivity, 2130903058, localCursor, arrayOfString, arrayOfInt);
2130903058 was a layout file. Strings an arrays get the same treatment.
There is no R class in the decompiled code, where has it gone? Where are the references to the original strings?
Upvotes: 1
Views: 1034
Reputation: 89566
All references are integers. If you look at R.string
, you'll notice all the members are int
s. This is because they are pointers to the actual strings. For example, android.R.string.cancel
is always 17039360
, which points to the string Cancel
. What ProGuard does is it replaces these references with the actual numbers they represent, so if you use android.R.string.cancel
, it will replace it with 17039360
.
Edit: There is no R class because it is not needed anymore (all references to it have been replaced).
Upvotes: 5