Giter Site home page Giter Site logo

manifestinspector's People

Contributors

hifromajay avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

manifestinspector's Issues

Find problem with process '&' in manifest

Hi Ajay,
While I am processing a manifest file, I met the exception below:

[Fatal Error] com.android.settings.xml:287:18: The entity name must immediately follow the '&' in the entity reference.
org.xml.sax.SAXParseException; systemId: file:/home/samele/Public/manifest/com.android.settings.xml; lineNumber: 287; columnNumber: 18; The entity name must immediately follow the '&' in the entity reference.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:205)
at com.android.manifest.ManifestInspector.getDocument(ManifestInspector.java:37)
at com.android.manifest.ManifestInspector.main(ManifestInspector.java:22)

I followed the exception message and checked the manifest file, which shows like this:

I searched this problem on Stack Overflow, and it seems that before using DOMParser to parse manifest files, we need to change '&' to '&'.
Hope you can fix that.

Find NullPointerException in ApplicationStructure.java

Hi Ajay,
In ApplicationStructure.java, you used 'elem' at line 119, which might be a null object if the programmer falsely deleted the application tag. Your program will crash and throw NullPointerException at ApplicationStructure.java, line 119. Maybe you could add a null check before this line.

Attribute minSdkVersion did not checked

I'm using your program to check some Android Manifest files, and I found that some of them didn't set the minSdkVersion, and your program will be crashed and show these Exceptions:

Exception in thread "main" java.lang.NumberFormatException: For input string: " "
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:68)
at java.base/java.lang.Integer.parseInt(Integer.java:668)
at java.base/java.lang.Integer.parseInt(Integer.java:776)
at com.android.manifest.AMSecurity.checkExposedProviders(AMSecurity.java:339)
at com.android.manifest.AMSecurity.checkSecurity(AMSecurity.java:36)
at com.android.manifest.ManifestInspector.main(ManifestInspector.java:28)

I assume that you didn't check if minSdkVersion is declared. In the official document of android shows that if minSdkVersion is not declared, it will be assumed as 1. So maybe you should check it.

int minSdk = 0;
if(elem.getAttribute("android:minSdkVersion").equals("")) {
minSdk = 1;
}else {
minSdk = Integer.parseInt(elem.getAttribute("android:minSdkVersion"));
}

I add these code above, and it seems to solve the problem. Maybe this will help you to improve your program.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.