Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] NullPointerException #2669

Closed
Inchworm333 opened this issue Oct 3, 2021 · 5 comments
Closed

[BUG] NullPointerException #2669

Inchworm333 opened this issue Oct 3, 2021 · 5 comments

Comments

@Inchworm333
Copy link

Information

  1. Apktool Version (apktool -version) - 2.6.0
  2. Operating System (Mac, Linux, Windows) - Linux (Debian 11)
  3. APK From? (Playstore, ROM, Other) - Playstore

Stacktrace/Logcat

I: Using Apktool 2.6.0 on TP-Link Tether_3.4.28_apk-dl.com.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
W: Could not decode attr value, using undecoded value instead: ns=android, name=versionCode, value=0x000000ac
W: Could not decode attr value, using undecoded value instead: ns=android, name=versionName, value=0x00000030
W: Could not decode attr value, using undecoded value instead: ns=android, name=versionCode, value=0x000000ac
W: Could not decode attr value, using undecoded value instead: ns=android, name=versionName, value=0x00000030
W: Could not decode attr value, using undecoded value instead: ns=android, name=installLocation, value=0x00000000
W: Could not decode attr value, using undecoded value instead: ns=android, name=compileSdkVersion, value=0x0000001d
W: Could not decode attr value, using undecoded value instead: ns=android, name=compileSdkVersionCodename, value=0x0000002e
W: Could not decode attr value, using undecoded value instead: ns=android, name=minSdkVersion, value=0x00000013
W: Could not decode attr value, using undecoded value instead: ns=android, name=targetSdkVersion, value=0x0000001d
W: Could not decode attr value, using undecoded value instead: ns=android, name=name, value=0x0000004f
W: Could not decode attr value, using undecoded value instead: ns=android, name=maxSdkVersion, value=0x0000001c
W: Could not decode attr value, using undecoded value instead: ns=android, name=name, value=0x0000004d
W: Could not decode attr value, using undecoded value instead: ns=android, name=maxSdkVersion, value=0x0000001c
W: Could not decode attr value, using undecoded value instead: ns=android, name=name, value=0x0000004c
W: Could not decode attr value, using undecoded value instead: ns=android, name=name, value=0x00000043
W: Could not decode attr value, using undecoded value instead: ns=android, name=name, value=0x00000042
W: Could not decode attr value, using undecoded value instead: ns=android, name=name, value=0x00000049
W: Could not decode attr value, using undecoded value instead: ns=android, name=name, value=0x0000004b
W: Could not decode attr value, using undecoded value instead: ns=android, name=name, value=0x0000004e
W: Could not decode attr value, using undecoded value instead: ns=android, name=name, value=0x00000048
W: Could not decode attr value, using undecoded value instead: ns=android, name=name, value=0x00000045
W: Could not decode attr value, using undecoded value instead: ns=android, name=name, value=0x00000046
W: Could not decode attr value, using undecoded value instead: ns=android, name=name, value=0x0000005b
W: Could not decode attr value, using undecoded value instead: ns=android, name=name, value=0x0000003a
W: Could not decode attr value, using undecoded value instead: ns=android, name=required, value=0xffffffff
W: Could not decode attr value, using undecoded value instead: ns=android, name=name, value=0x00000040
W: Could not decode attr value, using undecoded value instead: ns=android, name=name, value=0x00000041
W: Could not decode attr value, using undecoded value instead: ns=android, name=name, value=0x00000183
W: Could not decode attr value, using undecoded value instead: ns=android, name=value, value=0x00000036
Exception in thread "main" java.lang.NullPointerException
	at java.base/java.util.regex.Matcher.getTextLength(Matcher.java:1770)
	at java.base/java.util.regex.Matcher.reset(Matcher.java:416)
	at java.base/java.util.regex.Matcher.<init>(Matcher.java:253)
	at java.base/java.util.regex.Pattern.matcher(Pattern.java:1133)
	at brut.androlib.res.decoder.AndroidManifestResourceParser.isNumericStringMetadataAttributeValue(AndroidManifestResourceParser.java:56)
	at brut.androlib.res.decoder.AndroidManifestResourceParser.getAttributeValue(AndroidManifestResourceParser.java:41)
	at org.xmlpull.v1.wrapper.classic.XmlPullParserDelegate.getAttributeValue(XmlPullParserDelegate.java:69)
	at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.writeStartTag(StaticXmlSerializerWrapper.java:267)
	at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.event(StaticXmlSerializerWrapper.java:211)
	at brut.androlib.res.decoder.XmlPullStreamDecoder$1.event(XmlPullStreamDecoder.java:80)
	at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(XmlPullStreamDecoder.java:139)
	at brut.androlib.res.decoder.XmlPullStreamDecoder.decodeManifest(XmlPullStreamDecoder.java:151)
	at brut.androlib.res.decoder.ResFileDecoder.decodeManifest(ResFileDecoder.java:159)
	at brut.androlib.res.AndrolibResources.decodeManifestWithResources(AndrolibResources.java:193)
	at brut.androlib.Androlib.decodeManifestWithResources(Androlib.java:140)
	at brut.androlib.ApkDecoder.decode(ApkDecoder.java:109)
	at brut.apktool.Main.cmdDecode(Main.java:175)
	at brut.apktool.Main.main(Main.java:78)

