Search in sources :

Example 11 with MethodParameter

use of org.jf.dexlib2.iface.MethodParameter in project smali by JesusFreke.

the class ClassPool method internDebug.

private void internDebug(@Nonnull Method method) {
    for (MethodParameter param : method.getParameters()) {
        String paramName = param.getName();
        if (paramName != null) {
            dexPool.stringSection.intern(paramName);
        }
    }
    MethodImplementation methodImpl = method.getImplementation();
    if (methodImpl != null) {
        for (DebugItem debugItem : methodImpl.getDebugItems()) {
            switch(debugItem.getDebugItemType()) {
                case DebugItemType.START_LOCAL:
                    StartLocal startLocal = (StartLocal) debugItem;
                    dexPool.stringSection.internNullable(startLocal.getName());
                    dexPool.typeSection.internNullable(startLocal.getType());
                    dexPool.stringSection.internNullable(startLocal.getSignature());
                    break;
                case DebugItemType.SET_SOURCE_FILE:
                    dexPool.stringSection.internNullable(((SetSourceFile) debugItem).getSourceFile());
                    break;
            }
        }
    }
}
Also used : MutableMethodImplementation(org.jf.dexlib2.builder.MutableMethodImplementation)

Aggregations

MethodParameter (org.jf.dexlib2.iface.MethodParameter)6 ArrayList (java.util.ArrayList)4 MethodImplementation (org.jf.dexlib2.iface.MethodImplementation)3 ImmutableMethod (org.jf.dexlib2.immutable.ImmutableMethod)2 ImmutableMethodParameter (org.jf.dexlib2.immutable.ImmutableMethodParameter)2 ParamNamesTag (soot.tagkit.ParamNamesTag)2 MethodReplaceAnnotation (com.taobao.android.apatch.annotation.MethodReplaceAnnotation)1 MutableMethodImplementation (org.jf.dexlib2.builder.MutableMethodImplementation)1 DexBackedDexFile (org.jf.dexlib2.dexbacked.DexBackedDexFile)1 MapItem (org.jf.dexlib2.dexbacked.raw.MapItem)1 ClassDef (org.jf.dexlib2.iface.ClassDef)1 Method (org.jf.dexlib2.iface.Method)1 StringReference (org.jf.dexlib2.iface.reference.StringReference)1 ArrayEncodedValue (org.jf.dexlib2.iface.value.ArrayEncodedValue)1 EncodedValue (org.jf.dexlib2.iface.value.EncodedValue)1 MemoryDataStore (org.jf.dexlib2.writer.io.MemoryDataStore)1 DexPool (org.jf.dexlib2.writer.pool.DexPool)1 SmaliClass (org.jf.smalidea.psi.impl.SmaliClass)1 SmaliFile (org.jf.smalidea.psi.impl.SmaliFile)1 SmaliMethod (org.jf.smalidea.psi.impl.SmaliMethod)1