To create an obfuscated application package (.apk)
file in IBM MobileFirst™ Platform Studio,
you edit the Android native project properties file, then build your
application in release mode.
About this task
The following steps assume that you are developing in an
Eclipse integrated development environment (IDE).
Procedure
- Complete the appropriate steps in the following
table, depending on whether you are developing a native or a hybrid
application:
Native Android application |
Hybrid Android application |
- Copy the file proguard-project.txt from the
MobileFirst Native API for Android application to your Android project
in Eclipse.
- Open the project.properties file with a text
editor and add the text proguard.config=proguard-project.txt on
a separate line in the file.
|
- Open the project_name/apps/app_name/android/native/project.properties file
with a text editor.
- In the project.properties file that you just
opened, uncomment the line proguard.config=proguard-project.txt.
|
- Add any other configuration details that might
be needed by your application to the proguard-project.txt file.
- Build your application in release mode.
- Save a copy of the mapping.txt file. The mapping.txt file defines how your classes
are obfuscated and is needed to debug stack traces.
Important: For
each build that you publish, copy the mapping.txt file
or save it under a new name because subsequent builds will overwrite
the file. It is important to save this file for each build for which
you might need to restore a stack trace.