Steps to Reproduce

  1. apktool d TP-Link\ Tether_3.4.28_apk-dl.com.apk

Frameworks

If this APK is from an OEM ROM (Samsung, HTC, LG). Please attach framework files
(.apks that live in /system/framework or /system/priv-app)
N/A

APK

If this APK can be freely shared, please upload/attach a link to it.

TpLink Teather

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything?
  2. If you are trying to install a modified apk, did you resign it?
  3. Are you using the latest apktool version?
@iBotPeaches
Copy link
Owner

Well that was the most unpleasant site of ads/shit to see at 6 in the morning. I have the application and confirm the issue.

@Inchworm333
Copy link
Author

Oof yeah, I would have never used it if it weren't for uBlock Origin

@pashamcr
Copy link
Contributor

pashamcr commented Oct 8, 2021

I do not confirm

❯ hostnamectl

  Operating System: Debian GNU/Linux bookworm/sid
            Kernel: Linux 5.14.0-1-amd64
      Architecture: x86-64

❯ java -jar apktool_2.6.0.jar d Tether_3.4.28_apk-dl.com.apk
I: Using Apktool 2.6.0 on Tether_3.4.28_apk-dl.com.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /home/pasha/.local/share/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Baksmaling classes2.dex...
I: Baksmaling classes3.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
I: Copying META-INF/services directory

❯ java -jar apktool_2.6.0.jar b Tether_3.4.28_apk-dl.com
I: Using Apktool 2.6.0
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes2 folder into classes2.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes3 folder into classes3.dex...
I: Checking whether resources has changed...
I: Building resources...
I: Copying libs... (/lib)
I: Copying libs... (/kotlin)
I: Copying libs... (/META-INF/services)
I: Building apk file...
I: Copying unknown files/dir...
I: Built apk...

@pokonski
Copy link

pokonski commented Nov 11, 2021

I had the same issue but turned out that after removing apktool installed from apt it left a broken symlink in ~/.local/share/apktool/framework/1.apk`, removing that symlink fixed it for me.

@iBotPeaches
Copy link
Owner

Looks like I forgot about this issue. Apologies. It was fixed here: #2889 after this issue came in: #2878

So closing as resolved.

➜  2669 apktool d 2669.apk 
I: Using Apktool 2.8.1-c744dd-SNAPSHOT on 2669.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /home/ibotpeaches/.local/share/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Baksmaling classes2.dex...
I: Baksmaling classes3.dex...
I: Baksmaling classes4.dex...
I: Baksmaling classes5.dex...
I: Baksmaling classes6.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
I: Copying META-INF/services directory
➜  2669 

dtki7 added a commit to dtki7/apkhack that referenced this issue Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants