Search in sources :

Example 1 with InsnDecoder

use of jadx.core.dex.instructions.InsnDecoder in project jadx by skylot.

the class MethodNode method load.

@Override
public void load() throws DecodeException {
    try {
        if (noCode) {
            regsCount = 0;
            codeSize = 0;
            initMethodTypes();
            return;
        }
        DexNode dex = parentClass.dex();
        Code mthCode = dex.readCode(methodData);
        regsCount = mthCode.getRegistersSize();
        initMethodTypes();
        InsnDecoder decoder = new InsnDecoder(this);
        decoder.decodeInsns(mthCode);
        instructions = decoder.process();
        codeSize = instructions.length;
        initTryCatches(mthCode);
        initJumps();
        this.debugInfoOffset = mthCode.getDebugInfoOffset();
    } catch (Exception e) {
        if (!noCode) {
            noCode = true;
            // load without code
            load();
            noCode = false;
        }
        throw new DecodeException(this, "Load method exception", e);
    }
}
Also used : InsnDecoder(jadx.core.dex.instructions.InsnDecoder) Code(com.android.dex.Code) DecodeException(jadx.core.utils.exceptions.DecodeException) JadxRuntimeException(jadx.core.utils.exceptions.JadxRuntimeException) DecodeException(jadx.core.utils.exceptions.DecodeException)

Aggregations

Code (com.android.dex.Code)1 InsnDecoder (jadx.core.dex.instructions.InsnDecoder)1 DecodeException (jadx.core.utils.exceptions.DecodeException)1 JadxRuntimeException (jadx.core.utils.exceptions.JadxRuntimeException)1