Auto APKTool 3.0.1 Probleme mit framework-res.apk

A

Andreas W.

Neues Mitglied
0
moin,
ich wollte gerade mal die qip apk ins deutsche versetzen. Dazu habe ich schon die ganze xml übersetzt. klick mich!
Jetzh hab ich mir Auto APKTool 3.0.1 installiert und genau nach dieser Anleitung (EXAMPLE 2: XML BINARY WHEN YOU DO DIRECT EDITS) vorgegangen:


HTML:
USAGE:
Run AutoAPKToolMain.bat

QUICK HOW TO:
THE 1-2-3-4 + 5 PROCESS
- Place ALL apks to decompile in _INPUT_APK folder
- Place the framework-res apk in the _INPUT_APK as well (filename: framework-res.apk)

- Choose 1 then hit enter for if framework-res.apk command
(note that framework-res.apk will always be in the _INPUT_APK folder)

- Choose 2 to decompile all in one shot
(this will create the resources and sources folder inside _INPUT_APK folder)
- Do your edits for all in that folder, add your values-en, values-pt, raw-en, etc.
You may add drawable-en-hdpi as well
Edit your strings.xml and many more...
Remember to keep the folder structure intact
After all edits are done

- Choose 3 and hit enter
This will recompile all in one shot
A notepad will appear to show if there are errors in recompiling, check the log
Adjust if necessary, you can choose to recompile a single folder if you need to

- Choose 4 to build usable APKs
All apks will be in the _OUT_APK folder (These will not FC)
All overwriting of files are automated
These APKs are from the Original apk with:
resource.arsc + classes.dex changed + other resources added

-Choose 5 (the fun part, lol)
It will build your flashable zip signed already, there's a template in the _FLASHABLES folder
You may edit it, replace it with the same name, just keep templates by renaming, place your build.prop there, etc
Read the text file thoroughly...

So that is the short story....
For other options and features read the ReadMeHistory.txt
FYI, read notes below (in _OUT_APKTOOL_DIST folder, those are build by APK Tool)
I manage to build APKs that don't FC in the _OUT_APKTOOL_DIST only that...... (see txt for complete explanation)

EXAMPLE 1: IMAGE
If you are overwriting an image in an APK (widget_1x.png)
_CUSTOM_RES
-MiuiMusic
--res
---drawable-hdpi
----widget_1x.png (this is the image i will overwrite)
        
Otherwise if you are adding folders no need to turn on "overwrite resources), put all your files in:
_INPUT_APK
-MiuiMusic
--res
---drawable-de-hdpi (this is the image folder i added)
----widget_1x.png
The Copy added resources "ON" will take care of copying these added resources or files

SOME EXAMPLES OF IMAGES AND FILES OVERRIDING:
"_CUSTOM_RES\AppShare\res\drawable-hdpi\installed.png"
"_CUSTOM_RES\Gallery\res\menu\media_context_menu.x  ml"
"_CUSTOM_RES\ThemeManager\res\drawable-hdpi\desktop_mask.png"

EXAMPLE 2: XML BINARY WHEN YOU DO DIRECT EDITS
Say you are editing a file straight from framework-res\res\drawable\progress_horizontal.xml
FOR NOW YOU HAVE TO DO THIS:
1) After doing [3], recompiling the apk

2) Copy the file _INPUT_APK\framework-res\build\apk\res\drawable\progress_horizontal.xml
to 
_CUSTOM_RES\framework-res\res\drawable\progress_horizontal.xml 
(this is the binary of your edited file, by doing this, you are telling the tool to overwrite it when building the apk)

3) Once this is done, make sure that "Overwrite res using _CUSTOM_RES" is ON, it is ON by default

4) then do build usable, It should overwrite those binaries in the APK


Hier meine Vorgehensweise:

In der Anleitung steht man soll die framework-res.apk ins _INPUT_APK Verzeichnis mit reinkopieren, also habe ich mit den MyPhoneExplorer
die Datein von meinem HTC ONE S mit rüberkopiert.

Also jetzt liegt die App und die framework-res.apk im selben Verzeichnis.
Nun starte ich AutoAPKToolMain.bat und Drücke die 1 und er installiert das
framework file. Mit der 2 Decompile ich nun beide Dateien.



