Unveiling Hidden Strings in Obfuscated Code
Obfuscators like ProGuard can enhance code security by obfuscating visible strings, but they may not suffice for sensitive information such as URLs or licensing data.
Hiding Sensitive Strings
To conceal sensitive strings effectively, consider the following techniques:
To implement these techniques, you can:
<code class="java">// Before encryption public class Foo { private String mySecret = "http://example.com"; } // After encryption public class Foo { private String encrypted = "<encrypted string>"; private String key = "<encryption key>"; private String mySecret = MyDecryptUtil.decrypt(encrypted, key); }</code>
Locating the R Class
During decompilation, the R class is not always readily visible due to obfuscation. However, the ProGuard mapping file can provide insights into its location:
Understanding R Class Numbers
Numbers like "2130903058" in decompiled code represent resource IDs. These numbers refer to resources in your project, such as layout files.
To find the corresponding resources:
The above is the detailed content of How can I effectively hide sensitive strings in obfuscated code?. For more information, please follow other related articles on the PHP Chinese website!