iBotPeaches / Apktool

A tool for reverse engineering Android apk files
https://apktool.org/
Apache License 2.0
19.79k stars 3.56k forks source link

hi, i have this error~, i've downloads last version 2.7.0, but the output text the version v2.6.0.. what can i do ?? #3082

Closed msb2couled closed 1 year ago

msb2couled commented 1 year ago

Checking Dependencies

[-] Java-Version 1.8 or greater is Installed. [-] aapt is Installed. [-] android-framework-res is Installed. [-] libantlr3-runtime-java is Installed. [-] libcommons-cli-java is Installed. [-] libcommons-io-java is Installed. [-] libcommons-lang3-java is Installed. [-] libcommons-text-java is Installed. [-] libguava-java is Installed. [-] libsmali-java is Installed. [-] libstringtemplate-java is Installed. [-] libxmlunit-java is Installed. [-] libxpp3-java is Installed. [-] libyaml-snake-java is Installed.

[-] Checking the version of Apktool you have installed.

Apktool is the Correct version

apktool

Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true Apktool v2.6.0 - a tool for reengineering Android apk files with smali v2.5.2 and baksmali v2.5.2

Anonymous2716 commented 1 year ago

Re-download :

  1. Direct link : https://github.com/iBotPeaches/Apktool/releases/download/v2.7.0/apktool_2.7.0.jar

  2. https://github.com/iBotPeaches/Apktool/releases

iBotPeaches commented 1 year ago

As mentioned above. Apktool wouldn't report itself as 2.6.0 if its 2.7.0 - I think you should redownload.

➜  Desktop java -jar apktool_2.7.0.jar --version
2.7.0
➜  Desktop java -jar apktool_2.7.0.jar          
Apktool v2.7.0 - a tool for reengineering Android apk files
with smali v2.5.2-403e9037 and baksmali v2.5.2-403e9037

Closing.

msb2couled commented 1 year ago

I've write (sudo apt-get remove --auto-remove apktool ), and I've downloads it but output text same thing (apktool Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true Apktool "v2.6.0 - a" tool for reengineering Android apk files)..... please help me ):

Anonymous2716 commented 1 year ago

@msb2couled the ones you are getting from your distros repository can be few versions behind.. That's why you need to download from here and use it like that. As @iBotPeaches showed.

java -jar apktool_2.7.0.jar d app.apk
msb2couled commented 1 year ago

As mentioned above. Apktool wouldn't report itself as 2.6.0 if its 2.7.0 - I think you should redownload.

➜  Desktop java -jar apktool_2.7.0.jar --version
2.7.0
➜  Desktop java -jar apktool_2.7.0.jar          
Apktool v2.7.0 - a tool for reengineering Android apk files
with smali v2.5.2-403e9037 and baksmali v2.5.2-403e9037

Closing.

As mentioned above. Apktool wouldn't report itself as 2.6.0 if its 2.7.0 - I think you should redownload.

➜  Desktop java -jar apktool_2.7.0.jar --version
2.7.0
➜  Desktop java -jar apktool_2.7.0.jar          
Apktool v2.7.0 - a tool for reengineering Android apk files
with smali v2.5.2-403e9037 and baksmali v2.5.2-403e9037

Closing.

root@root:/usr/local/bin# java -jar apktool.jar --version
2.7.0 root@root:/usr/local/bin# apktool Apktool v2.6.0 - a tool for reengineering Android apk files with smali v2.5.2 and baksmali v2.5.2

didn't work

Anonymous2716 commented 1 year ago

Yes that's what I'm saying. Replace the command apktool with java -jar apktool.jar everything else stays the same.

The one you are writing apktool is from your distros repository . and installeinstalled in your OS. Don't use that.

Use this : root@root:/usr/local/bin# java -jar apktool.jar not the other one.

msb2couled commented 1 year ago

