- Use this guide to integrate the O-MVLL obfuscator using WSL and command line
- The guide has two parts, the first one explains the installation of Android build tools, the second part presents all the adjustments I needed to make to standard O-MVLL integration process (https://obfuscator.re/omvll/introduction/getting-started/). Read that 'Getting started' guide first.
Based on this article https://dev.to/halimsamy/wsl-for-developers-installing-the-android-sdk-53n9
sudo apt-get update
sudo apt install openjdk-8-jdk-headless gradle
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
cd ~ # Make sure you are at home!
curl https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip -o /tmp/cmd-tools.zip
mkdir -p android/cmdline-tools
unzip -q -d android/cmdline-tools /tmp/cmd-tools.zip
mv android/cmdline-tools/cmdline-tools android/cmdline-tools/latest
rm /tmp/cmd-tools.zip # delete the zip file (optional)
- you could possibly join include these lines in omvll.env file
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export ANDROID_HOME=$HOME/android
export ANDROID_SDK_ROOT=${ANDROID_HOME}
export PATH=${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${PATH}
- you will find sdkmanager in /tools/bin/sdkmanager
yes | sdkmanager --licenses
- pay attention to use ndk version matching the downloaded obfuscator (I used 25.0.8775105, "omvll_ndk_r25.so")
./sdkmanager --update
./sdkmanager "platforms;android-31" "build-tools;31.0.0" "ndk;25.0.8775105" "platform-tools"
- adjust path to obfuscator binary omvll_ndk_r25.so, change 'tom' to your username:
externalNativeBuild {
cmake {
cppFlags "-std=c++14 -frtti -fexceptions -fpass-plugin=/mnt/c/Users/tom/path-to-project/omvll_ndk_r25.so"
}
}
export NDK_VERSION=25.0.8775105
export LD_LIBRARY_PATH=/home/tom/android/ndk/${NDK_VERSION}/toolchains/llvm/prebuilt/linux-x86_64/lib64
export OMVLL_CONFIG=/mnt/c/Users/tom/path-to-project/omvll-config.py
export OMVLL_PYTHONPATH=/mnt/c/Users/tom/path-to-project/Python-3.10.7/Lib
- I needed to adjust the line with sdk.dir in the local.properties file
...
sdk.dir=/home/tom/android
...
I ran into "env: bash\r: No such file or directory" issue when running gradlew, the following change helped me:
vim gradlew
:set fileformat=unix
:wq
gradlew clean build, gradlew assembleRelease, or whatever you like :)