當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。