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


Java ResourceTable类代码示例

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


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

示例1: parseResourceTable

import net.dongliu.apk.parser.struct.resource.ResourceTable; //导入依赖的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.resource.ResourceTable; //导入依赖的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: parseResourceTable

import net.dongliu.apk.parser.struct.resource.ResourceTable; //导入依赖的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

示例4: toStringValue

import net.dongliu.apk.parser.struct.resource.ResourceTable; //导入依赖的package包/类
@Override
public String toStringValue(ResourceTable resourceTable, Locale locale) {
    // The low-order 4 bits of the data value specify the type of the fraction
    short type = (short) (value & 0xf);
    String pstr;
    switch (type) {
        case ResValue.ResDataCOMPLEX.UNIT_FRACTION:
            pstr = "%";
            break;
        case ResValue.ResDataCOMPLEX.UNIT_FRACTION_PARENT:
            pstr = "%p";
            break;
        default:
            pstr = "unknown type:0x" + Integer.toHexString(type);
    }
    float f = Float.intBitsToFloat(value >> 4);
    return f + pstr;
}
 
开发者ID:hsiafan,项目名称:apk-parser,代码行数:19,代码来源:ResourceValue.java

示例5: toStringValue

import net.dongliu.apk.parser.struct.resource.ResourceTable; //导入依赖的package包/类
public String toStringValue(ResourceTable resourceTable, Locale locale) {
    if (rawValue != null) {
        return rawValue;
    } else if (typedValue != null) {
        return typedValue.toStringValue(resourceTable, locale);
    } else {
        // something happen;
        return "";
    }
}
 
开发者ID:linchaolong,项目名称:ApkToolPlus,代码行数:11,代码来源:Attribute.java

示例6: toStringValue

import net.dongliu.apk.parser.struct.resource.ResourceTable; //导入依赖的package包/类
/**
 * get value as string
 *
 * @return
 */
public String toStringValue(ResourceTable resourceTable, Locale locale) {
    if (data != null) {
        return CDATA_START + data + CDATA_END;
    } else {
        return CDATA_START + typedData.toStringValue(resourceTable, locale) + CDATA_END;
    }
}
 
开发者ID:linchaolong,项目名称:ApkToolPlus,代码行数:13,代码来源:XmlCData.java

示例7: BinaryXmlParser

import net.dongliu.apk.parser.struct.resource.ResourceTable; //导入依赖的package包/类
public BinaryXmlParser(ByteBuffer buffer, ResourceTable resourceTable) {
    this.buffer = buffer.duplicate();
    this.buffer.order(byteOrder);
    this.resourceTable = resourceTable;
}
 
开发者ID:linchaolong,项目名称:ApkToolPlus,代码行数:6,代码来源:BinaryXmlParser.java

示例8: ApkMetaTranslator

import net.dongliu.apk.parser.struct.resource.ResourceTable; //导入依赖的package包/类
public ApkMetaTranslator(@Nonnull ResourceTable resourceTable, @Nullable Locale locale) {
    this.resourceTable = Objects.requireNonNull(resourceTable);
    this.locale = locale;
}
 
开发者ID:hsiafan,项目名称:apk-parser,代码行数:5,代码来源:ApkMetaTranslator.java


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