Search code examples
androidproguardrenderscript

Proguard Obfuscation and Renderscript


I know that Proguard (when minifyenabeled is set true) obfucates Java code, but what about Renderscript scripts? Does anyone know that? Thanks.


Solution

  • RenderScript scripts get compiled to bitcode, which is a machine-like translation of the original source code.

    The compilation is performed using LLVM compiler intermediate representation: more specifically, it is done by llvm-rs-cc.

    The original source code is lost, you can get the bitcode representation and reverse it. It may be or not easy, and you may understand the code flow. In any case, the original code is gone.

    Reference: RenderScript: parallel computing on Android, the easy way

    Edit: EXAMPLE

    For example, a simple RenderScript source code can be reverse-translated to C++ using the following command:

    llc -march=cpp -o code.cpp path_to_bitcode.bc
    

    Simple source code: BitBucket

    Reversed C++ code: http://pastebin.com/Mq1KHcFD

    Reference: llvm ir back to human-readable source language?