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

java.lang.NullPointerException #513

Closed
iBotPeaches opened this Issue Mar 18, 2015 · 11 comments

Comments

Projects
None yet
2 participants
@iBotPeaches
Owner

iBotPeaches commented Mar 18, 2015

Original issue 402 created by jbruchanov on 2013-01-30T00:59:30.000Z:

What steps will reproduce the problem?

  1. apktool.bat d ....apk dir
    2.
    3.

What version of the product are you using? On what operating system?
Apktool v1.5.1


I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\aaa\apktool\framework\1.apk
I: Loaded.
W: Could not decode attr value, using undecoded value instead: ns=android, name=hardwareAccelerated, value=0x00000000
W: Could not decode attr value, using undecoded value instead: ns=android, name=previewImage, value=0x7f02008c
I: Regular manifest package...
I: Decoding file-resources...
W: Could not decode attr value, using undecoded value instead: ns=android, name=showAsAction, value=0x00000005
W: Could not decode attr value, using undecoded value instead: ns=android, name=fontFamily, value=0x00000028
Exception in thread "main" java.lang.NullPointerException
at java.io.Writer.write(Unknown Source)
at brut.androlib.res.util.ExtMXSerializer.writeAttributeValue(ExtMXSerializer.java:38)
at org.xmlpull.mxp1_serializer.MXSerializer.attribute(MXSerializer.java:673)
at org.xmlpull.v1.wrapper.classic.XmlSerializerDelegate.attribute(XmlSerializerDelegate.java:106)
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:130)
at brut.androlib.res.decoder.ResStreamDecoderContainer.decode(ResStreamDecoderContainer.java:34)
at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:102)
at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:86)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:236)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:115)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:99)
at brut.apktool.Main.cmdDecode(Main.java:141)
at brut.apktool.Main.main(Main.java:72)

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #1 originally posted by connor.tumbleson on 2013-01-30T01:14:52.000Z:

Looks like your missing a framework. See FrameworkFiles.

Also seems to be a bug, but won't know till you use proper frameworks.

Owner

iBotPeaches commented Mar 18, 2015

Comment #1 originally posted by connor.tumbleson on 2013-01-30T01:14:52.000Z:

Looks like your missing a framework. See FrameworkFiles.

Also seems to be a bug, but won't know till you use proper frameworks.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #2 originally posted by jbruchanov on 2013-01-30T01:16:52.000Z:

Different apks works fine, i just got partially result, not complete one.

Owner

iBotPeaches commented Mar 18, 2015

Comment #2 originally posted by jbruchanov on 2013-01-30T01:16:52.000Z:

Different apks works fine, i just got partially result, not complete one.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #3 originally posted by connor.tumbleson on 2013-02-02T18:34:27.000Z:

Attach all of it then. Can't fix it based on that.

Owner

iBotPeaches commented Mar 18, 2015

Comment #3 originally posted by connor.tumbleson on 2013-02-02T18:34:27.000Z:

Attach all of it then. Can't fix it based on that.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #4 originally posted by iBotPeaches on 2013-02-02T19:18:12.000Z:

Seems we solved this. Must be problem with J7 or something.

Owner

iBotPeaches commented Mar 18, 2015

Comment #4 originally posted by iBotPeaches on 2013-02-02T19:18:12.000Z:

Seems we solved this. Must be problem with J7 or something.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #5 originally posted by rodolfo.ueg on 2015-01-07T13:55:29.000Z:

I have come to a consistent way of reproducing this.

This bug will occur every time you try to run apktool as a system user (in unix systems, their home folders are set to /var/empty, which is owned by the root user). This wil cause the AndroidlibResources#getFrameworkDir() to fail because if relies on the System property "user.home" as a base directory, which won't be writable at that time.

Owner

iBotPeaches commented Mar 18, 2015

Comment #5 originally posted by rodolfo.ueg on 2015-01-07T13:55:29.000Z:

I have come to a consistent way of reproducing this.

This bug will occur every time you try to run apktool as a system user (in unix systems, their home folders are set to /var/empty, which is owned by the root user). This wil cause the AndroidlibResources#getFrameworkDir() to fail because if relies on the System property "user.home" as a base directory, which won't be writable at that time.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #6 originally posted by connor.tumbleson on 2015-01-07T13:57:44.000Z:

In that case, utilize the --frame-path parameter to select a directory on both build/decode on where frameworks should be stored.

Owner

iBotPeaches commented Mar 18, 2015

Comment #6 originally posted by connor.tumbleson on 2015-01-07T13:57:44.000Z:

In that case, utilize the --frame-path parameter to select a directory on both build/decode on where frameworks should be stored.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #7 originally posted by rodolfo.ueg on 2015-01-07T14:15:14.000Z:

@connor it's a valid point, however it's a bug that does not have a clear error message and thus should be better handled.

I have submitted a pull request where I propose a more elegant solution: #98

Owner

iBotPeaches commented Mar 18, 2015

Comment #7 originally posted by rodolfo.ueg on 2015-01-07T14:15:14.000Z:

@connor it's a valid point, however it's a bug that does not have a clear error message and thus should be better handled.