[*] _INPUT_APK\framework-res.apk
decompiling _INPUT_APK\framework-res.apk...
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x0104032f string/web_user_agent_target_content, config=[DEFAULT]
at brut.androlib.res.data.ResConfig.addResource(Unknown Source)
at brut.androlib.res.data.ResConfig.addResource(Unknown Source)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(Unknown Source)
at brut.androlib.res.decoder.ARSCDecoder.readConfig(Unknown Source)
at brut.androlib.res.decoder.ARSCDecoder.readType(Unknown Source)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(Unknown Source)
at brut.androlib.res.decoder.ARSCDecoder.readTable(Unknown Source)
at brut.androlib.res.decoder.ARSCDecoder.decode(Unknown Source)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(Unknown Source)
at brut.androlib.res.AndrolibResources.loadMainPkg(Unknown Source)
at brut.androlib.res.AndrolibResources.getResTable(Unknown Source)
at brut.androlib.Androlib.getResTable(Unknown Source)
at brut.androlib.ApkDecoder.getResTable(Unknown Source)
at brut.androlib.ApkDecoder.decode(Unknown Source)
at brut.apktool.Main.cmdDecode(Unknown Source)
at brut.apktool.Main.main(Unknown Source)
[*] _INPUT_APK\qip.apk
decompiling _INPUT_APK\qip.apk...
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\Stahl\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs...

Aber komischerweise bleibt der framework-res Ordner leer.

Wenn ich nach meiner Bearbeitung bzw den Austausch meiner strings.xml wieder Recompile machen möchte, bekommen ich folgenden Log was ja klar ist wenn der Ordner leer war:


[*] framework-res folder
recompiling framework-res.apk...
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathNotExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.apktool.Main.cmdBuild(Unknown Source)
at brut.apktool.Main.main(Unknown Source)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(Unknown Source)
... 5 more
Unable to open '_INPUT_APK\framework-res\dist\framework-res.apk' as zip archive
java.io.FileNotFoundException: D:\TOOLS\Auto APKTool 3.0.1\_OUT_APKTOOL_DIST_ZIPALIGN\001.002.003.apk (Das System kann die angegebene Datei nicht finden)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at com.android.signapk.SignApk.main(SignApk.java:320)
D:\TOOLS\Auto APKTool 3.0.1\_OUT_APKTOOL_DIST_ZIPALIGN\001.002.003.apk konnte nicht gefunden werden
[*] qip folder
recompiling qip.apk...
I: Smaling...
I: Building resources...
I: Building apk file...
java.io.FileNotFoundException: D:\TOOLS\Auto APKTool 3.0.1\_OUT_APKTOOL_DIST_ZIPALIGN\001.002.003.apk (Das System kann die angegebene Datei nicht finden)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at com.android.signapk.SignApk.main(SignApk.java:320)
D:\TOOLS\Auto APKTool 3.0.1\_OUT_APKTOOL_DIST_ZIPALIGN\001.002.003.apk konnte nicht gefunden werden

Meine Fragen jetzt: Warum läßt sich die framework-res.apk nicht decompilieren sondern nur entzippen, obwohl die Schreibrechte auf
Vollzugriff stehen. Oder geht es nicht weil mein Handy nicht "gerooted"
ist es letzendlich sogar der falsche File ???

Laut Beispiel im Text...


Say you are editing a file straight from framework-res\res\drawable\progress_horizontal.xml
FOR NOW YOU HAVE TO DO THIS:
1) After doing [3], recompiling the apk

2) Copy the file _INPUT_APK\framework-res\build\apk\res\drawable\progress_horizontal.xml
to
_CUSTOM_RES\framework-res\res\drawable\progress_horizontal.xml
(this is the binary of your edited file, by doing this, you are telling the tool to overwrite it when building the apk

...befindest sich bei mir auch kein \build\apk\... Verzeichnis!?

Wer kann mir weiterhelfen das ich die App richtig Decompiliere, Compiliere und Signiere damit ich sie richtig
installieren kann. Bin für jede Hilfe dankbar
 
Zuletzt bearbeitet:
Problem gelöst mit dieser Anleitung: klick mich!
Hier das fertige Ergebnis: klick mich!

P.S
Thread kann geschlossen werden.
 

Ähnliche Themen

J
Antworten
4
Aufrufe
2.137
maaR
M
L
  • luschi87
Antworten
0
Aufrufe
2.175
luschi87
L
E
  • escud80
Antworten
4
Aufrufe
1.046
escud80
E
Zurück
Oben Unten