本文整理汇总了Java中pxb.android.axml.AxmlWriter类的典型用法代码示例。如果您正苦于以下问题:Java AxmlWriter类的具体用法?Java AxmlWriter怎么用?Java AxmlWriter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AxmlWriter类属于pxb.android.axml包,在下文中一共展示了AxmlWriter类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: commit
import pxb.android.axml.AxmlWriter; //导入依赖的package包/类
public ManifestEditor commit() throws IOException {
AxmlWriter writer = new MutableAxmlWriter();
AxmlReader reader = new AxmlReader(IOUtils.readFully(mManifestInputStream, mManifestInputStream.available()));
reader.accept(writer);
mManifestData = writer.toByteArray();
return this;
}
开发者ID:hyb1996,项目名称:Auto.js-ApkBuilder,代码行数:8,代码来源:ManifestEditor.java
示例2: onAttr
import pxb.android.axml.AxmlWriter; //导入依赖的package包/类
public void onAttr(AxmlWriter.Attr attr) {
if ("package".equals(attr.name.data) && mPackageName != null && attr.value instanceof StringItem) {
((StringItem) attr.value).data = mPackageName;
return;
}
if (attr.ns == null || !NS_ANDROID.equals(attr.ns.data)) {
return;
}
if ("versionCode".equals(attr.name.data) && mVersionCode != -1) {
attr.value = mVersionCode;
return;
}
if ("versionName".equals(attr.name.data) && mVersionName != null && attr.value instanceof StringItem) {
attr.value = new StringItem(mVersionName);
((StringItem) attr.value).data = mVersionName;
return;
}
if ("label".equals(attr.name.data) && mAppName != null && attr.value instanceof StringItem) {
((StringItem) attr.value).data = mAppName;
return;
}
}
开发者ID:hyb1996,项目名称:Auto.js-ApkBuilder,代码行数:23,代码来源:ManifestEditor.java
示例3: toByteArray
import pxb.android.axml.AxmlWriter; //导入依赖的package包/类
/**
* Returns the xml document as a compressed android xml byte array.
* This will consider all changes made to the root node and it's children.
*
* @return android byte compressed xml
*/
public byte[] toByteArray() {
try {
AxmlWriter aw = new AxmlWriter();
// Write out all namespaces
for (AXmlNamespace ns : this.getDocument().getNamespaces())
aw.ns(ns.getPrefix(), ns.getUri(), ns.getLine());
writeNode(aw, this.getDocument().getRootNode());
return aw.toByteArray();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:24,代码来源:AXmlHandler.java
示例4: modifyManifest
import pxb.android.axml.AxmlWriter; //导入依赖的package包/类
private static void modifyManifest(final String[] args) {
try {
String androidManifestBinXml = args[0];
needRemoveConflict = args[1].contains("!");
needRemoveLib = args[1].contains("%");
newPackageFullName = args[1].replace("!", "").replace("%", "");
InputStream is = new FileInputStream(androidManifestBinXml);
byte[] xml = new byte[is.available()];
is.read(xml);
is.close();
AxmlReader ar = new AxmlReader(xml);
AxmlWriter aw = new AxmlWriter();
ar.accept(new AxmlVisitor(aw) {
@Override
public NodeVisitor child(String ns, String name) {
return new MyNodeVisitor(super.child(ns, name), name);
}
});
if (changed) {
byte[] modified = aw.toByteArray();
FileOutputStream fos = new FileOutputStream(androidManifestBinXml);
fos.write(modified);
fos.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
开发者ID:BuildmLearn,项目名称:BuildmLearn-Toolkit-Android,代码行数:31,代码来源:SignerThread.java
示例5: test
import pxb.android.axml.AxmlWriter; //导入依赖的package包/类
@Test
public void test() throws Exception {
for (File file : new File("src/test/resources/").listFiles()) {
if (file.getName().endsWith(".axml")) {
System.out.println("======= test " + file);
byte[] xml = Util.readFile(file);
AxmlReader rd = new AxmlReader(xml);
AxmlWriter wr = new AxmlWriter();
System.out.println("=== A ");
rd.accept((new DumpAdapter(wr)));
System.out.println("=== B ");
new AxmlReader(wr.toByteArray()).accept(new DumpAdapter(AxmlReader.EMPTY_VISITOR));
}
}
}
开发者ID:johanns,项目名称:axml,代码行数:16,代码来源:Test2.java
示例6: test
import pxb.android.axml.AxmlWriter; //导入依赖的package包/类
@Test
public void test() throws IOException {
AxmlWriter aw = new AxmlWriter();
NodeVisitor nv = aw.child("http://abc.com", "abc");
nv.end();
nv = aw.child("http://efg.com", "efg");
nv.end();
aw.end();
AxmlReader ar = new AxmlReader(aw.toByteArray());
ar.accept(new DumpAdapter());
}
开发者ID:johanns,项目名称:axml,代码行数:12,代码来源:Test4.java
示例7: test2
import pxb.android.axml.AxmlWriter; //导入依赖的package包/类
@Test
public void test2() throws IOException {
AxmlWriter aw = new AxmlWriter();
aw.ns("efg", "http://abc.com", -1);
NodeVisitor nv = aw.child("http://abc.com", "abc");
nv.end();
nv = aw.child("http://efg.com", "efg");
nv.end();
aw.end();
AxmlReader ar = new AxmlReader(aw.toByteArray());
ar.accept(new DumpAdapter());
}
开发者ID:johanns,项目名称:axml,代码行数:13,代码来源:Test4.java
注:本文中的pxb.android.axml.AxmlWriter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论