• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java DexBackedClassDef类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: buildCode

import org.jf.dexlib2.dexbacked.DexBackedClassDef; //导入依赖的package包/类
public static Set<String> buildCode(File smaliDir, File dexFile, DexDiffInfo info) throws IOException,
        RecognitionException {
    Set<String> classes = new HashSet<String>();
    Set<DexBackedClassDef> classDefs = new HashSet<DexBackedClassDef>();
    classDefs.addAll(info.getModifiedClasses());
    classDefs.addAll(info.getAddedClasses());
    final ClassFileNameHandler outFileNameHandler = new ClassFileNameHandler(smaliDir, ".smali");
    final ClassFileNameHandler inFileNameHandler = new ClassFileNameHandler(smaliDir, ".smali");
    DexBuilder dexBuilder = DexBuilder.makeDexBuilder();
    File smaliFile;
    String className;
    for (DexBackedClassDef classDef : classDefs) {
        ApkPatch.currentClassType = classDef.getType();
        className = TypeGenUtil.newType(classDef.getType());
        AfBakSmali.disassembleClass(classDef, outFileNameHandler, getBuildOption(classDefs, 19), false, false);
        smaliFile = inFileNameHandler.getUniqueFilenameForClass(className);
        classes.add(className.substring(1, className.length() - 1).replace('/', '.'));
        SmaliMod.assembleSmaliFile(smaliFile, dexBuilder, true, true);
    }

    dexBuilder.writeTo(new FileDataStore(dexFile));

    return classes;
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:25,代码来源:SmaliDiffUtils.java


示例2: scanClasses

import org.jf.dexlib2.dexbacked.DexBackedClassDef; //导入依赖的package包/类
public static Set<DexBackedClassDef> scanClasses(File smaliDir, List<File> newFiles) throws PatchException {

        Set<DexBackedClassDef> classes = Sets.newHashSet();
        try {
            for (File newFile : newFiles) {
                DexBackedDexFile newDexFile = DexFileFactory.loadDexFile(newFile, 19, true);
                Set<? extends DexBackedClassDef> dexClasses = newDexFile.getClasses();
                classes.addAll(dexClasses);
            }

            final ClassFileNameHandler outFileNameHandler = new ClassFileNameHandler(smaliDir, ".smali");
            final ClassFileNameHandler inFileNameHandler = new ClassFileNameHandler(smaliDir, ".smali");

            for (DexBackedClassDef classDef : classes) {
                String className = classDef.getType();
                ApkPatch.currentClassType = null;
                AfBakSmali.disassembleClass(classDef, outFileNameHandler, getBuildOption(classes, 19), true, true);
                File smaliFile = inFileNameHandler.getUniqueFilenameForClass(className);
            }
        } catch (Exception e) {
            throw new PatchException(e);
        }
        return classes;
    }
 
开发者ID:alibaba,项目名称:atlas,代码行数:25,代码来源:SmaliDiffUtils.java


示例3: loadLocalClasses

import org.jf.dexlib2.dexbacked.DexBackedClassDef; //导入依赖的package包/类
private static synchronized void loadLocalClasses(DexBackedDexFile dexFile) {
    /*
     * Must collect all local classes before any analysis because an API method is defined as
     * any non-local method. In multi-dex situations, there many be many API calls which are not
     * local to a single DEX.
     */
    for (DexBackedClassDef classDef : dexFile.getClasses()) {
        String classPath = classDef.getType();
        localClasses.add(classPath);
    }
}
 
开发者ID:CalebFenton,项目名称:apkfile,代码行数:12,代码来源:DexFile.java


示例4: DexClass

import org.jf.dexlib2.dexbacked.DexBackedClassDef; //导入依赖的package包/类
public DexClass(DexBackedClassDef classDef, boolean fullMethodSignatures) {
    this.fullMethodSignatures = fullMethodSignatures;

    this.classDef = classDef;
    methodSignatureToMethod = new HashMap<>();
    opCounts = new TObjectIntHashMap<>();
    apiCounts = new TObjectIntHashMap<>();
    stringReferenceCounts = new TObjectIntHashMap<>();
    fieldReferenceCounts = new TObjectIntHashMap<>();
    methodAccessorCounts = new TObjectIntHashMap<>();
    analyze();
    classAccessors = buildAccessors(classDef.getAccessFlags());
}
 
开发者ID:CalebFenton,项目名称:apkfile,代码行数:14,代码来源:DexClass.java


示例5: disassemble

import org.jf.dexlib2.dexbacked.DexBackedClassDef; //导入依赖的package包/类
public static File disassemble(File smaliDir, DexBackedClassDef dexBackedClassDef) throws PatchException {

        Set<DexBackedClassDef> classes = Sets.newHashSet();
        classes.add(dexBackedClassDef);
        final ClassFileNameHandler outFileNameHandler = new ClassFileNameHandler(smaliDir, ".smali");
        final ClassFileNameHandler inFileNameHandler = new ClassFileNameHandler(smaliDir, ".smali");
        String className = dexBackedClassDef.getType();
        AfBakSmali.disassembleClass(dexBackedClassDef, outFileNameHandler, getBuildOption(classes, 19), true, false);
        File smaliFile = inFileNameHandler.getUniqueFilenameForClass(className);
        return smaliFile;

    }
 
开发者ID:alibaba,项目名称:atlas,代码行数:13,代码来源:SmaliDiffUtils.java


示例6: addField

import org.jf.dexlib2.dexbacked.DexBackedClassDef; //导入依赖的package包/类
public static void addField(String inFile, String outFile, DexBackedClassDef dexBackedClassDef, ImmutableField immutableField) throws IOException {

        DexFile dexFile = readDexFile(inFile);
        for (ClassDef classDef : dexFile.getClasses()) {
            if (dexBackedClassDef != null && dexBackedClassDef.getType().equals(classDef.getType())) {
                dexFile = addField(dexFile, classDef.getType(), immutableField);
            } else if (dexBackedClassDef == null) {
                dexFile = addField(dexFile, classDef.getType(), immutableField);

            }
        }
        reDexFile(dexFile);

        DexFileFactory.writeDexFile(outFile, new DexFile() {
            @Nonnull
            @Override
            public Set<? extends ClassDef> getClasses() {
                return new AbstractSet<ClassDef>() {
                    @Nonnull
                    @Override
                    public Iterator<ClassDef> iterator() {
                        return classes.iterator();
                    }

                    @Override
                    public int size() {
                        return classes.size();
                    }
                };
            }
        });
    }
 
开发者ID:alibaba,项目名称:atlas,代码行数:33,代码来源:PatchFieldTool.java


示例7: getModifiedClasses

import org.jf.dexlib2.dexbacked.DexBackedClassDef; //导入依赖的package包/类
public static DexBackedClassDef getModifiedClasses(String clazz) {
    for (DexBackedClassDef classDef : modifiedClasses) {
        if (classDef.getType().equals(clazz)) {
            return classDef;
        }
    }
    return null;
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:9,代码来源:DexDiffInfo.java


示例8: isStaticFiled

import org.jf.dexlib2.dexbacked.DexBackedClassDef; //导入依赖的package包/类
private static boolean isStaticFiled(DexBackedClassDef classDef, FieldReference reference) {
    for (DexBackedField field : classDef.getStaticFields()) {
        if (field.equals(reference)) {
            return true;
        }
    }
    return false;
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:9,代码来源:ReferenceUtil.java


示例9: writeStaticFields

import org.jf.dexlib2.dexbacked.DexBackedClassDef; //导入依赖的package包/类
private Set<String> writeStaticFields(IndentingWriter writer) throws IOException {
    if (!fullMethod && !DexDiffInfo.addedClasses.contains(classDef)) {
        return null;
    }
    boolean wroteHeader = false;
    Set<String> writtenFields = new HashSet<String>();

    Iterable<? extends Field> staticFields;
    if (classDef instanceof DexBackedClassDef) {
        staticFields = ((DexBackedClassDef) classDef).getStaticFields(false);
    } else {
        staticFields = classDef.getStaticFields();
    }

    for (Field field : staticFields) {
        if (!wroteHeader) {
            writer.write("\n\n");
            writer.write("# static fields");
            wroteHeader = true;
        }
        writer.write('\n');

        boolean setInStaticConstructor;
        IndentingWriter fieldWriter = writer;
        String fieldString = ReferenceUtil.getShortFieldDescriptor(field);
        if (!writtenFields.add(fieldString)) {
            writer.write("# duplicate field ignored\n");
            fieldWriter = new CommentingIndentingWriter(writer);
            System.err.println(String.format("Ignoring duplicate field: %s->%s", classDef.getType(), fieldString));
            setInStaticConstructor = false;
        } else {
            setInStaticConstructor = fieldsSetInStaticConstructor.contains(fieldString);
        }
        FieldDefinition.writeTo(options, fieldWriter, field, setInStaticConstructor);
    }
    return writtenFields;
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:38,代码来源:ClassDefinition.java


示例10: writeInstanceFields

import org.jf.dexlib2.dexbacked.DexBackedClassDef; //导入依赖的package包/类
private void writeInstanceFields(IndentingWriter writer, Set<String> staticFields) throws IOException {
    if (!fullMethod&& !DexDiffInfo.addedClasses.contains(classDef)) {
        return;
    }
    boolean wroteHeader = false;
    Set<String> writtenFields = new HashSet<String>();

    Iterable<? extends Field> instanceFields;
    if (classDef instanceof DexBackedClassDef) {
        instanceFields = ((DexBackedClassDef) classDef).getInstanceFields(false);
    } else {
        instanceFields = classDef.getInstanceFields();
    }

    for (Field field : instanceFields) {
        if (!wroteHeader) {
            writer.write("\n\n");
            writer.write("# instance fields");
            wroteHeader = true;
        }
        writer.write('\n');

        IndentingWriter fieldWriter = writer;
        String fieldString = ReferenceUtil.getShortFieldDescriptor(field);
        if (!writtenFields.add(fieldString)) {
            writer.write("# duplicate field ignored\n");
            fieldWriter = new CommentingIndentingWriter(writer);
            System.err.println(String.format("Ignoring duplicate field: %s->%s", classDef.getType(), fieldString));
        } else if (staticFields.contains(fieldString)) {
            System.err.println(String.format("Duplicate static+instance field found: %s->%s",
                    classDef.getType(), fieldString));
            System.err.println("You will need to rename one of these fields, including all references.");

            writer.write("# There is both a static and instance field with this signature.\n" +
                    "# You will need to rename one of these fields, including all references.\n");
        }
        FieldDefinition.writeTo(options, fieldWriter, field, false);
    }
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:40,代码来源:ClassDefinition.java


示例11: writeStaticFields

import org.jf.dexlib2.dexbacked.DexBackedClassDef; //导入依赖的package包/类
private Set<String> writeStaticFields(IndentingWriter writer) throws IOException {
    boolean wroteHeader = false;
    Set<String> writtenFields = new HashSet<String>();

    Iterable<? extends Field> staticFields;
    if (classDef instanceof DexBackedClassDef) {
        staticFields = ((DexBackedClassDef)classDef).getStaticFields(false);
    } else {
        staticFields = classDef.getStaticFields();
    }

    for (Field field: staticFields) {
        if (!wroteHeader) {
            writer.write("\n\n");
            writer.write("# static fields");
            wroteHeader = true;
        }
        writer.write('\n');

        boolean setInStaticConstructor;
        IndentingWriter fieldWriter = writer;
        String fieldString = ReferenceUtil.getShortFieldDescriptor(field);
        if (!writtenFields.add(fieldString)) {
            writer.write("# duplicate field ignored\n");
            fieldWriter = new CommentingIndentingWriter(writer);
            System.err.println(String.format("Ignoring duplicate field: %s->%s", classDef.getType(), fieldString));
            setInStaticConstructor = false;
        } else {
            setInStaticConstructor = fieldsSetInStaticConstructor.contains(fieldString);
        }
        FieldDefinition.writeTo(fieldWriter, field, setInStaticConstructor);
    }
    return writtenFields;
}
 
开发者ID:Miracle963,项目名称:zjdroid,代码行数:35,代码来源:ClassDefinition.java


示例12: writeInstanceFields

import org.jf.dexlib2.dexbacked.DexBackedClassDef; //导入依赖的package包/类
private void writeInstanceFields(IndentingWriter writer, Set<String> staticFields) throws IOException {
    boolean wroteHeader = false;
    Set<String> writtenFields = new HashSet<String>();

    Iterable<? extends Field> instanceFields;
    if (classDef instanceof DexBackedClassDef) {
        instanceFields = ((DexBackedClassDef)classDef).getInstanceFields(false);
    } else {
        instanceFields = classDef.getInstanceFields();
    }

    for (Field field: instanceFields) {
        if (!wroteHeader) {
            writer.write("\n\n");
            writer.write("# instance fields");
            wroteHeader = true;
        }
        writer.write('\n');

        IndentingWriter fieldWriter = writer;
        String fieldString = ReferenceUtil.getShortFieldDescriptor(field);
        if (!writtenFields.add(fieldString)) {
            writer.write("# duplicate field ignored\n");
            fieldWriter = new CommentingIndentingWriter(writer);
            System.err.println(String.format("Ignoring duplicate field: %s->%s", classDef.getType(), fieldString));
        } else if (staticFields.contains(fieldString)) {
            System.err.println(String.format("Duplicate static+instance field found: %s->%s",
                    classDef.getType(), fieldString));
            System.err.println("You will need to rename one of these fields, including all references.");

            writer.write("# There is both a static and instance field with this signature.\n" +
                         "# You will need to rename one of these fields, including all references.\n");
        }
        FieldDefinition.writeTo(fieldWriter, field, false);
    }
}
 
开发者ID:Miracle963,项目名称:zjdroid,代码行数:37,代码来源:ClassDefinition.java


示例13: writeDirectMethods

import org.jf.dexlib2.dexbacked.DexBackedClassDef; //导入依赖的package包/类
private Set<String> writeDirectMethods(IndentingWriter writer) throws IOException {
    boolean wroteHeader = false;
    Set<String> writtenMethods = new HashSet<String>();

    Iterable<? extends Method> directMethods;
    if (classDef instanceof DexBackedClassDef) {
        directMethods = ((DexBackedClassDef)classDef).getDirectMethods(false);
    } else {
        directMethods = classDef.getDirectMethods();
    }

    for (Method method: directMethods) {
        if (!wroteHeader) {
            writer.write("\n\n");
            writer.write("# direct methods");
            wroteHeader = true;
        }
        writer.write('\n');

        // TODO: check for method validation errors
        String methodString = ReferenceUtil.getShortMethodDescriptor(method);

        IndentingWriter methodWriter = writer;
        if (!writtenMethods.add(methodString)) {
            writer.write("# duplicate method ignored\n");
            methodWriter = new CommentingIndentingWriter(writer);
        }

        MethodImplementation methodImpl = method.getImplementation();
        if (methodImpl == null) {
            MethodDefinition.writeEmptyMethodTo(methodWriter, method, options);
        } else {
            MethodDefinition methodDefinition = new MethodDefinition(this, method, methodImpl);
            methodDefinition.writeTo(methodWriter);
        }
    }
    return writtenMethods;
}
 
开发者ID:Miracle963,项目名称:zjdroid,代码行数:39,代码来源:ClassDefinition.java


示例14: merge

import org.jf.dexlib2.dexbacked.DexBackedClassDef; //导入依赖的package包/类
public void merge(){
	try {
		DexBackedDexFile addfile = DexFileFactory.loadDexFile(add_path, config.API_LEVEL);
		dexfile.setaddDexFile(addfile, new FilterClassDef() {
			
			@Override
			public DexBackedClassDef rewrite(DexBackedClassDef classDef) {
				// TODO Auto-generated method stub
				String className = classDef.getType();
				if (ADD_ALL) {
					if (!className.startsWith("Landroid") && 
							!className.startsWith("Ljava") &&
							!className.startsWith("Ldalvik")) {
							return classDef;
					}else{
						return null;
					}
				}
				
				if (internedItem.containsKey(className)) {
					System.out.println("contain " + className);
					return classDef;
				}
				return null;
			}
		});

		DexRewriter rewriter = new DexRewriter(new RewriterModule());
		DexFile rewrittenDexFile = rewriter.rewriteDexFile(dexfile);
		DexPool.writeTo(config.outPath, rewrittenDexFile);
		config.hasModifed = true;
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}
 
开发者ID:CvvT,项目名称:DexTamper,代码行数:37,代码来源:MergeDex.java


示例15: writeStaticFields

import org.jf.dexlib2.dexbacked.DexBackedClassDef; //导入依赖的package包/类
private Set<String> writeStaticFields(IndentingWriter writer) throws IOException {
    boolean wroteHeader = false;
    Set<String> writtenFields = new HashSet<String>();

    Iterable<? extends Field> staticFields;
    if (classDef instanceof DexBackedClassDef) {
        staticFields = ((DexBackedClassDef)classDef).getStaticFields(false);
    } else {
        staticFields = classDef.getStaticFields();
    }

    for (Field field: staticFields) {
        if (!wroteHeader) {
            writer.write("\n\n");
            writer.write("# static fields");
            wroteHeader = true;
        }
        writer.write('\n');

        boolean setInStaticConstructor;
        IndentingWriter fieldWriter = writer;
        String fieldString = ReferenceUtil.getShortFieldDescriptor(field);
        if (!writtenFields.add(fieldString)) {
            writer.write("# duplicate field ignored\n");
            fieldWriter = new CommentingIndentingWriter(writer);
            System.err.println(String.format("Ignoring duplicate field: %s->%s", classDef.getType(), fieldString));
            setInStaticConstructor = false;
        } else {
            setInStaticConstructor = fieldsSetInStaticConstructor.contains(fieldString);
        }
        FieldDefinition.writeTo(options, fieldWriter, field, setInStaticConstructor);
    }
    return writtenFields;
}
 
开发者ID:Sukelluskello,项目名称:VectorAttackScanner,代码行数:35,代码来源:ClassDefinition.java


示例16: writeInstanceFields

import org.jf.dexlib2.dexbacked.DexBackedClassDef; //导入依赖的package包/类
private void writeInstanceFields(IndentingWriter writer, Set<String> staticFields) throws IOException {
    boolean wroteHeader = false;
    Set<String> writtenFields = new HashSet<String>();

    Iterable<? extends Field> instanceFields;
    if (classDef instanceof DexBackedClassDef) {
        instanceFields = ((DexBackedClassDef)classDef).getInstanceFields(false);
    } else {
        instanceFields = classDef.getInstanceFields();
    }

    for (Field field: instanceFields) {
        if (!wroteHeader) {
            writer.write("\n\n");
            writer.write("# instance fields");
            wroteHeader = true;
        }
        writer.write('\n');

        IndentingWriter fieldWriter = writer;
        String fieldString = ReferenceUtil.getShortFieldDescriptor(field);
        if (!writtenFields.add(fieldString)) {
            writer.write("# duplicate field ignored\n");
            fieldWriter = new CommentingIndentingWriter(writer);
            System.err.println(String.format("Ignoring duplicate field: %s->%s", classDef.getType(), fieldString));
        } else if (staticFields.contains(fieldString)) {
            System.err.println(String.format("Duplicate static+instance field found: %s->%s",
                    classDef.getType(), fieldString));
            System.err.println("You will need to rename one of these fields, including all references.");

            writer.write("# There is both a static and instance field with this signature.\n" +
                         "# You will need to rename one of these fields, including all references.\n");
        }
        FieldDefinition.writeTo(options, fieldWriter, field, false);
    }
}
 
开发者ID:Sukelluskello,项目名称:VectorAttackScanner,代码行数:37,代码来源:ClassDefinition.java


示例17: writeDirectMethods

import org.jf.dexlib2.dexbacked.DexBackedClassDef; //导入依赖的package包/类
private Set<String> writeDirectMethods(IndentingWriter writer) throws IOException {
    boolean wroteHeader = false;
    Set<String> writtenMethods = new HashSet<String>();

    Iterable<? extends Method> directMethods;
    if (classDef instanceof DexBackedClassDef) {
        directMethods = ((DexBackedClassDef)classDef).getDirectMethods(false);
    } else {
        directMethods = classDef.getDirectMethods();
    }

    for (Method method: directMethods) {
        if (!wroteHeader) {
            writer.write("\n\n");
            writer.write("# direct methods");
            wroteHeader = true;
        }
        writer.write('\n');

        // TODO: check for method validation errors
        String methodString = ReferenceUtil.getMethodDescriptor(method, true);

        IndentingWriter methodWriter = writer;
        if (!writtenMethods.add(methodString)) {
            writer.write("# duplicate method ignored\n");
            methodWriter = new CommentingIndentingWriter(writer);
        }

        MethodImplementation methodImpl = method.getImplementation();
        if (methodImpl == null) {
            MethodDefinition.writeEmptyMethodTo(methodWriter, method, options);
        } else {
            MethodDefinition methodDefinition = new MethodDefinition(this, method, methodImpl);
            methodDefinition.writeTo(methodWriter);
        }
    }
    return writtenMethods;
}
 
开发者ID:Sukelluskello,项目名称:VectorAttackScanner,代码行数:39,代码来源:ClassDefinition.java


示例18: getClassDef

import org.jf.dexlib2.dexbacked.DexBackedClassDef; //导入依赖的package包/类
private static DexBackedClassDef getClassDef(
                            Set<? extends DexBackedClassDef> classDefs,
                            String className) {

    for (DexBackedClassDef classDef: classDefs) {

        String matchName = Utils.descriptorToDot(classDef.getType());
        if (matchName.equals(className)) {
            return classDef;
        }
    }

    return null;
}
 
开发者ID:android-dtf,项目名称:core_generate_aidl,代码行数:15,代码来源:App.java


示例19: getMethod

import org.jf.dexlib2.dexbacked.DexBackedClassDef; //导入依赖的package包/类
private static DexBackedMethod getMethod(
                            DexBackedClassDef classDef,
                            String methodName) {

     for (DexBackedMethod method : classDef.getVirtualMethods()) {

        String matchName = method.getName();
        if (matchName.equals(methodName)) {
            return method;
        }
    }

    return null;
}
 
开发者ID:android-dtf,项目名称:core_generate_aidl,代码行数:15,代码来源:App.java


示例20: analyze

import org.jf.dexlib2.dexbacked.DexBackedClassDef; //导入依赖的package包/类
public void analyze() {
    for (DexBackedClassDef classDef : dexFile.getClasses()) {
        String classPath = classDef.getType();
        DexClass dexClass;
        try {
            dexClass = new DexClass(classDef, fullMethodSignatures);
            failedClasses++;
        } catch (Exception e) {
            Logger.warn("Failed to analyze class: " + classDef.getType() + "; skipping", e);
            continue;
        }
        classPathToClass.put(classPath, dexClass);

        for (DexMethod method : dexClass.getMethodSignatureToMethod().values()) {
            String methodDescriptor = ReferenceUtil.getMethodDescriptor(method.getMethod());
            methodDescriptorToMethod.put(methodDescriptor, method);
        }

        /*
         * We want API counts here, not method calls to local classes.
         * In Dalvik, you can reference a method or field of a parent class by referring to
         * the child class. This means, to get *true* API fields and method calls, you'd
         * need to map method calls to parent methods up the class hierarchy of Android
         * framework classes. This is computationally expensive and there are multiple
         * framework versions. As an approximation, remove field and method references
         * to local, non-support classes.
        */
        dexClass.getApiCounts().keySet()
                .removeIf(k -> isLocalNonSupportClass(getComponentBase(k.getDefiningClass())));
        dexClass.getFieldReferenceCounts().keySet()
                .removeIf(k -> isLocalNonSupportClass(getComponentBase(k.getDefiningClass())));
        for (DexMethod dexMethod : dexClass.getMethodSignatureToMethod().values()) {
            dexMethod.getApiCounts().keySet().removeIf(
                    k -> isLocalNonSupportClass(getComponentBase(k.getDefiningClass())));
            dexMethod.getFieldReferenceCounts().keySet().removeIf(
                    k -> isLocalNonSupportClass(getComponentBase(k.getDefiningClass())));
        }

        Utils.rollUp(opCounts, dexClass.getOpCounts());
        Utils.rollUp(apiCounts, dexClass.getApiCounts());
        Utils.rollUp(stringReferenceCounts, dexClass.getStringReferenceCounts());
        Utils.rollUp(fieldReferenceCounts, dexClass.getFieldReferenceCounts());
        Utils.rollUp(methodAccessorCounts, dexClass.getMethodAccessorCounts());
        Utils.rollUp(classAccessorCounts, dexClass.getClassAccessors());
        fieldCount += dexClass.getFieldCount();
        annotationCount += dexClass.getAnnotationCount();
        registerCount += dexClass.getRegisterCount();
        instructionCount += dexClass.getInstructionCount();
        tryCatchCount += dexClass.getTryCatchCount();
        debugItemCount += dexClass.getDebugItemCount();
        cyclomaticComplexity += dexClass.getCyclomaticComplexity();
    }
    if (!classPathToClass.isEmpty()) {
        cyclomaticComplexity /= classPathToClass.size();
    }
}
 
开发者ID:CalebFenton,项目名称:apkfile,代码行数:57,代码来源:DexFile.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MROutputFiles类代码示例发布时间:2022-05-22
下一篇:
Java ThemedSpinnerAdapter类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap