Simplest way to obfuscate and deobfuscate a string in JavaScript

You can use btoa() and atob(). btoa() is like base64_encode() and atob() like base64_decode(). Here is an example: btoa(‘Some text’); // U29tZSB0ZXh0 atob(‘U29tZSB0ZXh0’); // Some text Keep in mind that this is not a secure way to keep secrets. Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format by … Read more

Prevent class member name obfuscation by ProGuard

If you dont want your class members to be obfuscated then use SerializedName annotation provided by Gson. For example: public class ClassMultiPoints { @SerializedName(“message”) public String message; @SerializedName(“data”) public List<ClassPoints> data; … } Moreover, make sure you do add proper proguard configuration for Gson library too. For example: ##—————Begin: proguard configuration for Gson ———- # … Read more

How to restore obfuscated property names?

A simple regex replace will do: var _$_21e2 = [“jQuery”, “userAgent”, “test”, “onmouseup”, “onmousemove”, “pink”, “greenyellow”, “gold”]; return code.replace(/\[_\$_21e2\[(\d+)\]\]/g, function(_, i) { return “.”+_$_21e2[i]; }).replace(/_\$_21e2\[(\d+)\]/g, function(_, i) { return JSON.stringify(_$_21e2[i]); }); Given the code as a string, this will yield a code string with human-readable property names and literals.

How to configure proguard for javascript interface?

Both your configurations could have worked if they hadn’t contained typos: ProGuard requires fully qualified names: NonObfuscateable -> com.project.NonObfuscateable Compiled classes use ‘$’ as a separator for inner classes: com.project.Activity_Webview.JavaScriptInterface -> com.project.Activity_Webview$JavaScriptInterface In the console log, ProGuard prints out notes about such suspected typos. A more general solution for keeping annotated Javascript interface methods: -keepclassmembers … Read more

Obfuscation in Android Studio

Basic Obfuscation To obfuscate code in Android studio just go to your build.gradle file in your Android Studio project: Change the minifyEnabled property from false to true This is a basic Obfuscation. After generating the apk you can see the obfuscation result by decompiling the apk with any software. This page could help you: http://www.decompileandroid.com/ … Read more

How to compile a linux shell script to be a standalone executable *binary* (i.e. not just e.g. chmod 755)?

The solution that fully meets my needs would be SHC – a free tool, or CCsh a commercial tool. Both compile shell scripts to C, which then can be compiled using a C compiler. Links about SHC: https://github.com/neurobin/shc http://www.datsi.fi.upm.es/~frosal/ http://www.downloadplex.com/Linux/System-Utilities/Shell-Tools/Download-shc_70414.html Links about CCsh: http://www.comeaucomputing.com/faqs/ccshlit.html