-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement CVE-2015-3860 test and add licenses activity
- Loading branch information
1 parent
02ecdd1
commit 1a0e7b4
Showing
14 changed files
with
1,194 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* | ||
* Copyright (C) 2012 by Xavier GOUCHET (http://xgouchet.fr, [email protected]) MIT Licence / Expat | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and | ||
* associated documentation files (the "Software"), to deal in the Software without restriction, | ||
* including without limitation the rights to use, copy, modify, merge, publish, distribute, | ||
* sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all copies or | ||
* substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT | ||
* NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS ( XAVIER GOUCHET ) BE LIABLE FOR ANY CLAIM, DAMAGES | ||
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR | ||
* IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
package fr.xgouchet.axml; | ||
|
||
public class Attribute { | ||
|
||
/** | ||
* @return the name | ||
*/ | ||
public String getName() { | ||
return mName; | ||
} | ||
|
||
/** | ||
* @return the prefix | ||
*/ | ||
public String getPrefix() { | ||
return mPrefix; | ||
} | ||
|
||
/** | ||
* @return the namespace | ||
*/ | ||
public String getNamespace() { | ||
return mNamespace; | ||
} | ||
|
||
/** | ||
* @return the value | ||
*/ | ||
public String getValue() { | ||
return mValue; | ||
} | ||
|
||
/** | ||
* @param name | ||
* the name to set | ||
*/ | ||
public void setName(final String name) { | ||
mName = name; | ||
} | ||
|
||
/** | ||
* @param prefix | ||
* the prefix to set | ||
*/ | ||
public void setPrefix(final String prefix) { | ||
mPrefix = prefix; | ||
} | ||
|
||
/** | ||
* @param namespace | ||
* the namespace to set | ||
*/ | ||
public void setNamespace(final String namespace) { | ||
mNamespace = namespace; | ||
} | ||
|
||
/** | ||
* @param value | ||
* the value to set | ||
*/ | ||
public void setValue(final String value) { | ||
mValue = value; | ||
} | ||
|
||
private String mName, mPrefix, mNamespace, mValue; | ||
} |
110 changes: 110 additions & 0 deletions
110
app/src/main/java/fr/xgouchet/axml/CompressedXmlDomListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
/* | ||
* Copyright (C) 2012 by Xavier GOUCHET (http://xgouchet.fr, [email protected]) MIT Licence / Expat | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and | ||
* associated documentation files (the "Software"), to deal in the Software without restriction, | ||
* including without limitation the rights to use, copy, modify, merge, publish, distribute, | ||
* sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all copies or | ||
* substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT | ||
* NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS ( XAVIER GOUCHET ) BE LIABLE FOR ANY CLAIM, DAMAGES | ||
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR | ||
* IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
package fr.xgouchet.axml; | ||
|
||
import android.text.TextUtils; | ||
|
||
import org.w3c.dom.Document; | ||
import org.w3c.dom.Element; | ||
import org.w3c.dom.Node; | ||
|
||
import java.util.Stack; | ||
|
||
import javax.xml.parsers.DocumentBuilder; | ||
import javax.xml.parsers.DocumentBuilderFactory; | ||
import javax.xml.parsers.ParserConfigurationException; | ||
|
||
public class CompressedXmlDomListener implements CompressedXmlParserListener { | ||
|
||
/** | ||
* @throws ParserConfigurationException | ||
* if a DocumentBuilder can't be created | ||
*/ | ||
public CompressedXmlDomListener() throws ParserConfigurationException { | ||
mBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); | ||
mStack = new Stack<Node>(); | ||
} | ||
|
||
public void startDocument() { | ||
mDocument = mBuilder.newDocument(); | ||
mStack.push(mDocument); | ||
} | ||
|
||
public void endDocument() { | ||
} | ||
|
||
public void startPrefixMapping(String prefix, String uri) { | ||
} | ||
|
||
public void endPrefixMapping(String prefix, String uri) { | ||
} | ||
|
||
public void startElement(final String uri, final String localName, | ||
final String qName, final Attribute[] attrs) { | ||
Element elt; | ||
|
||
// create elt | ||
if (TextUtils.isEmpty(uri)) { | ||
elt = mDocument.createElement(localName); | ||
} else { | ||
elt = mDocument.createElementNS(uri, qName); | ||
} | ||
|
||
// add attrs | ||
for (Attribute attr : attrs) { | ||
if (TextUtils.isEmpty(attr.getNamespace())) { | ||
elt.setAttribute(attr.getName(), attr.getValue()); | ||
} else { | ||
elt.setAttributeNS(attr.getNamespace(), attr.getPrefix() + ':' | ||
+ attr.getName(), attr.getValue()); | ||
} | ||
} | ||
|
||
// handle stack | ||
mStack.peek().appendChild(elt); | ||
mStack.push(elt); | ||
} | ||
|
||
public void endElement(String uri, String localName, String qName) { | ||
mStack.pop(); | ||
} | ||
|
||
public void characterData(String data) { | ||
mStack.peek().appendChild(mDocument.createCDATASection(data)); | ||
} | ||
|
||
public void text(String data) { | ||
mStack.peek().appendChild(mDocument.createTextNode(data)); | ||
} | ||
|
||
public void processingInstruction(String target, String data) { | ||
} | ||
|
||
/** | ||
* | ||
*/ | ||
public Document getDocument() { | ||
return mDocument; | ||
} | ||
|
||
private Stack<Node> mStack; | ||
private Document mDocument; | ||
private final DocumentBuilder mBuilder; | ||
} |
Oops, something went wrong.