当前位置: 首页>>代码示例>>Java>>正文


Java AndroidConstants类代码示例

本文整理汇总了Java中net.dongliu.apk.parser.struct.AndroidConstants的典型用法代码示例。如果您正苦于以下问题:Java AndroidConstants类的具体用法?Java AndroidConstants怎么用?Java AndroidConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AndroidConstants类属于net.dongliu.apk.parser.struct包,在下文中一共展示了AndroidConstants类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: parseResourceTable

import net.dongliu.apk.parser.struct.AndroidConstants; //导入依赖的package包/类
/**
 * parse resource table.
 */
private void parseResourceTable() throws IOException {
    ZipEntry entry = Utils.getEntry(zf, AndroidConstants.RESOURCE_FILE);
    if (entry == null) {
        // if no resource entry has been found, we assume it is not needed by this APK
        this.resourceTable = new ResourceTable();
        this.locales = Collections.emptySet();
        return;
    }

    this.resourceTable = new ResourceTable();
    this.locales = Collections.emptySet();

    InputStream in = zf.getInputStream(entry);
    ByteBuffer buffer = ByteBuffer.wrap(Utils.toByteArray(in));
    ResourceTableParser resourceTableParser = new ResourceTableParser(buffer);
    resourceTableParser.parse();
    this.resourceTable = resourceTableParser.getResourceTable();
    this.locales = resourceTableParser.getLocales();
}
 
开发者ID:linchaolong,项目名称:ApkToolPlus,代码行数:23,代码来源:ApkParser.java

示例2: parseResourceTable

import net.dongliu.apk.parser.struct.AndroidConstants; //导入依赖的package包/类
private void parseResourceTable() throws IOException {
	ZipFile zf = new ZipFile(source);
	ZipEntry entry = Utils.getEntry(zf, AndroidConstants.RESOURCE_FILE);
	if (entry == null) {
		// if no resource entry has been found, we assume it is not needed by this
		// APK
		this.resourceTable = new ResourceTable();
		return;
	}

	this.resourceTable = new ResourceTable();

	InputStream in = zf.getInputStream(entry);
	ByteBuffer buffer = ByteBuffer.wrap(Utils.toByteArray(in));
	ResourceTableParser resourceTableParser = new ResourceTableParser(buffer);
	resourceTableParser.parse();
	this.resourceTable = resourceTableParser.getResourceTable();
}
 
开发者ID:onyxbits,项目名称:raccoon4,代码行数:19,代码来源:ExtractWorker.java

示例3: parseManifest

import net.dongliu.apk.parser.struct.AndroidConstants; //导入依赖的package包/类
private void parseManifest() throws IOException {
    if (manifestParsed) {
        return;
    }
    parseResourceTable();
    XmlTranslator xmlTranslator = new XmlTranslator();
    ApkMetaTranslator apkTranslator = new ApkMetaTranslator(this.resourceTable, this.preferredLocale);
    XmlStreamer xmlStreamer = new CompositeXmlStreamer(xmlTranslator, apkTranslator);

    byte[] data = getFileData(AndroidConstants.MANIFEST_FILE);
    if (data == null) {
        throw new ParserException("Manifest file not found");
    }
    transBinaryXml(data, xmlStreamer);
    this.manifestXml = xmlTranslator.getXml();
    this.apkMeta = apkTranslator.getApkMeta();
    this.iconPaths = apkTranslator.getIconPaths();
    manifestParsed = true;
}
 
开发者ID:hsiafan,项目名称:apk-parser,代码行数:20,代码来源:AbstractApkFile.java

示例4: parseResourceTable

import net.dongliu.apk.parser.struct.AndroidConstants; //导入依赖的package包/类
/**
 * parse resource table.
 */
private void parseResourceTable() throws IOException {
    if (resourceTableParsed) {
        return;
    }
    resourceTableParsed = true;
    byte[] data = getFileData(AndroidConstants.RESOURCE_FILE);
    if (data == null) {
        // if no resource entry has been found, we assume it is not needed by this APK
        this.resourceTable = new ResourceTable();
        this.locales = Collections.emptySet();
        return;
    }

    ByteBuffer buffer = ByteBuffer.wrap(data);
    ResourceTableParser resourceTableParser = new ResourceTableParser(buffer);
    resourceTableParser.parse();
    this.resourceTable = resourceTableParser.getResourceTable();
    this.locales = resourceTableParser.getLocales();
}
 
开发者ID:hsiafan,项目名称:apk-parser,代码行数:23,代码来源:AbstractApkFile.java

示例5: parseManifestXml

import net.dongliu.apk.parser.struct.AndroidConstants; //导入依赖的package包/类
/**
 * parse manifest.xml, get manifestXml as xml text.
 *
 * @throws IOException
 */
private void parseManifestXml() throws IOException {
    XmlTranslator xmlTranslator = new XmlTranslator();
    ApkMetaTranslator translator = new ApkMetaTranslator();
    XmlStreamer xmlStreamer = new CompositeXmlStreamer(xmlTranslator, translator);
    transBinaryXml(AndroidConstants.MANIFEST_FILE, xmlStreamer);
    this.manifestXml = xmlTranslator.getXml();
    if (this.manifestXml == null) {
        throw new ParserException("manifest xml not exists");
    }
    this.apkMeta = translator.getApkMeta();
}
 
开发者ID:linchaolong,项目名称:ApkToolPlus,代码行数:17,代码来源:ApkParser.java

示例6: parseDexFile

import net.dongliu.apk.parser.struct.AndroidConstants; //导入依赖的package包/类
private void parseDexFile() throws IOException {
    ZipEntry resourceEntry = Utils.getEntry(zf, AndroidConstants.DEX_FILE);
    if (resourceEntry == null) {
        throw new ParserException("Resource table not found");
    }
    InputStream in = zf.getInputStream(resourceEntry);
    ByteBuffer buffer = ByteBuffer.wrap(Utils.toByteArray(in));
    DexParser dexParser = new DexParser(buffer);
    dexParser.parse();
    this.dexClasses = dexParser.getDexClasses();
}
 
开发者ID:linchaolong,项目名称:ApkToolPlus,代码行数:12,代码来源:ApkParser.java

示例7: isBinaryXml

import net.dongliu.apk.parser.struct.AndroidConstants; //导入依赖的package包/类
/**
 * Decide whether or not a file is binary XML
 * 
 * @param filename
 *          the name of the file
 * @return if filename is the manifest or an xml in the res folder.
 */
private boolean isBinaryXml(String filename) {
	if (AndroidConstants.MANIFEST_FILE.equals(filename)) {
		return true;
	}
	if (filename.startsWith(AndroidConstants.RES_PREFIX)
			&& filename.toLowerCase().endsWith(".xml")) {
		return true;
	}
	return false;
}
 
开发者ID:onyxbits,项目名称:raccoon4,代码行数:18,代码来源:ExtractWorker.java

示例8: parseDexFiles

import net.dongliu.apk.parser.struct.AndroidConstants; //导入依赖的package包/类
private void parseDexFiles() throws IOException {
    this.dexClasses = parseDexFile(AndroidConstants.DEX_FILE);
    for (int i = 2; i < 1000; i++) {
        String path = String.format(AndroidConstants.DEX_ADDITIONAL, i);
        try {
            DexClass[] classes = parseDexFile(path);
            this.dexClasses = mergeDexClasses(this.dexClasses, classes);
        } catch (ParserException e) {
            break;
        }
    }
}
 
开发者ID:hsiafan,项目名称:apk-parser,代码行数:13,代码来源:AbstractApkFile.java


注:本文中的net.dongliu.apk.parser.struct.AndroidConstants类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。