Skip to content

Commit

Permalink
fix: the undefined variable type invalidates some of the functions ca…
Browse files Browse the repository at this point in the history
…used by the lsparanoid matching error
  • Loading branch information
Sevtinge committed Jul 1, 2024
1 parent 54b2cfd commit dfda9d1
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Method;
import java.util.Objects;

import de.robv.android.xposed.XC_MethodHook;

Expand All @@ -49,18 +50,21 @@ public AnnotatedElement dexkit(DexKitBridge bridge) throws ReflectiveOperationEx
return methodData.getMethodInstance(lpparam.classLoader);
}
});
logD(TAG, lpparam.packageName, "method is "+method);
hookMethod(method, new MethodHook() {
@Override
protected void before(XC_MethodHook.MethodHookParam param) throws Throwable {
logD(TAG, lpparam.packageName, "1");
try {
findAndHookMethod(findClass("android.app.SharedPreferencesImpl$EditorImpl"), "putBoolean", String.class, boolean.class, new MethodHook() {
@Override
protected void before(MethodHookParam param) throws Throwable {
if (param.args[0] == "key_subscription_display" ||
param.args[0] == "key_import_todo" ||
param.args[0] == "key_chinese_almanac_pref" ||
param.args[0] == "key_weather_display" ||
param.args[0] == "key_ai_time_parse") param.args[1] = true;
String param0 = (String) param.args[0];
if (Objects.equals(param0, "key_subscription_display") ||
Objects.equals(param0, "key_import_todo") ||
Objects.equals(param0, "key_chinese_almanac_pref") ||
Objects.equals(param0, "key_weather_display") ||
Objects.equals(param0, "key_ai_time_parse")) param.args[1] = true;
}
});
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package com.sevtinge.hyperceiler.module.hook.screenrecorder
import com.sevtinge.hyperceiler.module.base.BaseHook
import de.robv.android.xposed.XC_MethodHook
import de.robv.android.xposed.XposedHelpers
import java.util.*

class ForceSupportPlaybackCapture : BaseHook() {
override fun init() {
Expand All @@ -33,7 +34,8 @@ class ForceSupportPlaybackCapture : BaseHook() {
Boolean::class.javaPrimitiveType,
object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) {
if (param.args[0] == "ro.vendor.audio.playbackcapture.screen")
val param0 = param.args[0] as String
if (Objects.equals(param0, "ro.vendor.audio.playbackcapture.screen"))
param.result = true
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package com.sevtinge.hyperceiler.module.hook.screenrecorder
import com.sevtinge.hyperceiler.module.base.BaseHook
import de.robv.android.xposed.XC_MethodHook
import de.robv.android.xposed.XposedHelpers
import java.util.*

object SaveToMovies : BaseHook() {
override fun init() {
Expand All @@ -34,7 +35,8 @@ object SaveToMovies : BaseHook() {
String::class.java,
object : XC_MethodHook() {
override fun beforeHookedMethod(param: MethodHookParam) {
if (param.args[0] == "relative_path") {
val param0 = param.args[0] as String
if (Objects.equals(param0, "relative_path")) {
param.args[1] = (param.args[1] as String).replace("DCIM", "Movies")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Method;
import java.util.Objects;

import de.robv.android.xposed.XC_MethodHook;

Expand All @@ -52,7 +53,8 @@ public AnnotatedElement dexkit(DexKitBridge bridge) throws ReflectiveOperationEx
hookMethod(method1, new MethodHook() {
@Override
protected void before(MethodHookParam param) throws Throwable {
if (param.args[0] == "debug.game.video.speed") param.args[1] = "true";
String param0 = (String) param.args[0];
if (Objects.equals(param0, "debug.game.video.speed")) param.args[1] = "true";
}
});

Expand All @@ -70,7 +72,8 @@ public AnnotatedElement dexkit(DexKitBridge bridge) throws ReflectiveOperationEx
hookMethod(method2, new MethodHook() {
@Override
protected void before(XC_MethodHook.MethodHookParam param) throws Throwable {
if (param.args[0] == "debug.game.video.support") param.setResult(true);
String param0 = (String) param.args[0];
if (Objects.equals(param0, "debug.game.video.support")) param.setResult(true);
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

import com.sevtinge.hyperceiler.module.base.BaseHook;

import java.util.Objects;

import de.robv.android.xposed.XC_MethodHook;

public class LanguageMenuShowAllApps extends BaseHook {
Expand All @@ -30,7 +32,8 @@ public void init() throws NoSuchMethodException {
findAndHookMethod("android.util.FeatureFlagUtils", "isEnabled", Context.class, String.class, new MethodHook() {
@Override
protected void before(MethodHookParam param) throws Throwable {
if (param.args[1] == "settings_app_locale_opt_in_enabled") param.setResult(false);
String param1 = (String) param.args[1];
if (Objects.equals(param1, "settings_app_locale_opt_in_enabled")) param.setResult(false);
}
});
}
Expand Down

0 comments on commit dfda9d1

Please sign in to comment.