Qual'è il problema?
Applicazioni del genere danno problemi in ricompilazione per via della formattazione, ma se controlli il log e individui le stringhe che generano l errore basta che ci aggiungi
formatted="false"
Ma solo alle linee che ti dice
Visualizzazione stampabile
Mi dà errore sul manifest...
Quote:
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.Androl
ibException: brut.common.BrutException: could not exec command: [aapt, p, --min-
sdk-version, 16, --target-sdk-version, 16, -F, C:\Users\Romolo\AppData\Local\Tem
p\APKTOOL5302626032690289782.tmp, -0, arsc, -I, C:\Users\Romolo\apktool\framewor
k\1.apk, -S, C:\Users\Romolo\Desktop\APK-Multi-Tool\other\..\projects\Phone.apk\
res, -M, C:\Users\Romolo\Desktop\APK-Multi-Tool\other\..\projects\Phone.apk\Andr
oidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib .java:358)
at brut.androlib.Androlib.buildResources(Androlib.jav a:283)
at brut.androlib.Androlib.build(Androlib.java:206)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:228)
at brut.apktool.Main.main(Main.java:79)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not
exec command: [aapt, p, --min-sdk-version, 16, --target-sdk-version, 16, -F, C:
\Users\Romolo\AppData\Local\Temp\APKTOOL5302626032 690289782.tmp, -0, arsc, -I, C
:\Users\Romolo\apktool\framework\1.apk, -S, C:\Users\Romolo\Desktop\APK-Multi-To
ol\other\..\projects\Phone.apk\res, -M, C:\Users\Romolo\Desktop\APK-Multi-Tool\o
ther\..\projects\Phone.apk\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(An drolibResources.jav
a:357)
at brut.androlib.Androlib.buildResourcesFull(Androlib .java:336)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sd
k-version, 16, --target-sdk-version, 16, -F, C:\Users\Romolo\AppData\Local\Temp\
APKTOOL5302626032690289782.tmp, -0, arsc, -I, C:\Users\Romolo\apktool\framework\
1.apk, -S, C:\Users\Romolo\Desktop\APK-Multi-Tool\other\..\projects\Phone.apk\re
s, -M, C:\Users\Romolo\Desktop\APK-Multi-Tool\other\..\projects\Phone.apk\Androi
dManifest.xml]
at brut.util.OS.exec(OS.java:89)
at brut.androlib.res.AndrolibResources.aaptPackage(An drolibResources.jav
a:355)
... 6 more
Eccoci qui...innanzitutto complimenti...avrei bisogno di un piccolo aiuto:
dovrei modificare la voce cyanogenmod version con un'altro titolo...per fare ciò dopo aver installato il framework e aver decompilato l'apk delle impostazioni sono entrato in res>xml ed ho aperto con notepad++ il file device_info_settings...
Ora non riesco a capire bene...in pratica dovrei aprire l'androidmanifest. xml e modificarlo da lì?Quote:
<Preference android:title="@string/model_number" android:key="device_model" android:summary="@string/device_info_default" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/firmware_version" android:key="firmware_version" android:summary="@string/device_info_default" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/fcc_equipment_id" android:key="fcc_equipment_id" android:summary="@string/device_info_default" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/baseband_version" android:key="baseband_version" android:summary="@string/device_info_default" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/kernel_version" android:key="kernel_version" android:summary="@string/device_info_default" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/cpu_info" android:key="device_cpu" android:summary="@string/device_info_default" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/mem_info" android:key="device_memory" android:summary="@string/device_info_default" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/mod_version" android:key="mod_version" android:summary="@string/mod_version_default" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/build_date" android:key="build_date" android:summary="@string/build_date_default" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/build_number" android:key="build_number" android:summary="@string/device_info_default" style="?android:preferenceInformationStyle" />
<Preference android:title="@string/selinux_status" android:key="selinux_status" android:summary="@string/selinux_status_enforcing" style="?android:preferenceInformationStyle" />
</PreferenceScreen>
O da qualche altra parte...?
EDIT:A quanto pare bisogna farlo dallo strings. xml , ma :O non lo trovo...
si, negli .xml in xml non lo troverai mai :) tutte le scritte che appariranno nelle preferencecategory (quella che vuoi cambiare), preferencescreen e i summary li trovi definiti in values/strings.xml...
un file che contiene tutte le scritte dei menu dei settings.
infatti se vai sul github AOSP nelle strings.xml trovi questo
Ma! in Cyanogenmod, se vai a vedere il codice sorgente sul github, troverai un .xml, cm_strings.xml, nella cartella values, dove sono definite tutte le stringhe custom ... lo avranno fatto per comodità :-)codice:<string name="firmware_version">Android version</string>
<!-- About phone screen, status item label-->
<string name="model_number">Model number</string>
<!-- About phone screen, fcc equipment id label-->
https://github.com/CyanogenMod/andro...cm_strings.xml
Mi raccomando pero' a cambiare il valore anche del cm_strings che trovi in values-it se usi la lingua italianacodice:<string name="device_hostname">Device hostname</string>
<!-- About phone screen, setting option name-->
<string name="mod_version">CyanogenMod version</string>
<string name="mod_version_default">Unknown</string>
<!-- About phone screen, build date of ROM -->
<string name="build_date">Build date</string>
<string name="build_date_default" translatable="false">2013-01-01-0000</string>
Il problema non è il manifest, perché quel file serve esclusivamente a dichiarare le activity dell'applicazione Phone.apk
il vero problema è che il file strings.xml contenuto nella cartella che vuoi aggiungere, values-it, contiene delle stringhe che pero' non sono contenute nello strings.xml principale, ovvero quello che si trova in values
http://s30.postimg.org/m3ia1yqfl/Untitled.png
quindi dovresti vedere tutte le stringhe che ti danno errore e aggiungerle in /values/strings.xml ovviamente tradotte in inglese, perché se le hai solo in values-it e non li, è come se non le avessi definite, per questo ti da errore ;-)
se le aggiungi la, l'unico errore che ti darà sarà per le altre strings.xml delle altre traduzioni, ma ricompilerà lo stesso...
l'importante è che, con log alla mano, tu le aggiunga anche nello strings.xml principale, oppure le rimuovi dallo strings.xml di values-it
la cosa migliore pero' sarebbe partire dallo strings.xml originale, farne una copia, tradurlo e inserirlo nella cartella values-it... se quelle stringhe non sono definite in quello principale significa che stai usando uno string da un'altra rom o che hai comunque aggiunto molto più del dovuto ...
Ho provato ad aggiungere una traduzione di un'altro telefono ma dello stesso produttore... In questo caso dovrò tradurre manualmente tutto il file strings.xml...
Un'informazione, come mai molte parole presenti nell'app telefono non riesco a trovarle in strings.xml? Ci sono altri file da tradurre?
Grazie per le info!
Niente, ho passato 2 ore a tradurre il file strings per intero, ma non riesco a compilare!!!!!!!! Ma poi i warnings non dovrebbero dare errori...
Quote:
C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res\values-es\strings.xml:391: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res\values-es\strings.xml:392: error: Unexpected end tag string
C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res\values-es-rUS\strings.xml:169: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res\values-es-rUS\strings.xml:170: error: Unexpected end tag string
C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res\values-it\strings.xml:71: error: Error parsing XML: not well-formed (invalid token)
C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res\values-ru\strings.xml:387: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res\values-ru\strings.xml:388: error: Unexpected end tag string
aapt: warning: string 'g3_card_ip_prefix' has no default translation in C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res; found: zh_CN
aapt: warning: string 'g3_card_operator' has no default translation in C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res; found: zh_CN
aapt: warning: string 'ip_delete_message' has no default translation in C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res; found: zh_CN
aapt: warning: string 'ip_delete_title' has no default translation in C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res; found: zh_CN
aapt: warning: string 'ip_dialing_3G_prefix' has no default translation in C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res; found: zh_CN
aapt: warning: string 'ip_dialing_add_dialog_title' has no default translation in C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res; found: zh_CN
aapt: warning: string 'ip_dialing_add_menu_title' has no default translation in C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res; found: zh_CN
aapt: warning: string 'ip_dialing_edit_dialog_title' has no default translation in C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res; found: zh_CN
aapt: warning: string 'ip_dialing_empty' has no default translation in C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res; found: zh_CN
aapt: warning: string 'ip_dialing_number_empty' has no default translation in C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res; found: zh_CN
aapt: warning: string 'ip_dialing_number_prefix' has no default translation in C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res; found: zh_CN
aapt: warning: string 'mcc_mnc_title' has no default translation in C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res; found: zh_CN
aapt: warning: string 'preferred_network_mode_lte_cdma_summary' has no default translation in C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res; found: ar fr in ms th uk vi zh_CN
aapt: warning: string 'reject_mesg_empty' has no default translation in C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res; found: zh_CN
aapt: warning: string 'requesting_unlock' has no default translation in C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res; found: ar fr in ms th uk vi zh_CN
aapt: warning: string 'sid_nid_title' has no default translation in C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res; found: zh_CN
aapt: warning: string 'unlock_failed' has no default translation in C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res; found: ar fr in ms th uk vi zh_CN
aapt: warning: string 'unlock_success' has no default translation in C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res; found: ar fr in ms th uk vi zh_CN
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 16, --target-sdk-version, 16, -F, C:\Users\Romolo\AppData\Local\Temp\APKTOOL84037491 86927352518.tmp, -0, arsc, -I, C:\Users\Romolo\apktool\framework\1.apk, -S, C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res, -M, C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib .java:353)
at brut.androlib.Androlib.buildResources(Androlib.jav a:281)
at brut.androlib.Androlib.build(Androlib.java:209)
at brut.androlib.Androlib.build(Androlib.java:177)
at brut.apktool.Main.cmdBuild(Main.java:237)
at brut.apktool.Main.main(Main.java:79)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 16, --target-sdk-version, 16, -F, C:\Users\Romolo\AppData\Local\Temp\APKTOOL84037491 86927352518.tmp, -0, arsc, -I, C:\Users\Romolo\apktool\framework\1.apk, -S, C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res, -M, C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(An drolibResources.java:406)
at brut.androlib.Androlib.buildResourcesFull(Androlib .java:334)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 16, --target-sdk-version, 16, -F, C:\Users\Romolo\AppData\Local\Temp\APKTOOL84037491 86927352518.tmp, -0, arsc, -I, C:\Users\Romolo\apktool\framework\1.apk, -S, C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res, -M, C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:89)
at brut.androlib.res.AndrolibResources.aaptPackage(An drolibResources.java:404)
... 6 more
Impossibile trovare il file specificato.
Impossibile trovare il file specificato.
puoi postare l'xml che hai tradotto? sembra che tu abbia commesso degli errori di formattazione :)
in blu le cartelle dove sono contenuti i strings.xml dove devi guardare per gli errori e in rosso le linee nell'xmlcodice:C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res\values-es\strings.xml:391: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res\values-es\strings.xml:392: error: Unexpected end tag string
C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res\values-es-rUS\strings.xml:169: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res\values-es-rUS\strings.xml:170: error: Unexpected end tag string
C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res\values-it\strings.xml:71: error: Error parsing XML: not well-formed (invalid token)
C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res\values-ru\strings.xml:387: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
C:\Users\Romolo\Desktop\AndroidMultitool\Decompile d_apk\Phone\res\values-ru\strings.xml:388: error: Unexpected end tag string
Forse hai utilizzato formattazioni speciali come i %... basta aggiungere
<string name="esempio" formatted="false">esempio %s e %s</string>
Io ho risolto cosi una marea di volte... ;)
Solo la linea 71 in values-it ha un altro errore, posta la linea qua... ma non metterci il formatted :)
i warning ignorali, significa che non hai traduzioni in qualche altra lingua... non importa, risolti quei pochi errori ricompila di sicuro
Come ci fanno ad essere degli errori nelle traduzioni spagnole, russe ed americane che io non ho mai toccato??? Come sono state decompilate, cosi sono rimaste...
EDIT: ecco il file strings.xml
https://www.dropbox.com/s/o60ky8jacw27nua/strings.rar