The Telerik Platform product is retired.Learn more
  • How to Obfuscate Java Code With ProGuard

How to Obfuscate Java Code With ProGuard


Service Code (AppBuilder), Third-party product
Feature Security
Mobile development type Hybrid (Cordova app)
Mobile OS Android


Application packages cannot be completely secured from reverse-engineering. Instead, it is recommended to use tools for code obfuscation and secure any proprietary code on a server. This article shows how to create a small custom plugin that enables ProGuard and obfuscates all Java code that is present in your AppBuilder Apache Cordova application.


  1. Create an empty folder.
  2. Inside the folder, create three files - package.json, plugin.xml, enable-proguard.gradle.
  3. The package.json file contains only the most basic information required by a Apache Cordova plugin. For example:

      "name": "proguardplugin",
      "version": "1.0.0",
      "description": "",
      "main": "index.js",
      "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1"
      "keywords": [],
      "author": "",
      "license": "ISC"
  4. The plugin.xml file is used to reference the enable-proguard.gradle file and include it in your app. For example:

    <?xml version="1.0" encoding="UTF-8"?>
    <plugin xmlns=""
        <framework src="enable-proguard.gradle" custom="true" type="gradleReference"/>
  5. The enable-proguard.gradle file contains the logic required to enable ProGuard and obfuscate your code.

    android {
        buildTypes {
            release {
                minifyEnabled true
                proguardFile getDefaultProguardFile('proguard-android.txt')
  6. The last step is to archive the folder containing those files and import it to your app as a custom plugin.


Obfuscation with ProGuard in AppBuilder can also be achieved by modifying an already existing custom plugin. This can be accomplished by adding the enable-proguard.gradle file to the plugin folder and referencing it in plugin.xml.

See Also

Contact us: +1-888-365-2779
Copyright © 2016-2018, Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.