I have submitted a pull request where I propose a more elegant solution: #98

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #8 originally posted by connor.tumbleson on 2015-02-13T16:16:11.000Z:

Issue noticed in comment 5,6,7.

f089edd

Fixed.

Owner

iBotPeaches commented Mar 18, 2015

Comment #8 originally posted by connor.tumbleson on 2015-02-13T16:16:11.000Z:

Issue noticed in comment 5,6,7.

f089edd

Fixed.

@amir1111

This comment has been minimized.

Show comment
Hide comment
@amir1111

amir1111 May 20, 2015

maybe it's not fixed? found it still in this apk : http://www.filedropper.com/commojimjweather53202

amir1111 commented May 20, 2015

maybe it's not fixed? found it still in this apk : http://www.filedropper.com/commojimjweather53202

@amir1111

This comment has been minimized.

Show comment
Hide comment
@amir1111

amir1111 May 20, 2015

also this is the message i'm getting for the apk i uploaded:

W: Could not decode attr value, using undecoded value instead: ns=android, name=
qihoo, value=0x00000049
Exception in thread "main" java.lang.NullPointerException
at java.io.Writer.write(Unknown Source)
at brut.androlib.res.util.ExtMXSerializer.writeAttributeValue(ExtMXSeria
lizer.java:38)
at org.xmlpull.mxp1_serializer.MXSerializer.attribute(MXSerializer.java:
673)
at org.xmlpull.v1.wrapper.classic.XmlSerializerDelegate.attribute(XmlSer
ializerDelegate.java:106)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.writeStartT
ag(StaticXmlSerializerWrapper.java:267)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.event(Stati
cXmlSerializerWrapper.java:211)
at brut.androlib.res.decoder.XmlPullStreamDecoder$1.event(XmlPullStreamD
ecoder.java:83)
at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(XmlPullStreamDe
coder.java:141)
at brut.androlib.res.decoder.XmlPullStreamDecoder.decodeManifest(XmlPull
StreamDecoder.java:153)
at brut.androlib.res.decoder.ResFileDecoder.decodeManifest(ResFileDecode
r.java:134)
at brut.androlib.res.AndrolibResources.decodeManifestWithResources(Andro
libResources.java:199)
at brut.androlib.Androlib.decodeManifestWithResources(Androlib.java:139)

    at brut.androlib.ApkDecoder.decode(ApkDecoder.java:102)
    at brut.apktool.Main.cmdDecode(Main.java:165)
    at brut.apktool.Main.main(Main.java:81)

amir1111 commented May 20, 2015

also this is the message i'm getting for the apk i uploaded:

W: Could not decode attr value, using undecoded value instead: ns=android, name=
qihoo, value=0x00000049
Exception in thread "main" java.lang.NullPointerException
at java.io.Writer.write(Unknown Source)
at brut.androlib.res.util.ExtMXSerializer.writeAttributeValue(ExtMXSeria
lizer.java:38)
at org.xmlpull.mxp1_serializer.MXSerializer.attribute(MXSerializer.java:
673)
at org.xmlpull.v1.wrapper.classic.XmlSerializerDelegate.attribute(XmlSer
ializerDelegate.java:106)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.writeStartT
ag(StaticXmlSerializerWrapper.java:267)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.event(Stati
cXmlSerializerWrapper.java:211)
at brut.androlib.res.decoder.XmlPullStreamDecoder$1.event(XmlPullStreamD
ecoder.java:83)
at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(XmlPullStreamDe
coder.java:141)
at brut.androlib.res.decoder.XmlPullStreamDecoder.decodeManifest(XmlPull
StreamDecoder.java:153)
at brut.androlib.res.decoder.ResFileDecoder.decodeManifest(ResFileDecode
r.java:134)
at brut.androlib.res.AndrolibResources.decodeManifestWithResources(Andro
libResources.java:199)
at brut.androlib.Androlib.decodeManifestWithResources(Androlib.java:139)

    at brut.androlib.ApkDecoder.decode(ApkDecoder.java:102)
    at brut.apktool.Main.cmdDecode(Main.java:165)
    at brut.apktool.Main.main(Main.java:81)
@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches May 20, 2015

Owner
ibotpeaches@raganok:~/Downloads/Apktool/Bug513$ apktool d com.moji.mjweather_53202.apk 
I: Using Apktool 2.0.1-1fb87e-SNAPSHOT on com.moji.mjweather_53202.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /home/ibotpeaches/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
ibotpeaches@raganok:~/Downloads/Apktool/Bug513$

Not a bug @amir1111 and since this is an old bug, I'm locking the conversation. You may open a new bug if you find a problem.

Owner

iBotPeaches commented May 20, 2015

ibotpeaches@raganok:~/Downloads/Apktool/Bug513$ apktool d com.moji.mjweather_53202.apk 
I: Using Apktool 2.0.1-1fb87e-SNAPSHOT on com.moji.mjweather_53202.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /home/ibotpeaches/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
ibotpeaches@raganok:~/Downloads/Apktool/Bug513$

Not a bug @amir1111 and since this is an old bug, I'm locking the conversation. You may open a new bug if you find a problem.

Repository owner locked and limited conversation to collaborators May 20, 2015

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.