java -jar apktool.jar b Snapchat
I: Using Apktool 2.7.0 Exception in thread "main" Cannot create property=compressionType for JavaBean=brut.androlib.meta.MetaInfo@57829d67 in 'reader', line 1, column 1: !!brut.androlib.meta.MetaInfo ^ Can not set boolean field brut.androlib.meta.MetaInfo.compressionType to null value in 'reader', line 3, column 18: compressionType: fales ^

    at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:288)
    at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.construct(Constructor.java:174)
    at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:325)
    at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:235)
    at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:224)
    at org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:178)
    at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:162)
    at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:477)
    at org.yaml.snakeyaml.Yaml.loadAs(Yaml.java:470)
    at brut.androlib.meta.MetaInfo.load(MetaInfo.java:70)
    at brut.androlib.Androlib.readMetaFile(Androlib.java:280)
    at brut.androlib.Androlib.build(Androlib.java:294)
    at brut.androlib.Androlib.build(Androlib.java:287)
    at brut.apktool.Main.cmdBuild(Main.java:263)
    at brut.apktool.Main.main(Main.java:82)

Caused by: java.lang.IllegalArgumentException: Can not set boolean field brut.androlib.meta.MetaInfo.compressionType to null value at java.base/jdk.internal.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) at java.base/jdk.internal.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) at java.base/jdk.internal.reflect.UnsafeBooleanFieldAccessorImpl.set(UnsafeBooleanFieldAccessorImpl.java:80) at java.base/java.lang.reflect.Field.set(Field.java:799) at org.yaml.snakeyaml.introspector.FieldProperty.set(FieldProperty.java:41) at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:281) ... 14 more

what is this sir?

Anonymous2716 commented 1 year ago

@iBotPeaches can help you on this.

iBotPeaches commented 1 year ago

Redecode application with proper version and rebuild again. apktool.yaml looks like it was generated oddly and 2.7.0 doesn't like it.

msb2couled commented 1 year ago

Redecode application with proper version and rebuild again. apktool.yaml looks like it was generated oddly and 2.7.0 doesn't like it.


what is the is proper version , are you mean i should download the application from other website ?

Anonymous2716 commented 1 year ago

@msb2couled he means redecode the apk with apktool 2.7.0

msb2couled commented 1 year ago

@msb2couled he means redecode the apk with apktool 2.7.0

could you please write command, or more explain clear

Anonymous2716 commented 1 year ago
java -jar apktool.jar d yourapp.apk -o decodedapk

Replace yourapp.apk with the actual name of the apk.

msb2couled commented 1 year ago
java -jar apktool.jar d yourapp.apk -o decodedapk

no sir , I'want going to build it .

msb2couled commented 1 year ago
java -jar apktool.jar d yourapp.apk -o decodedapk

Replace yourapp.apk with the actual name of the apk.

I: Using Apktool 2.7.0 on Snapchat.apk I: Loading resource table... I: Decoding AndroidManifest.xml with resources... I: Loading resource table from file: /root/.local/share/apktool/framework/1.apk I: Regular manifest package... I: Decoding file-resources... W: Cant find 9patch chunk in file: "drawable-xxhdpi-v4/common_google_signin_btn_icon_light_normal_background.9.png". Renaming it to .png. W: Cant find 9patch chunk in file: "drawable-hdpi-v4/notification_bg_normal_pressed.9.png". Renaming it to .png. W: Cant find 9patch chunk in file: "drawable-xxhdpi-v4/map_tooltip_bottom_left.9.png". Renaming it to .png. W: Cant find 9patch chunk in file: "drawable-mdpi-v4/common_google_signin_btn_text_light_normal_background.9.png". Renaming it to .png. W: Cant find 9patch chunk in file: "drawable-mdpi-v4/holo_textfield_blue.9.png". Renaming it to .png. W: Cant find 9patch chunk in file: "drawable-mdpi-v4/common_google_signin_btn_icon_light_normal_background.9.png". Renaming it to .png. W: Cant find 9patch chunk in file: "drawable-hdpi-v4/holo_textfield_blue.9.png". Renaming it to .png. W: Cant find 9patch chunk in file: "drawable-xhdpi-v4/notification_bg_low_pressed.9.png". Renaming it to .png. W: Cant find 9patch chunk in file: "drawable-hdpi-v4/map_tooltip_bottom_right.9.png". Renaming it to .png. W: Cant find 9patch chunk in file: "drawable-hdpi-v4/place_label.9.png". Renaming it to .png. W: Cant find 9patch chunk in file: "drawable-xxxhdpi-v4/garfield_callout_bottom.9.png". Renaming it to .png. W: Cant find 9patch chunk in file: "drawable-mdpi-v4/holo_textfield_blue_disabled.9.png". Renaming it to .png. W: Cant find 9patch chunk in file: "drawable-mdpi-v4/map_tooltip_bottom_right.9.png". Renaming it to .png. W: Cant find 9patch chunk in file: "drawable-xxxhdpi-v4/map_tooltip_bottom_left.9.png". Renaming it to .png. W: Cant find 9patch chunk in file: "drawable-xhdpi-v4/map_tooltip_bottom_right.9.png". Renaming it to .png. W: Cant find 9patch chunk in file: "drawable-xhdpi-v4/holo_textfield_blue.9.png". Renaming it to .png. W: Cant find 9patch chunk in file: "drawable-hdpi-v4/notification_bg_low_pressed.9.png". Renaming it to .png. W: Cant find 9patch chunk in file: "drawable-mdpi-v4/notification_bg_low_pressed.9.png". Renaming it to .png. W: Cant find 9patch chunk in file: "drawable-xxhdpi-v4/common_google_signin_btn_text_light_normal_background.9.png". Renaming it to .png. W: Cant find 9patch chunk in file: "drawable-xxxhdpi-v4/map_tooltip_bottom_right.9.png". Renaming it to .png. W: Cant find 9patch chunk in file: "drawable-mdpi-v4/place_label.9.png". Renaming it to *.png. W: Cant find 9patch ch

