[UTIL][JAN 20, 2024] Apktool - Tool for reverse engineering apk files

Search This thread

hossein_sys

Member
May 31, 2010
18
1
Iran/Tehran
Really?

Open both the original and modified apks with 7-Zip and compare the compressed size of the files you've moved.

I take the Screenshot as you say from 7zip
27FB73CC-DDE2-4B95-A02E-39EB3C6D5D5C.jpeg
 

Spannaa

Recognized Contributor / Themer
Sep 13, 2010
7,431
16,793
Cardiff
Huawei Nexus 6P
Google Pixel 6
I just copy the resources.arsc File from moded systemui to original with 7zip.
i think this problem for 7zip, can I use another app like winrar?
You can use any zip app you like, but don't compress resources.arsc (or any pngs) when you copy them - use compression level: store for these files.

This isn't an apktool issue though, so this is the wrong place for your question.
 

thereassaad

Inactive Recognized Contributor
Aug 22, 2013
7,618
9,710
Bierut
You can use any zip app you like, but don't compress resources.arsc (or any pngs) when you copy them - use compression level: store for these files.

This isn't an apktool issue though, so this is the wrong place for your question.

I do this way in oreo & pie now

Decompile your systemui.apk then recompile it again , now open decompiled systemui.apk with winrar & extract res / resources.arsc & classes , now again open stock systemui.apk & drag & drop the res folder & resources.arsc & classes to stock sysui with winrar store compresses way & u can u push it system/prev-app/systemui / or even u can tested in clean install to be sure everything is working fine , now u can decompile ur new systemui.apk & do ur edited anywhere there then drag & drop ur edited xml or resources.arsc or classes to ur new sysui & everything is will work just fine , this way i use it to be sure everything is work & also u can do this way with any apk that u gonna edited ..


Edit 1 = this way will fix all the issues that will happen in clean install roms , edited ur fram-res.apk , in normal way it will give u fc with direct lock or fingerprint issues, by this way no more any fc or issues with any apk edited like fram-res.apk or secsetting or systemui.apk ...
 
Last edited:
I do this way in oreo & pie now

Decompile your systemui.apk then recompile it again , now open decompiled systemui.apk with winrar & extract res / resources.arsc & classes , now again open stock systemui.apk & drag & drop the res folder & resources.arsc & classes to stock sysui with winrar store compresses way & u can u push it system/prev-app/systemui / or even u can tested in clean install to be sure everything is working fine , now u can decompile ur new systemui.apk & do ur edited anywhere there then drag & drop ur edited xml or resources.arsc or classes to ur new sysui & everything is will work just fine , this way i use it to be sure everything is work & also u can do this way with any apk that u gonna edited ..


Edit 1 = this way will fix all the issues that will happen in clean install roms , edited ur fram-res.apk , in normal way it will give u fc with direct lock or fingerprint issues, by this way no more any fc or issues with any apk edited like fram-res.apk or secsetting or systemui.apk ...

Use the build folder files not ones in the build apk. You are moving compressed files to compressed. Not a great idea.
 

thereassaad

Inactive Recognized Contributor
Aug 22, 2013
7,618
9,710
Bierut
Use the build folder files not ones in the build apk. You are moving compressed files to compressed. Not a that great idea.
For Samsung TouchWiz it's the best , as no any other workaround founded to fix no sysui in a clean install or fc in direct lock when u decompile recompile fram-res.apk or fp fc when u do decompile recompile SecSetting.apk , only by this way it's fixed whole issues for me on TW oreo & pie ..
 
For Samsung TouchWiz it's the best , as no any other workaround founded to fix no sysui in a clean install or fc in direct lock when u decompile recompile fram-res.apk or fp fc when u do decompile recompile SecSetting.apk , only by this way it's fixed whole issues for me on TW oreo & pie ..

Well I wouldn't worry about the size of the build as much as finding why it's not working. The size isn't the issue. But since your method isn't working you could try using the build folder. Don't drop entire res just drop any files you edited inside. I've themed Samsung many times and never had to do anything like you said.
 
  • Like
Reactions: Thebear j koss

hossein_sys

Member
May 31, 2010
18
1
Iran/Tehran
Well I wouldn't worry about the size of the build as much as finding why it's not working. The size isn't the issue. But since your method isn't working you could try using the build folder. Don't drop entire res just drop any files you edited inside. I've themed Samsung many times and never had to do anything like you said.

When I use the normal way of using the sysui apk was in the build folder, my status bar was lost.
As I put the meta, manifest for sign and permissions, I don't know why this issue shown?
 
When I use the normal way of using the sysui apk was in the build folder, my status bar was lost.
As I put the meta, manifest for sign and permissions, I don't know why this issue shown?

You don't need to move meta or manifest.

Take only edited files from build folder "the layouts only" if you only edited status bar layout only take it and drop it into untouched systemui apk. Do nothing else to it but place on your system just like that.
 
  • Like
Reactions: Thebear j koss

