0

I have created the app with in-app biling and now I want to obfuscate my code to short the chance to crack it. BUt there is some problems with proguard setup. I am trying to setup it by this tutorial. My project structure is common and the main project has the reference to other project which has IN-app service with all functionality. I have stopped on the last step where is executing ant release with code obfuscating. All the time I receive:

Buildfile: /home/viktor/Desktop/Dropbox/work/MyProject/build.xml

-set-mode-check:

-set-release-mode:

-release-obfuscation-check:
     [echo] proguard.config is /home/viktor/android-sdk-linux/tools/proguard/proguard-android.txt:proguard-project.txt
     [echo] Proguard.config is enabled

-check-env:
 [checkenv] Android SDK Tools Revision 21
 [checkenv] Installed at /home/viktor/android-sdk-linux

-setup:
     [echo] Project Name: MyProject
  [gettype] Project Type: Application

-build-setup:
     [echo] Resolving Build Target for MyProject...
[gettarget] Project Target:   Google APIs
[gettarget] Vendor:           Google Inc.
[gettarget] Platform Version: 4.1.2
[gettarget] API level:        16
     [echo] ----------
     [echo] Creating output directories if needed...
     [echo] ----------
     [echo] Resolving Dependencies for MyProject...
[dependency] Library dependencies:
[dependency] 
[dependency] ------------------
[dependency] Ordered libraries:
     [echo] ----------
     [echo] Building Libraries with 'release'...

nodeps:

-set-mode-check:

-set-release-mode:

-release-obfuscation-check:
     [echo] proguard.config is ${proguard.config}

-check-env:
 [checkenv] Android SDK Tools Revision 21
 [checkenv] Installed at /home/viktor/android-sdk-linux

-setup:
     [echo] Project Name: AndroidBillingLibrary
  [gettype] Project Type: Android Library

-build-setup:
     [echo] Resolving Build Target for AndroidBillingLibrary...
[gettarget] Project Target:   Android 4.0.3
[gettarget] API level:        15
     [echo] ----------
     [echo] Creating output directories if needed...
     [echo] ----------
     [echo] Resolving Dependencies for AndroidBillingLibrary...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency] 
[dependency] ------------------
[dependency] API<=15: Adding annotations.jar to the classpath.

-pre-build:

-code-gen:
[mergemanifest] No changes in the AndroidManifest files.
     [echo] Handling aidl files...
     [aidl] Found 1 AIDL files.
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
     [echo] ----------
     [echo] Handling Resources...
     [aapt] No changed resources. R.java and Manifest.java untouched.
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.

-pre-compile:

-compile:
     [echo] Creating library output jar file...

-post-compile:

-obfuscate:

-dex:
     [echo] Library project: do not convert bytecode...

-crunch:
   [crunch] Crunching PNG Files in source dir: /home/viktor/Desktop/Dropbox/work/AndroidBillingLibrary/res
   [crunch] To destination dir: /home/viktor/Desktop/Dropbox/work/AndroidBillingLibrary/bin/res
   [crunch] Crunched 0 PNG files to update cache

-package-resources:
     [echo] Library project: do not package resources...

-package:
     [echo] Library project: do not package apk...

-post-package:

-release-prompt-for-password:

-release-nosign:
     [echo] 
[propertyfile] Updating property file: /home/viktor/Desktop/Dropbox/work/AndroidBillingLibrary/bin/build.prop
[propertyfile] Updating property file: /home/viktor/Desktop/Dropbox/work/AndroidBillingLibrary/bin/build.prop
[propertyfile] Updating property file: /home/viktor/Desktop/Dropbox/work/AndroidBillingLibrary/bin/build.prop
[propertyfile] Updating property file: /home/viktor/Desktop/Dropbox/work/AndroidBillingLibrary/bin/build.prop

-release-sign:

-post-build:

release:

-pre-build:

-code-gen:
[mergemanifest] No changes in the AndroidManifest files.
     [echo] Handling aidl files...
     [aidl] No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
     [echo] ----------
     [echo] Handling Resources...
     [aapt] No changed resources. R.java and Manifest.java untouched.
     [echo] ----------
     [echo] Handling BuildConfig class...
[buildconfig] No need to generate new BuildConfig.

-pre-compile:

-compile:

-dex-obfuscate:

-dex-no-obfuscate:
BUILD FAILED
/home/viktor/Desktop/Dropbox/work/MyProject/add-proguard-release.xml:14: /home/viktor/Desktop/Dropbox/work/MyProject/${out.classes.dir} does not exist.

The error notifies me that something is not found but what and how to fix it?

ANother thing, when I was on the second step where is ant release of unsigned project without obfuscating I have received succes but with some notification: "It seems that you have subprojects, if so, please use --subprojects command". I try to add this parameter and receive totally succes without nitifications quite long but I cannot update subprojects. I m not sure its very bad or not. Please could you help me to fix this moment too.

Community
  • 1
  • 1
Viktor M.
  • 4,393
  • 9
  • 40
  • 71

1 Answers1

2

The tutorial that you are using is outdated. ProGuard is now part of the Android SDK. You can enable it by commenting in the corresponding line in project.properties, as explained in the documentation of the Android SDK.

Eric Lafortune
  • 45,150
  • 8
  • 114
  • 106