Anonymous2716 commented 1 year ago

@msb2couled if you want to rebuild then use the apktool command. Right now.

This issue you are having bcs you decoded with the v2.6.0 that's why you cannot recode it with the v2.7.0.

In order to use it properly you have to decode and recode with the latest version.(with the same version of apktool).

msb2couled commented 1 year ago

sir I had decoded with command (java -jar apktool.jar myapp.apk) but I try build it again like you tell me (apktool b myapp.apk), But this is output text show : apktool b Snapchat
I: Using Apktool 2.6.0 Exception in thread "main" Cannot create property=compressionType for JavaBean=brut.androlib.meta.MetaInfo@2f7c7260 in 'reader', line 1, column 1: !!brut.androlib.meta.MetaInfo ^ Can not set boolean field brut.androlib.meta.MetaInfo.compressionType to null value in 'reader', line 3, column 18: compressionType: fales ^

    at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:293)
    at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.construct(Constructor.java:172)
    at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:332)
    at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:231)
    at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:220)
    at org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:174)
    at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:158)
    at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:491)
    at org.yaml.snakeyaml.Yaml.loadAs(Yaml.java:484)
    at brut.androlib.meta.MetaInfo.load(MetaInfo.java:70)
    at brut.androlib.Androlib.readMetaFile(Androlib.java:269)
    at brut.androlib.Androlib.build(Androlib.java:283)
    at brut.androlib.Androlib.build(Androlib.java:276)
    at brut.apktool.Main.cmdBuild(Main.java:255)
    at brut.apktool.Main.main(Main.java:81)

Caused by: java.lang.IllegalArgumentException: Can not set boolean field brut.androlib.meta.MetaInfo.compressionType to null value at java.base/jdk.internal.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167) at java.base/jdk.internal.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171) at java.base/jdk.internal.reflect.UnsafeBooleanFieldAccessorImpl.set(UnsafeBooleanFieldAccessorImpl.java:80) at java.base/java.lang.reflect.Field.set(Field.java:799) at org.yaml.snakeyaml.introspector.FieldProperty.set(FieldProperty.java:44) at org.yaml.snakeyaml.constructor.Constructor$ConstructMapping.constructJavaBean2ndStep(Constructor.java:286) ... 14 more

Anonymous2716 commented 1 year ago

The dev can help you. On this from now on. I'm not sure what's wrong. Ask him please.

msb2couled commented 1 year ago

The dev can help you. On this from now on. I'm not sure what's wrong. Ask him please.

thank you very match, could you please mention him

Anonymous2716 commented 1 year ago

@msb2couled -> @iBotPeaches