Carotix

Recognized Themer
Jul 20, 2012
9,154
36,857
Ravenna
hi all ,
i'm working on s8+ with beta Pie ...
i can decompile/recompile every app , sysui included ... but i can't recompile the framework-res.apk .... i tried different apktool versions but no match.
can someone help me?
thanks in advance

log
 
Last edited:

thereassaad

Inactive Recognized Contributor
Aug 22, 2013
7,618
9,710
Bierut
Fram-res.apk it's need old versions of apktool ( the version it's not in my mind right now ) & u need to delete some duplicates lines in style.xml & that's it ..
 
  • Like
Reactions: Carotix

Carotix

Recognized Themer
Jul 20, 2012
9,154
36,857
Ravenna
Fram-res.apk it's need old versions of apktool ( the version it's not in my mind right now ) & u need to delete some duplicates lines in style.xml & that's it ..
thanks my friend ,
i already tried 2.2.2 version and i deleted the duplicated lines but doesn't help :( .. there are other problems after ...
do you know which version of apktool i can use?
 
Last edited:

Azazel6002

Member
Jan 29, 2019
22
3
Trying compile systemui.apk getting this error

Exception in thread "main" org.jf.util.ExceptionWithContext: Exception occurred while writing code_item for method Landroid/support/graphics/drawable/AnimatedVectorDrawableCompat;->inflate(Landroid/content/res/Resources;Lorg/xmlpull/v1/XmlPullParser;Landroid/util/AttributeSet;Landroid/content/res/Resources$Theme;)V
at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:825)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:268)
at org.jf.dexlib2.writer.DexWriter.writeTo(DexWriter.java:246)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:61)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:36)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:419)
at brut.androlib.Androlib.buildSources(Androlib.java:350)
at brut.androlib.Androlib.build(Androlib.java:302)
at brut.androlib.Androlib.build(Androlib.java:269)
at brut.apktool.Main.cmdBuild(Main.java:238)
at brut.apktool.Main.main(Main.java:76)
Caused by: org.jf.util.ExceptionWithContext: Error while writing instruction at code offset 0x60
at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1098)
at org.jf.dexlib2.writer.DexWriter.writeDebugAndCodeItems(DexWriter.java:821)
... 10 more
Caused by: org.jf.util.ExceptionWithContext: Unsigned short value out of range: 65537
at org.jf.dexlib2.writer.DexDataWriter.writeUshort(DexDataWriter.java:116)
at org.jf.dexlib2.writer.InstructionWriter.write(InstructionWriter.java:348)
at org.jf.dexlib2.writer.DexWriter.writeCodeItem(DexWriter.java:1058)
... 11 more

How do I fix this?
 

bovirus

Senior Member
Oct 7, 2007
2,154
795
@iBotPeaches

My OS is Windows 7 64bit and Java JDK is 1.8.0 build 202.

I tried to compile apktool downloading the code from github, but after some of the latest updates I got several errors during test.

52 tests passed 12 tests with error.

If I compiled using the same github code under Linux (VMWare machine) is working fine.

Thanks.
 

Attachments

  • apktool-windows-error-log.txt
    45.7 KB · Views: 69
Last edited:

Phone_Guru

Senior Member
Jul 11, 2010
1,281
653
Jerusalem
@iBotPeaches

My OS is Windows 7 64bit and Java JDK is 1.8.0 build 202.

I tried to compile apktool downloading the code from github, but after some of the latest updates I got several errors during test.

52 tests passed 12 tests with error.

If I compiled using the same github code under Linux (VMWare machine) is working fine.

Thanks.
It's a known issue with building in windows at the moment. Could you send me the latest compiled version? I don't have a Linux setup.
 

a.raul

Senior Member
Apr 21, 2014
375
510
Mordor
thanks my friend ,
i already tried 2.2.2 version and i deleted the duplicated lines but doesn't help :( .. there are other problems after ...
do you know which version of apktool i can use?

Good afternoon, I leave the styles.xml of origin and the modified eliminating the lines to be able to compile the framewor-res.apk in Samsung Beta Pie, decompiled and compiled with apktool 2.3.4

Regards
 

Attachments

  • styles_mod.xml
    597.4 KB · Views: 47
  • styles_origen.xml
    598 KB · Views: 22

Lanchon

Senior Member
Jun 19, 2011
2,751
4,487
Trying compile systemui.apk getting this error

Exception in thread "main" org.jf.util.ExceptionWithContext: Exception occurred while writing code_item for method [...]

How do I fix this?

i suggest you download the latest smali from JesusFreke's github, and try baksmali then smali your systemui.apk. it should reproduce the bug i guess. then try to repro using a single 'classes(#).dex' file from within systemui.apk (android APKs are zip files you can open with any zip tool). then create an issue in github with all the relevant data needed to repro (including the dex file, where the systemui.apk came from, etc), JF is very busy these days, but he'll look into well-reported bugs from time to time.
 
Last edited:

Top Liked Posts