mirror of
https://github.com/revanced/smali.git
synced 2025-05-20 07:57:06 +02:00
Add some required runReadAction wrappers in SmaliCodeFragmentFactory
This commit is contained in:
parent
e6da8cd564
commit
6649a75532
@ -192,8 +192,12 @@ public class SmaliCodeFragmentFactory extends DefaultCodeFragmentFactory {
|
|||||||
@Override protected void action() throws Exception {
|
@Override protected void action() throws Exception {
|
||||||
int registerNumber = Integer.parseInt(name.substring(1));
|
int registerNumber = Integer.parseInt(name.substring(1));
|
||||||
if (name.charAt(0) == 'p') {
|
if (name.charAt(0) == 'p') {
|
||||||
registerNumber += containingMethod.getRegisterCount() -
|
registerNumber += ApplicationManager.getApplication().runReadAction(new Computable<Integer>() {
|
||||||
containingMethod.getParameterRegisterCount();
|
@Override public Integer compute() {
|
||||||
|
return containingMethod.getRegisterCount() -
|
||||||
|
containingMethod.getParameterRegisterCount();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
Value value = evaluateRegister(debuggerContext.createEvaluationContext(),
|
Value value = evaluateRegister(debuggerContext.createEvaluationContext(),
|
||||||
containingMethod,
|
containingMethod,
|
||||||
@ -265,15 +269,24 @@ public class SmaliCodeFragmentFactory extends DefaultCodeFragmentFactory {
|
|||||||
return ret[0];
|
return ret[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int mapRegisterForArt(SmaliMethod smaliMethod, int register) {
|
private static int mapRegisterForArt(final SmaliMethod smaliMethod, final int register) {
|
||||||
int totalRegisters = smaliMethod.getRegisterCount();
|
return ApplicationManager.getApplication().runReadAction(new Computable<Integer>() {
|
||||||
int parameterRegisters = smaliMethod.getParameterRegisterCount();
|
@Override public Integer compute() {
|
||||||
|
|
||||||
// For ART, the parameter registers are rotated to the front
|
int totalRegisters = smaliMethod.getRegisterCount();
|
||||||
if (register >= (totalRegisters - parameterRegisters)) {
|
int parameterRegisters = smaliMethod.getParameterRegisterCount();
|
||||||
return register - (totalRegisters - parameterRegisters);
|
|
||||||
}
|
if (smaliMethod.getModifierList().hasModifierProperty("static")) {
|
||||||
return register + parameterRegisters;
|
return register;
|
||||||
|
}
|
||||||
|
|
||||||
|
// For ART, the parameter registers are rotated to the front
|
||||||
|
if (register >= (totalRegisters - parameterRegisters)) {
|
||||||
|
return register - (totalRegisters - parameterRegisters);
|
||||||
|
}
|
||||||
|
return register + parameterRegisters;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user