Protect Android AAR projects

Protect Android AAR Library


Android Archive (AAR) is the bundle of the binary distribution of an Android Library Which contains the libs used or reused across multiple apps. The AAR's structure is similar to a Android APK file.

Virbox Protector supports to protect/encrypt the Android Archive (AAR) library both in GUI tool and CLI tool

Using Virbox Protector, developer will quickly complete the encryption/protection process to the AAR projects without additional coding on local premise and no need to upload your application to cloud and no any leaky risk for your android application to upload to cloud.

With Virbox Protector, Developer can protect AAR project with multiple protection layer and protect to specified functions/method level with virtualization. The protected AAR can be effectively to defend decompiler to reverse engineering to retrieve the source code/functions.

Here we introduce how to use Virbox Protector, a Secure and hardening tool, to protect AAB format projects quickly.

Protect AAR project in 5 Steps

  1. Import the AAR project into Virbox Protector; Drag the AAR project into the Virbox Protector

  2. Set the configuration of "Function Option"; (Protect specified functions)

  3. Set the configuration of "Native library Protection" (Protect libs )

  4. Click to Start the "Protection" Process

  5. Backup the source file and use the protected project for further testing and save the "configuration" file


Sign-up Virbox Protector and install the Virbox Protector;

Open Virbox Protector and sign in with your account;

Protection Process

1. Import the AAB project into Virbox Protector;

Open Virbox Protector, Drag the AAR project into the Virbox Protector


Click the Menu-->File-->Open File which located in the Main menu of Virbox Protector, to select the project (AAR) which you plan to protect;

2. Set the configuration of "Function Option"; (Protect specified functions)

Go to the "Functions Options" to set the protection option to these specified "functions":

Click "Add Functions" to select and add the functions which need to be protected. Its recommend to protect those functions which is critical (to keep execution performance) and do not select all of function to be protected which will bring negative impact execution performance.

Select the protection mode to be the "Virtualization"

click "Analysis" to simulate the execution performance;

3. Set the configuration of "Native library Protection" (Protect libs )

Virbox protector support to protect the libs contains in AAR project, Go to the "Native Library Protection":

Click "Select Files" to select those library which need to be protected;

the libs be protected here only be compression, if you want to protect the functions contained in the libs. pls drag the protected libs in to the Virbox Protector and use "Function Option" to set the protection to those functions;

4. Click to Start the "Protection" Process

Click "Protect Selected Protects" to start the Protection process:

After protection completed, you will find;

a new "ssp" configuration file, has been generated in the output directory, in below example, the "autoreplyprint.aar.ssp" is the configuration file;

and another new sub directory \proteced has been generated and the protected AAR will be located in this new sub directory.

5. Backup the source file. use the protected project for further testing and save the "configuration" file;

Now you can use the new protected project for further testing and evaluation the protection performance;

Follow up, we will briefing how to use Virbox Protector CLI tool to protect AAR project in command line mode:

Protection Process by use of Virbox Protector CLI tool

Virbox Protector provides 2 ways to support developer to protect their projects, Virbox Protector GUI tool and Virbox Protector CLI tool. you can find the CLI tool under the \bin of Virbox Protector installation directory.


  1. Generate the configuration file

    Use Virbox Protector GUI tool to generate the .ssp configuration file, you can follow the operation in above steps to generate the configuration file.

    Select the functions which need to be protected in the "Function Options";

    Select the protection option: "Virtualization" to these Functions;

    Click "Save Selected Configuration" to generate a "Configuration" file;

    Put this "Configuration" file into the same directory which the AAR project located.

  2. Execute the:virboxprotector_con.exe

    Open a terminal windows, go to the sub directory which virboxprotector_con.exe locate and execute the command and return to view the help information.

3. Protect the AAR projects:

virboxprotector_con.exe test.aar -o test.ssp.aar

the test.ssp.aar is the encrypted aar project after protection

Last updated