4.在編譯 MusicPlayer.apk這個檔案時,會出現一些錯誤...!通常是res/values裡的strings.xml在做怪,因為在編譯的時候,編譯程式會對照res/values裡的public.xml裡面的值有那些,然後再一行一行的編譯 ,當編譯程式對照public.xml的值有strings.xml的值沒有時~!就會編譯錯誤,所以就要把strings.xml裡的值加進去. 例如: 以下是我編譯出來的錯誤結果,您可以看到下面粗體字的地方說D:\S_ZSALK3_Apktool\1\res\values-es\strings.xml:111: error: Multiple substitutio ns specified in non-positional format; did you mean to add the formatted="false" attribute?這一行就是說res/values-es/strings.xml少了這formatted="false",所以就去res/values-es/strings.xml的第111行裡加上formatted="false".
然後我們再看D:\S_ZSALK3_Apktool\1\res\values\public.xml:1334: error: Public symbol string/al phabet_focused_indexlist declared here is not defined.這一行的話,就是res\values\public.xml有定義這個值存在,但res/values/strings.xml裡面沒有,所以就進入res/values/strings.xml加入<string name="alphabet_focused_indexlist">ABCDEFGHIJKLMNOPQRSTUVWXYZㄱㄴㄷㄹㅁㅂㅅㅇㅈㅊㅋㅌㅍㅎあかさたなはまやらわ</string>即可,至於<string name="alphabet_focused_indexlist"></string>這裡面的值要加入什麼可以參考其他語系的strings.xml來拷貝過去~!
編譯出來的錯誤結果 D:\S_ZSALK3_Apktool>3IN_3.cmd 1
D:\S_ZSALK3_Apktool>apktool b "1" I: Checking whether sources has changed... I: Smaling... I: Checking whether resources has changed... I: Building resources... D:\S_ZSALK3_Apktool\1\res\values-es\strings.xml:111: error: Multiple substitutio ns specified in non-positional format; did you mean to add the formatted="false" attribute? D:\S_ZSALK3_Apktool\1\res\values-es\strings.xml:111: error: Unexpected end tag s tring D:\S_ZSALK3_Apktool\1\res\values-pt\strings.xml:111: error: Multiple substitutio ns specified in non-positional format; did you mean to add the formatted="false" attribute? D:\S_ZSALK3_Apktool\1\res\values-pt\strings.xml:111: error: Unexpected end tag s tring D:\S_ZSALK3_Apktool\1\res\values\public.xml:1334: error: Public symbol string/al phabet_focused_indexlist declared here is not defined. D:\S_ZSALK3_Apktool\1\res\values\public.xml:1332: error: Public symbol string/al phabet_indexlist declared here is not defined. D:\S_ZSALK3_Apktool\1\res\values\public.xml:1327: error: Public symbol string/am g_lisence_line1 declared here is not defined. D:\S_ZSALK3_Apktool\1\res\values\public.xml:1328: error: Public symbol string/am g_lisence_line2 declared here is not defined. D:\S_ZSALK3_Apktool\1\res\values\public.xml:1316: error: Public symbol string/ba ckground_playing declared here is not defined. D:\S_ZSALK3_Apktool\1\res\values\public.xml:1322: error: Public symbol string/ba ss_enhancement declared here is not defined. D:\S_ZSALK3_Apktool\1\res\values\public.xml:1335: error: Public symbol string/ch orous declared here is not defined. D:\S_ZSALK3_Apktool\1\res\values\public.xml:1318: error: Public symbol string/cu stom declared here is not defined. D:\S_ZSALK3_Apktool\1\res\values\public.xml:1330: error: Public symbol string/do _recognition declared here is not defined. D:\S_ZSALK3_Apktool\1\res\values\public.xml:1320: error: Public symbol string/dy namic declared here is not defined. D:\S_ZSALK3_Apktool\1\res\values\public.xml:1315: error: Public symbol string/ef fect declared here is not defined. D:\S_ZSALK3_Apktool\1\res\values\public.xml:1336: error: Public symbol string/eq _8 declared here is not defined. D:\S_ZSALK3_Apktool\1\res\values\public.xml:1337: error: Public symbol string/li st_song_deleted declared here is not defined. D:\S_ZSALK3_Apktool\1\res\values\public.xml:1317: error: Public symbol string/li ve declared here is not defined. D:\S_ZSALK3_Apktool\1\res\values\public.xml:1321: error: Public symbol string/mu sic_clarity declared here is not defined. D:\S_ZSALK3_Apktool\1\res\values\public.xml:1338: error: Public entry identifier 0x7f0a0201 entry index is larger than available symbols (index 513, total symbo ls 491). D:\S_ZSALK3_Apktool\1\res\values\public.xml:1338: error: Public symbol string/no _square_selected declared here is not defined. D:\S_ZSALK3_Apktool\1\res\values\public.xml:1329: error: Public symbol string/re quest_config declared here is not defined. D:\S_ZSALK3_Apktool\1\res\values\public.xml:1331: error: Public symbol string/re quest_results declared here is not defined. D:\S_ZSALK3_Apktool\1\res\values\public.xml:1333: error: Public symbol string/tw str_indexlistYears declared here is not defined. D:\S_ZSALK3_Apktool\1\res\values\public.xml:1325: error: Public symbol string/ty pe_1 declared here is not defined. D:\S_ZSALK3_Apktool\1\res\values\public.xml:1326: error: Public symbol string/ty pe_2 declared here is not defined. D:\S_ZSALK3_Apktool\1\res\values\public.xml:1324: error: Public symbol string/vi sual_help_text declared here is not defined. D:\S_ZSALK3_Apktool\1\res\values\public.xml:1323: error: Public symbol string/vi sualization declared here is not defined. D:\S_ZSALK3_Apktool\1\res\values\public.xml:1319: error: Public symbol string/wi de declared here is not defined. Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce ption: could not exec command: [aapt, p, -F, C:\Users\Sfc\AppData\Local\Temp\APK TOOL8943573280465599083.tmp, -I, D:\MyDocuments\apktool\framework\1.apk, -I, D:\ MyDocuments\apktool\framework\2.apk, -I, D:\MyDocuments\apktool\framework\3.apk, -I, D:\MyDocuments\apktool\framework\4.apk, -S, D:\S_ZSALK3_Apktool\1\res, -M, D:\S_ZSALK3_Apktool\1\AndroidManifest.xml] at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav a:193) at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301) at brut.androlib.Androlib.buildResources(Androlib.java:248) at brut.androlib.Androlib.build(Androlib.java:171) at brut.androlib.Androlib.build(Androlib.java:154) at brut.apktool.Main.cmdBuild(Main.java:182) at brut.apktool.Main.main(Main.java:67) Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\U sers\Sfc\AppData\Local\Temp\APKTOOL8943573280465599083.tmp, -I, D:\MyDocuments\a pktool\framework\1.apk, -I, D:\MyDocuments\apktool\framework\2.apk, -I, D:\MyDoc uments\apktool\framework\3.apk, -I, D:\MyDocuments\apktool\framework\4.apk, -S, D:\S_ZSALK3_Apktool\1\res, -M, D:\S_ZSALK3_Apktool\1\AndroidManifest.xml] at brut.util.OS.exec(OS.java:83) at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav a:191) ... 6 more
D:\S_ZSALK3_Apktool>
以下為,我在res/values裡的strings.xml新填加的值,可當做參考: <string name="alphabet_focused_indexlist">ABCDEFGHIJKLMNOPQRSTUVWXYZㄱㄴㄷㄹㅁㅂㅅㅇㅈㅊㅋㅌㅍㅎあかさたなはまやらわ</string> <string name="alphabet_indexlist">ABCDEFGHIJKLMNOPQRSTUVWXYZㄱ@</string> <string name="amg_lisence_line1">Content provided courtesy of</string> <string name="amg_lisence_line2">by All Media Guide</string> <string name="background_playing">Reproduction in 2nd plane</string> <string name="bass_enhancement">Improved low</string> <string name="chorous">Chorus</string> <string name="custom">personalize</string> <string name="do_recognition">Recognizing...</string> <string name="dynamic">dynamic</string> <string name="effect">Sound Effects</string> <string name="eq_8">12k</string> <string name="list_song_deleted">This song will be removed</string> <string name="live">direct Em</string> <string name="music_clarity">Sharpness music</string> <string name="no_square_selected">Not selected Music Square</string> <string name="request_config">The configuration request...</string> <string name="request_results">A request results...</string> <string name="twstr_indexlistYears">1234567890</string> <string name="type_1">Tipo 1</string> <string name="type_2">Tipo 2</string> <string name="visual_help_text">View based animation in music</string> <string name="visualization">preview</string> <string name="wide">broad</string>