Skip to content

Commit

Permalink
fix PttForwardHook (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hicores authored Mar 6, 2022
1 parent 3cd0e9a commit 381a2f7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/src/main/java/cc/ioctl/hook/PttForwardHook.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import androidx.core.view.ViewCompat;
import cc.ioctl.util.DebugUtils;
import cc.ioctl.util.HookUtils;
import cc.ioctl.util.HostInfo;
import cc.ioctl.util.HostStyledViewBuilder;
import cc.ioctl.util.Reflex;
import cc.ioctl.util.ui.drawable.HighContrastBorder;
Expand Down Expand Up @@ -245,8 +246,10 @@ public boolean initOnce() throws Exception {
@SuppressLint("SetTextI18n")
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
Field f = findField(param.thisObject.getClass(), Bundle.class, "a");
if (f == null) {
Field f;
try{
f = findField(param.thisObject.getClass(), Bundle.class, "a");
}catch (NoSuchFieldException ex){
f = Reflex.getFirstNSFFieldByType(param.thisObject.getClass(), Bundle.class);
}
f.setAccessible(true);
Expand Down

0 comments on commit 381a2f7

Please sign in to comment.