Androidã¨ã»ãã¥ãªãã£ï¼Android 2.3(Gingerbread) SDKã«æ¨æºæè¼ãããProGuardã試ã
ã¯ããã«
前回の記事ã§ã¯Antã使ãå½¢ã§ãé£èªåãã¼ã«ã§ããProGuardã®é©ç¨æ¹æ³ãç´¹ä»ãã¾ããã*1
ä»åã¯æ¬æ¥(æ¥æ¬æé12/7)ãªãªã¼ã¹ããã Android 2.3(Gingerbread)ã®SDKï¼æ£ç¢ºã«ã¯SDK Tools r8ã¨ADT8.0.0ï¼ã«æ¨æºã§æè¼ãããProGuardã®é©ç¨æ¹æ³ã«ã¤ãã¦ç´¹ä»ãã¾ãã
ProGuardã¨ã¯
詳細ã¯前回の記事ãåç §é ãããã®ã§ãããProGuardãåãã¦ã®æ¹ã®çºã«ç°¡åã«èª¬æãã¾ããProGuardã¯ã½ã¼ã¹ã³ã¼ããã³ã³ãã¤ã«ããéã«å¦çãæé©åããããããã°ã©ã ä¸ã®å¤æ°ãã¡ã½ãããæå³ã®ãªãæååã«ç½®ãæããéã³ã³ãã¤ã«ãããéã«å¦çã®ä¸èº«ããããã«ããããããããããé£èªåããè¡ããã¼ã«ã§ãã
ããã¾ã§ãAntã使ã£ã¦ProGuardã®é©ç¨ã¯è¡ãã¾ããããææ°ã®SDKã§ã¯æ¨æºæè¼ãããEclipseä¸ããç°¡åã«é£èªåãè¡ããããã«ãªãã¾ããã
GoogleãProGuardãæ¨æºæè¼ããçç±
ä»è ã«ãã解æãé£ããããããã¼ã«ãæ¨æºæ©è½ã¨ãã¦è¼ããã¨ãããã¨ã¯ãè£ãè¿ãã°ãAndroidã®ã¢ããªã±ã¼ã·ã§ã³ã¯ããªãã¼ã¹ã¨ã³ã¸ãã¢ãªã³ã°ã容æãã¨ãããã¨ã§ããããGoogleå ¬å¼ãµã¤ãã®è§£èª¬ãã¼ã¸ã«ãProGuardã¯å®å ¨ã«ãªãã·ã§ã³ã¨ãã¦åä½ããããé©ç¨ã"å¼·ããããããã"ãã¨æ¸ããã¦ãã¾ãããAndroidã¢ããªéçºè ã¯ã³ã¼ãã¬ãã«ã§ç¥ç財ç£ãå®ãã¹ããã¨ãããGoogleããã®éããªãã¡ãã»ã¼ã¸ãªã®ããããã¾ããã
ProGuardãæå¹ã«ããæ¹æ³
ããã§ã¯ã©ã®ããã«ProGuardãé©ç¨ããã°ããããé ã追ã£ã¦è§£èª¬ãã¾ãã
ããã¸ã§ã¯ãã®ä½æ
Android 2.3ã®SDKãå©ç¨ãã¦Eclipseä¸ã§ããã¸ã§ã¯ããæ°è¦ä½æããã¨ãProGuardã®è¨å®ãè¨è¿°ããããproguard.cfgããã¡ã¤ã«ãèªåçã«çæããã¾ãããã®ãã¡ã¤ã«ã«ã¯äºããæ¨æºçã«å¿ è¦ã¨ãªãè¨å®ãè¨è¼ããã¦ãã¾ãã®ã§ãåºæ¬çã«ä¿®æ£ã®å¿ è¦ã¯ããã¾ããã
default.propertiesã®ä¿®æ£
ä½æããããã¸ã§ã¯ãã®ãã¼ã ç´ä¸ã«é ç½®ããã¦ããdefault.propertiesã®æçµè¡ã«ãä¸è¨ã追è¨ãã¾ãã
proguard.config = <proguard.cfgã®çµ¶å¯¾ãã¹> ã¾ã㯠<proguard.cfgã®ããã¸ã§ã¯ããã¼ã ããã®ç¸å¯¾ãã¹>
以ä¸ã¯ããã¸ã§ã¯ãã®ãã¼ã ã«proguard.cfgãé ç½®ããã¦ããç¶æ ã§ã®ãdefault.propertiesã®è¨å®ã®ä¾ã§ãã
# This file is automatically generated by Android Tools. # Do not modify this file -- YOUR CHANGES WILL BE ERASED! # # This file must be checked in Version Control Systems. # # To customize properties used by the Ant build system use, # "build.properties", and override values to adapt the script to your # project structure. # Project target. target=android-9 proguard.config=proguard.cfg
åºæ¬çã«ã¯ãã®è¨å®ã ãã§ProGuardãæå¹ã«ãªãã¾ãï¼*2
ProGuardã®è¨å®å¤æ´
åºæ¬çã«åç¯ã®è¨å®ã®ã¿ã§ProGuardãå®è¡ããã¾ãããä¸è¨ã®ãããªå ´åã¯å®è¡ã«å¤±æãããã¨ãããã¾ãã
- AndroidManifest.xmlãã¡ã¤ã«ã®ã¿ããåç §ããã¦ããã¯ã©ã¹
- JNIããå¼ã³åºãããã¡ã½ãã
- åçåç §ãããå¤æ°ãã¡ã½ãã
ProGuardã®å®è¡ã«å¤±æããå ´åã¯ãproguard.cfgãã¡ã¤ã«ã« -keep ãªãã·ã§ã³ãä»å ããè¡ã追è¨ããProGuardã®é©ç¨ãé¤å¤ããå¿ è¦ãããã¾ãã
-keep public class <MyClass>
-keepãªãã·ã§ã³ã«é¢ãã詳ããæ
å ±ã¯ã前回の記事ãProGuardのマニュアルãåç
§ãã¦ä¸ããã
ProGuardãé©ç¨ãã
Antã使ã
å¾æ¥ã®æ¹æ³ã¨åæ§ãant release ã³ãã³ãã§ProGuardãé©ç¨ãããã¨ãå¯è½ã§ãã詳細ã¯前回の記事ãåç §ãã¦ä¸ããã
Eclipseã®ã¨ã¯ã¹ãã¼ãæ©è½ã使ã
ã¡ãã¥ã¼ããããã¡ã¤ã« -> ã¨ã¯ã¹ãã¼ã -> Android -> Export Android application ã¨é¸æãã¦ãã¢ããªã±ã¼ã·ã§ã³ã¸ã®ç½²åãè¡ããapkãã¡ã¤ã«ãåºåãã¾ãã
apkãã¡ã¤ã«ã®åºåã¨åæã«ãä¸è¨ã®ãããªãã°ãEclipseã®ã³ã³ã½ã¼ã«ãã¥ã¼ã«åºåããã¦ããã¯ãã§ãã*3
[2010-12-07 13:05:28 - HelloAndroid] Refreshing resource folders. [2010-12-07 13:05:28 - HelloAndroid] Starting incremental Pre Compiler: Checking resource changes. [2010-12-07 13:05:28 - HelloAndroid] Nothing to pre compile! [2010-12-07 13:05:28 - HelloAndroid] /android-sdk-mac_x86/platform-tools/aapt package -f -v -M /Users/seto/Documents/workspace/HelloAndroid/AndroidManifest.xml -S /Users/seto/Documents/workspace/HelloAndroid/res -A /Users/seto/Documents/workspace/HelloAndroid/assets -I /android-sdk-mac_x86/platforms/android-9/android.jar -F /var/folders/cb/cb2FqG62E5izgbafkF4ouE++--U/-Tmp-/android_1153826279934575801.ap_ [2010-12-07 13:05:28 - HelloAndroid] Found 0 custom asset files in /Users/seto/Documents/workspace/HelloAndroid/assets [2010-12-07 13:05:28 - HelloAndroid] Locale/Vendor pairs: [2010-12-07 13:05:28 - HelloAndroid] / [2010-12-07 13:05:28 - HelloAndroid] / [2010-12-07 13:05:28 - HelloAndroid] / [2010-12-07 13:05:28 - HelloAndroid] / [2010-12-07 13:05:28 - HelloAndroid] [2010-12-07 13:05:28 - HelloAndroid] ãã¡ã¤ã«: [2010-12-07 13:05:28 - HelloAndroid] drawable-hdpi/icon.png [2010-12-07 13:05:28 - HelloAndroid] Src: /Users/seto/Documents/workspace/HelloAndroid/res/drawable-hdpi/icon.png [2010-12-07 13:05:28 - HelloAndroid] drawable-ldpi/icon.png [2010-12-07 13:05:28 - HelloAndroid] Src: /Users/seto/Documents/workspace/HelloAndroid/res/drawable-ldpi/icon.png [2010-12-07 13:05:28 - HelloAndroid] drawable-mdpi/icon.png [2010-12-07 13:05:28 - HelloAndroid] Src: /Users/seto/Documents/workspace/HelloAndroid/res/drawable-mdpi/icon.png [2010-12-07 13:05:28 - HelloAndroid] layout/main.xml [2010-12-07 13:05:28 - HelloAndroid] Src: /Users/seto/Documents/workspace/HelloAndroid/res/layout/main.xml [2010-12-07 13:05:28 - HelloAndroid] values/strings.xml [2010-12-07 13:05:28 - HelloAndroid] Src: /Users/seto/Documents/workspace/HelloAndroid/res/values/strings.xml [2010-12-07 13:05:28 - HelloAndroid] AndroidManifest.xml [2010-12-07 13:05:28 - HelloAndroid] Src: /Users/seto/Documents/workspace/HelloAndroid/AndroidManifest.xml [2010-12-07 13:05:28 - HelloAndroid] Including resources from package: /android-sdk-mac_x86/platforms/android-9/android.jar [2010-12-07 13:05:28 - HelloAndroid] applyFileOverlay for drawable [2010-12-07 13:05:28 - HelloAndroid] applyFileOverlay for layout [2010-12-07 13:05:28 - HelloAndroid] applyFileOverlay for anim [2010-12-07 13:05:28 - HelloAndroid] applyFileOverlay for xml [2010-12-07 13:05:28 - HelloAndroid] applyFileOverlay for raw [2010-12-07 13:05:28 - HelloAndroid] applyFileOverlay for color [2010-12-07 13:05:28 - HelloAndroid] applyFileOverlay for menu [2010-12-07 13:05:28 - HelloAndroid] (processed image /Users/seto/Documents/workspace/HelloAndroid/res/drawable-hdpi/icon.png: 95% size of source) [2010-12-07 13:05:28 - HelloAndroid] (processed image /Users/seto/Documents/workspace/HelloAndroid/res/drawable-ldpi/icon.png: 89% size of source) [2010-12-07 13:05:28 - HelloAndroid] (processed image /Users/seto/Documents/workspace/HelloAndroid/res/drawable-mdpi/icon.png: 85% size of source) [2010-12-07 13:05:28 - HelloAndroid] (new resource id icon from drawable-hdpi/icon.png #generated) [2010-12-07 13:05:28 - HelloAndroid] (new resource id icon from drawable-hdpi/icon.png #generated) [2010-12-07 13:05:28 - HelloAndroid] (new resource id icon from drawable-hdpi/icon.png #generated) [2010-12-07 13:05:28 - HelloAndroid] (new resource id main from /Users/seto/Documents/workspace/HelloAndroid/res/layout/main.xml) [2010-12-07 13:05:28 - HelloAndroid] Opening '/var/folders/cb/cb2FqG62E5izgbafkF4ouE++--U/-Tmp-/android_1153826279934575801.ap_' [2010-12-07 13:05:28 - HelloAndroid] Writing all files... [2010-12-07 13:05:28 - HelloAndroid] 'res/layout/main.xml' (compressed 49%) [2010-12-07 13:05:28 - HelloAndroid] 'AndroidManifest.xml' (compressed 61%) [2010-12-07 13:05:28 - HelloAndroid] 'resources.arsc' (not compressed) [2010-12-07 13:05:28 - HelloAndroid] 'res/drawable-hdpi/icon.png' (not compressed) [2010-12-07 13:05:28 - HelloAndroid] 'res/drawable-ldpi/icon.png' (not compressed) [2010-12-07 13:05:28 - HelloAndroid] 'res/drawable-mdpi/icon.png' (not compressed) [2010-12-07 13:05:28 - HelloAndroid] Generated 6 files [2010-12-07 13:05:28 - HelloAndroid] Included 0 files from jar/zip files. [2010-12-07 13:05:28 - HelloAndroid] Checking for deleted files [2010-12-07 13:05:28 - HelloAndroid] çµäº! [2010-12-07 13:05:28 - HelloAndroid] ProGuard, version 4.4 [2010-12-07 13:05:28 - HelloAndroid] Reading input... [2010-12-07 13:05:28 - HelloAndroid] Reading program jar [/private/var/folders/cb/cb2FqG62E5izgbafkF4ouE++--U/-Tmp-/android_16917046672536715.jar] [2010-12-07 13:05:28 - HelloAndroid] Reading library jar [/android-sdk-mac_x86/platforms/android-9/android.jar] [2010-12-07 13:05:30 - HelloAndroid] åæåä¸... [2010-12-07 13:05:30 - HelloAndroid] 注: the configuration refers to the unknown class 'com.android.vending.licensing.ILicensingService' [2010-12-07 13:05:30 - HelloAndroid] 注: there were 1 references to unknown classes. [2010-12-07 13:05:30 - HelloAndroid] You should check your configuration for typos. [2010-12-07 13:05:30 - HelloAndroid] Ignoring unused library classes... [2010-12-07 13:05:30 - HelloAndroid] Original number of library classes: 2750 [2010-12-07 13:05:30 - HelloAndroid] Final number of library classes: 148 [2010-12-07 13:05:30 - HelloAndroid] Printing kept classes, fields, and methods... [2010-12-07 13:05:30 - HelloAndroid] Shrinking... [2010-12-07 13:05:30 - HelloAndroid] Printing usage to [/Users/seto/Documents/workspace/HelloAndroid/proguard/usage.txt]... [2010-12-07 13:05:30 - HelloAndroid] Removing unused program classes and class elements... [2010-12-07 13:05:30 - HelloAndroid] Original number of program classes: 8 [2010-12-07 13:05:30 - HelloAndroid] Final number of program classes: 2 [2010-12-07 13:05:30 - HelloAndroid] Optimizing... [2010-12-07 13:05:30 - HelloAndroid] Number of finalized classes: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of vertically merged classes: 0 (使ç¨ä¸å¯) [2010-12-07 13:05:30 - HelloAndroid] Number of horizontally merged classes: 0 (使ç¨ä¸å¯) [2010-12-07 13:05:30 - HelloAndroid] Number of removed write-only fields: 0 (使ç¨ä¸å¯) [2010-12-07 13:05:30 - HelloAndroid] Number of privatized fields: 0 (使ç¨ä¸å¯) [2010-12-07 13:05:30 - HelloAndroid] Number of inlined constant fields: 0 (使ç¨ä¸å¯) [2010-12-07 13:05:30 - HelloAndroid] Number of privatized methods: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of staticized methods: 2 [2010-12-07 13:05:30 - HelloAndroid] Number of finalized methods: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of removed method parameters: 2 [2010-12-07 13:05:30 - HelloAndroid] Number of inlined constant parameters: 1 [2010-12-07 13:05:30 - HelloAndroid] Number of inlined constant return values: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of inlined short method calls: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of inlined unique method calls: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of inlined tail recursion calls: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of merged code blocks: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of variable peephole optimizations: 1 [2010-12-07 13:05:30 - HelloAndroid] Number of arithmetic peephole optimizations: 0 (使ç¨ä¸å¯) [2010-12-07 13:05:30 - HelloAndroid] Number of cast peephole optimizations: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of field peephole optimizations: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of branch peephole optimizations: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of simplified instructions: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of removed instructions: 19 [2010-12-07 13:05:30 - HelloAndroid] Number of removed local variables: 6 [2010-12-07 13:05:30 - HelloAndroid] Number of removed exception blocks: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of optimized local variable frames: 1 [2010-12-07 13:05:30 - HelloAndroid] Shrinking... [2010-12-07 13:05:30 - HelloAndroid] Removing unused program classes and class elements... [2010-12-07 13:05:30 - HelloAndroid] Original number of program classes: 2 [2010-12-07 13:05:30 - HelloAndroid] Final number of program classes: 2 [2010-12-07 13:05:30 - HelloAndroid] Optimizing... [2010-12-07 13:05:30 - HelloAndroid] Number of finalized classes: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of vertically merged classes: 0 (使ç¨ä¸å¯) [2010-12-07 13:05:30 - HelloAndroid] Number of horizontally merged classes: 0 (使ç¨ä¸å¯) [2010-12-07 13:05:30 - HelloAndroid] Number of removed write-only fields: 0 (使ç¨ä¸å¯) [2010-12-07 13:05:30 - HelloAndroid] Number of privatized fields: 0 (使ç¨ä¸å¯) [2010-12-07 13:05:30 - HelloAndroid] Number of inlined constant fields: 0 (使ç¨ä¸å¯) [2010-12-07 13:05:30 - HelloAndroid] Number of privatized methods: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of staticized methods: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of finalized methods: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of removed method parameters: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of inlined constant parameters: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of inlined constant return values: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of inlined short method calls: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of inlined unique method calls: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of inlined tail recursion calls: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of merged code blocks: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of variable peephole optimizations: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of arithmetic peephole optimizations: 0 (使ç¨ä¸å¯) [2010-12-07 13:05:30 - HelloAndroid] Number of cast peephole optimizations: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of field peephole optimizations: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of branch peephole optimizations: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of simplified instructions: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of removed instructions: 2 [2010-12-07 13:05:30 - HelloAndroid] Number of removed local variables: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of removed exception blocks: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of optimized local variable frames: 0 [2010-12-07 13:05:30 - HelloAndroid] Shrinking... [2010-12-07 13:05:30 - HelloAndroid] Removing unused program classes and class elements... [2010-12-07 13:05:30 - HelloAndroid] Original number of program classes: 2 [2010-12-07 13:05:30 - HelloAndroid] Final number of program classes: 2 [2010-12-07 13:05:30 - HelloAndroid] Optimizing... [2010-12-07 13:05:30 - HelloAndroid] Number of finalized classes: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of vertically merged classes: 0 (使ç¨ä¸å¯) [2010-12-07 13:05:30 - HelloAndroid] Number of horizontally merged classes: 0 (使ç¨ä¸å¯) [2010-12-07 13:05:30 - HelloAndroid] Number of removed write-only fields: 0 (使ç¨ä¸å¯) [2010-12-07 13:05:30 - HelloAndroid] Number of privatized fields: 0 (使ç¨ä¸å¯) [2010-12-07 13:05:30 - HelloAndroid] Number of inlined constant fields: 0 (使ç¨ä¸å¯) [2010-12-07 13:05:30 - HelloAndroid] Number of privatized methods: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of staticized methods: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of finalized methods: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of removed method parameters: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of inlined constant parameters: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of inlined constant return values: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of inlined short method calls: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of inlined unique method calls: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of inlined tail recursion calls: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of merged code blocks: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of variable peephole optimizations: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of arithmetic peephole optimizations: 0 (使ç¨ä¸å¯) [2010-12-07 13:05:30 - HelloAndroid] Number of cast peephole optimizations: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of field peephole optimizations: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of branch peephole optimizations: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of simplified instructions: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of removed instructions: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of removed local variables: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of removed exception blocks: 0 [2010-12-07 13:05:30 - HelloAndroid] Number of optimized local variable frames: 0 [2010-12-07 13:05:30 - HelloAndroid] Obfuscating... [2010-12-07 13:05:30 - HelloAndroid] Printing mapping to [/Users/seto/Documents/workspace/HelloAndroid/proguard/mapping.txt]... [2010-12-07 13:05:30 - HelloAndroid] Writing output... [2010-12-07 13:05:30 - HelloAndroid] Preparing output jar [/private/var/folders/cb/cb2FqG62E5izgbafkF4ouE++--U/-Tmp-/android_2607110758288445210.jar] [2010-12-07 13:05:30 - HelloAndroid] Copying resources from program jar [/private/var/folders/cb/cb2FqG62E5izgbafkF4ouE++--U/-Tmp-/android_16917046672536715.jar] [2010-12-07 13:05:30 - HelloAndroid] Printing classes to [/Users/seto/Documents/workspace/HelloAndroid/proguard/dump.txt]...
ä¸è¨ã®ããã«åºåããã¦ããã°ãé£èªåãããã¦ãã¾ãã
[2010-12-07 13:05:30 - HelloAndroid] Obfuscating... [2010-12-07 13:05:30 - HelloAndroid] Printing mapping to [/Users/seto/Documents/workspace/HelloAndroid/proguard/mapping.txt]...
ProGuardæå¹æã«åºåããããã¡ã¤ã«/ãã£ã¬ã¯ããª
ProGuardãé©ç¨ãããã¨ã<ããã¸ã§ã¯ãã®ãã¼ã >/proguard/ ã«ãã£ã¬ã¯ããªãçæããããã®ä¸ã«ä¸è¨ã®ãããªãã¡ã¤ã«ãåºåããã¾ãã*4
- dump.txtï¼.apkãã¡ã¤ã«ä¸ã®ã¯ã©ã¹ã®å é¨æ§é ãè¨è¼ããã¦ãã¾ãã
- mapping.txtï¼é£èªååã¨é£èªåå¾ã®ã¯ã©ã¹ãã¡ã½ãããå¤æ°ã®å¯¾å¿ãªã¹ã
- seed.txtï¼é£èªåããã¦ããªãã¯ã©ã¹ãã¡ã³ãã®ãªã¹ã
- usage.txtï¼.apkãã¡ã¤ã«ããå¤ãããã³ã¼ãã®ãªã¹ã
ç¹ã«ãmapping.txtã¯ããªãªã¼ã¹ãã«ãããapkããéãããé£èªåããããã°ãªãã¼ãï¼ã¹ã¿ãã¯ãã¬ã¼ã¹ï¼ãå¯èªåããããã«å¿
è¦ã¨ãªãã¾ãã
ProGuardå©ç¨æã®æ³¨æç¹
proguardãã£ã¬ã¯ããªã¯ããªãªã¼ã¹ãã«ãã®éã«ä¸æ¸ãããã¾ãããããã失ãã¨ããªãªã¼ã¹å¾ã®ãã°ã¬ãã¼ãããåå ã調æ»ãããã¨ãå°é£ã«ãªãã¾ãã®ã§ãproguardãã£ã¬ã¯ããªã®ä¸èº«ï¼ç¹ã«mapping.txtãã¡ã¤ã«ï¼ã¯ããªãªã¼ã¹ãã¼ã¸ã§ã³æ¯ã«ä¿åãã¦ããå¿
è¦ãããã¾ãã
Androidéçºè
ãµã¤ãã§ã¯ãä¿åã®æ¹æ³ã¨ãã¦ä¸è¨ã®ãããªãã®ãæ¨å¥¨ããã¦ãã¾ãã
- ãªãªã¼ã¹æã®ãã¼ã¸ã§ã³ã¾ãã¯ãã«ãçªå·ãããã©ã«ãããã¡ã¤ã«åã«è¿½è¨ãã
- ãã¼ã¸ã§ã³ç®¡çã·ã¹ãã ã«ãã¡ã¤ã«ãç»é²ãã
é£èªåãããã¹ã¿ãã¯ãã¬ã¼ã¹ããã³ã¼ãããæ¹æ³
ProGuardã¯é£èªåã«ããã¦ç¸å¿ã®å¹æãçºæ®ãããã¼ã«ã§ã¯ããã¾ãããåé¢ããããã°ã«å¿
è¦ãªæ
å ±ã¾ã§ããé£èªåããã¦ãã¾ãæ¬ ç¹ãããã¾ãããã®ãããææ°ã®Android SDKã«ã¯ãé£èªåãããã¹ã¿ãã¯ãã¬ã¼ã¹ãå¯èªåããããã®ãã·ã§ã«ã¹ã¯ãªãããä»å±ããã¦ãã¾ãã
ã³ãã³ãã®æ¸å¼ï¼
retrace.bat|retrace.sh [-verbose] mapping.txt [<stacktrace_file>]
使ç¨ä¾ï¼
retrace.sh -verbose mapping.txt obfuscated_trace.txt
ä¾ã®mapping.txtã¯ããªãªã¼ã¹æã«ä¿åãã¦ããããã¡ã¤ã«ãobfuscated_trace.txtã¯ãé£èªåããããã°ãªãã¼ãä¸ã®ã¹ã¿ãã¯ãã¬ã¼ã¹ãè¨è¼ãããã¡ã¤ã«ã§ãã
ã¡ãªã¿ã«ãã¹ã¿ãã¯ãã¬ã¼ã¹ãè¨è¼ãããã¡ã¤ã«ãçç¥ããå ´åãæ¨æºå
¥åããã¹ã¿ãã¯ãã¬ã¼ã¹ãèªã¿è¾¼ãã§ããã³ã¼ããã¾ãã
ããç°¡åã«ä½¿ããããã«ãªã£ãProGuardã§ãããªãã®ã¢ããªã±ã¼ã·ã§ã³ãå®ãã¾ãããï¼
æ責ï¼æè¡é¨ æ¤ç©å·¥å ´ç 究G ç¬æ¸ ç´å
*1:æ¸ããç¢å ã«æ¨æºæè¼ãããè¨äºã®ä¾¡å¤ãååã«ãªããã¤ãã«ãã¨ãªã£ã¦è¿½å è¨äºãæ¸ãããã¯ãã¦ãã¾ããã
*2:ç°¡åããã¦ååã®è¨äºã¯ä¸ä½ä½ã ã£ããã ã¨è¨ããããªãã¾ãã
*3:ãã°ãåºåãããªãå ´åã¯ãEclipseã®ã¡ãã¥ã¼->ç°å¢è¨å®->Android->ãã«ãã®ããã«ãåºåãã®ãªãã·ã§ã³ãã詳細ãã«è¨å®ãã¦ã¿ã¦ãã ããã
*4:Antã§å®è¡ããå ´åãåºåå ã¯<ããã¸ã§ã¯ãã®ãã¼ã >/bin/proguard/ ã¨ãªãã¾ãã