難読化されたAndroidアプリにproguardを使用する方法.apkのアプリケーションをエクスポートすると、次の問題が発生します。
問題
[2013-09-26 13:16:53 - Fishing_log] Proguard returned with error code 1. See console
[2013-09-26 13:16:53 - Fishing_log] proguard.ParseException: Value of system property 'init' is undefined in 'string/app_name { <init>' in line 2 of file 'C:\Users\owner\workspace8\Fishing_log\bin\proguard.txt',
[2013-09-26 13:16:53 - Fishing_log] included from argument number 6
[2013-09-26 13:16:53 - Fishing_log] at proguard.ConfigurationParser.replaceSystemProperties(ConfigurationParser.java:1153)
[2013-09-26 13:16:53 - Fishing_log] at proguard.ConfigurationParser.file(ConfigurationParser.java:1113)
[2013-09-26 13:16:53 - Fishing_log] at proguard.ConfigurationParser.parseIncludeArgument(ConfigurationParser.java:242)
[2013-09-26 13:16:53 - Fishing_log] at proguard.ConfigurationParser.parse(ConfigurationParser.java:150)
[2013-09-26 13:16:53 - Fishing_log] at proguard.ProGuard.main(ProGuard.java:476)
この問題を解決するにはどうすればよいですか?
project.propertiesとproguard-project.txtに次のコードを追加しました
プロジェクトのプロパティ
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
proguard-project.txt
-injars lib
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-dontnote
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-dontwarn sun.misc.Unsafe, java.lang.management.ManagementFactory, org.codehaus.jackson.JsonParser, org.json.JSONObject, org.codehaus.jackson.JsonGenerator, org.codehaus.jackson.JsonFactory, com.google.common.collect.MinMaxPriorityQueue
-keep public class * extends android.app.Application
-keep public class com.android.vending.licensing.ILicensingService
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
#Keep the R
-keepclassmembers class **.R$* {
public static <fields>;
}