code
stringlengths
1.51k
10.6k
apis
listlengths
1
33
extract_api
stringlengths
74
24.3k
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler; import com.github.kyuubiran.ezxhelper.EzXHelper; import com.sevtinge.hyperceiler.module.app.SystemFrameworkForCorePatch; import com.sevtinge.hyperceiler.module.base.BaseXposedInit; import com.sevtinge.hyperceiler.module.hook.home.other.AllowShareApk; import com.sevtinge.hyperceiler.module.hook.home.title.EnableIconMonetColor; import com.sevtinge.hyperceiler.module.hook.securitycenter.SidebarLineCustom; import com.sevtinge.hyperceiler.module.hook.systemframework.AllowManageAllNotifications; import com.sevtinge.hyperceiler.module.hook.systemframework.AllowUninstall; import com.sevtinge.hyperceiler.module.hook.systemframework.BackgroundBlurDrawable; import com.sevtinge.hyperceiler.module.hook.systemframework.CleanOpenMenu; import com.sevtinge.hyperceiler.module.hook.systemframework.CleanShareMenu; import com.sevtinge.hyperceiler.module.hook.systemframework.ScreenRotation; import com.sevtinge.hyperceiler.module.hook.systemsettings.VolumeSeparateControlForSettings; import com.sevtinge.hyperceiler.module.hook.systemui.navigation.HandleLineCustom; import com.sevtinge.hyperceiler.module.hook.tsmclient.AutoNfc; import de.robv.android.xposed.IXposedHookInitPackageResources; import de.robv.android.xposed.IXposedHookLoadPackage; import de.robv.android.xposed.IXposedHookZygoteInit; import de.robv.android.xposed.callbacks.XC_InitPackageResources; import de.robv.android.xposed.callbacks.XC_LoadPackage; public class XposedInit extends BaseXposedInit implements IXposedHookInitPackageResources, IXposedHookZygoteInit, IXposedHookLoadPackage { private final String TAG = "HyperCeiler"; @Override public void initZygote(IXposedHookZygoteInit.StartupParam startupParam) throws Throwable { super.initZygote(startupParam); EzXHelper.initZygote(startupParam); EzXHelper.setLogTag(TAG); EzXHelper.setToastTag(TAG); if (mPrefsMap.getBoolean("system_framework_allow_uninstall")) new AllowUninstall().initZygote(startupParam); if (mPrefsMap.getBoolean("system_framework_screen_all_rotations")) ScreenRotation.initRes(); if (mPrefsMap.getBoolean("system_framework_clean_share_menu")) CleanShareMenu.initRes(); if (mPrefsMap.getBoolean("system_framework_clean_open_menu")) CleanOpenMenu.initRes(); if (mPrefsMap.getBoolean("system_framework_volume_separate_control")) VolumeSeparateControlForSettings.initRes(); if (mPrefsMap.getBoolean("system_framework_allow_manage_all_notifications")) new AllowManageAllNotifications().initZygote(startupParam); if (startupParam != null) { new BackgroundBlurDrawable().initZygote(startupParam); new SystemFrameworkForCorePatch().initZygote(startupParam); } } @Override public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Throwable { if ("com.miui.contentcatcher".equals(lpparam.packageName) || "com.miui.catcherpatch".equals(lpparam.packageName)) { return; } init(lpparam); new SystemFrameworkForCorePatch().handleLoadPackage(lpparam); } @Override public void handleInitPackageResources(XC_InitPackageResources.InitPackageResourcesParam resparam) throws Throwable { switch (resparam.packageName) { case "com.miui.tsmclient": if (mPrefsMap.getBoolean("tsmclient_auto_nfc")) { AutoNfc.INSTANCE.initResource(resparam); } break; case "com.miui.home": if (mPrefsMap.getBoolean("home_other_icon_monet_color")) { EnableIconMonetColor.INSTANCE.initResource(resparam); } if (mPrefsMap.getBoolean("home_other_allow_share_apk")) { new AllowShareApk().initResource(resparam); } break; case "com.miui.securitycenter": if (mPrefsMap.getBoolean("security_center_sidebar_line_color")) { SidebarLineCustom.INSTANCE.initResource(resparam); } break; case "com.android.systemui": if (mPrefsMap.getBoolean("system_ui_navigation_handle_custom")) { HandleLineCustom.INSTANCE.initResource(resparam); } break; } } }
[ "com.sevtinge.hyperceiler.module.hook.home.title.EnableIconMonetColor.INSTANCE.initResource", "com.sevtinge.hyperceiler.module.hook.systemui.navigation.HandleLineCustom.INSTANCE.initResource", "com.sevtinge.hyperceiler.module.hook.securitycenter.SidebarLineCustom.INSTANCE.initResource", "com.sevtinge.hyperceiler.module.hook.tsmclient.AutoNfc.INSTANCE.initResource" ]
[((4200, 4239), 'com.sevtinge.hyperceiler.module.hook.tsmclient.AutoNfc.INSTANCE.initResource'), ((4412, 4464), 'com.sevtinge.hyperceiler.module.hook.home.title.EnableIconMonetColor.INSTANCE.initResource'), ((4810, 4859), 'com.sevtinge.hyperceiler.module.hook.securitycenter.SidebarLineCustom.INSTANCE.initResource'), ((5046, 5094), 'com.sevtinge.hyperceiler.module.hook.systemui.navigation.HandleLineCustom.INSTANCE.initResource')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.utils; import com.sevtinge.hyperceiler.callback.ITAG; import com.sevtinge.hyperceiler.utils.log.AndroidLogUtils; import com.sevtinge.hyperceiler.utils.shell.ShellInit; import java.util.ArrayList; /** * @noinspection UnusedReturnValue */ public class KillApp { public static boolean killApps(String pkg) { return killApps(new String[]{pkg}); } public static boolean killApps(String... pkgs) { if (pkgs == null) { AndroidLogUtils.logE(ITAG.TAG, "The list of package names cannot be null!"); return false; } boolean result = false; if (pkgs.length == 0) { AndroidLogUtils.logE(ITAG.TAG, "The length of the packet name array cannot be 0!"); return false; } for (String pkg : pkgs) { if (pkg == null) continue; if (pkg.isEmpty()) continue; result = ShellInit.getShell().add("pid=$(pgrep -f \"" + pkg + "\" | grep -v $$)") .add("if [[ $pid == \"\" ]]; then") .add(" pids=\"\"") .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \"" + pkg + "\" | grep -v \"grep\")") .add(" for i in $pid; do") .add(" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \"\" ]]; then") .add(" if [[ $pids == \"\" ]]; then") .add(" pids=$i") .add(" else") .add(" pids=\"$pids $i\"") .add(" fi") .add(" fi") .add(" done") .add("fi") .add("if [[ $pids != \"\" ]]; then") .add(" pid=$pids") .add("fi") .add("if [[ $pid != \"\" ]]; then") .add(" for i in $pid; do") .add(" kill -s 15 $i &>/dev/null") .add(" done") .add("else") .add(" echo \"No Find Pid!\"") .add("fi").over().sync().isResult(); ArrayList<String> outPut = ShellInit.getShell().getOutPut(); ArrayList<String> error = ShellInit.getShell().getError(); if (!outPut.isEmpty()) { if (outPut.get(0).equals("No Find Pid!")) { AndroidLogUtils.logW(ITAG.TAG, "Didn't find a pid that can kill: " + pkg); result = false; } } if (!error.isEmpty()) { AndroidLogUtils.logE(ITAG.TAG, "An error message was returned:" + error); result = false; } } return result; } }
[ "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\")\n .add(\" for i in $pid; do\")\n .add(\" kill -s 15 $i &>/dev/null\")\n .add(\" done\")\n .add(\"else\")\n .add(\" echo \\\"No Find Pid!\\\"\")\n .add(\"fi\").over().sync", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\")\n .add(\" for i in $pid; do\")\n .add(\" kill -s 15 $i &>/dev/null\")\n .add(\" done\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\")\n .add(\" for i in $pid; do\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\")\n .add(\" for i in $pid; do\")\n .add(\" kill -s 15 $i &>/dev/null\")\n .add(\" done\")\n .add(\"else\")\n .add(\" echo \\\"No Find Pid!\\\"\")\n .add(\"fi\").over().sync().isResult", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().getOutPut", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\")\n .add(\" for i in $pid; do\")\n .add(\" kill -s 15 $i &>/dev/null\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\")\n .add(\" for i in $pid; do\")\n .add(\" kill -s 15 $i &>/dev/null\")\n .add(\" done\")\n .add(\"else\")\n .add(\" echo \\\"No Find Pid!\\\"\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\")\n .add(\" for i in $pid; do\")\n .add(\" kill -s 15 $i &>/dev/null\")\n .add(\" done\")\n .add(\"else\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().getError", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\")\n .add(\" for i in $pid; do\")\n .add(\" kill -s 15 $i &>/dev/null\")\n .add(\" done\")\n .add(\"else\")\n .add(\" echo \\\"No Find Pid!\\\"\")\n .add(\"fi\").over", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\").add" ]
[((1674, 2868), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then")\n .add(" for i in $pid; do")\n .add(" kill -s 15 $i &>/dev/null")\n .add(" done")\n .add("else")\n .add(" echo \\"No Find Pid!\\"")\n .add("fi").over().sync().isResult'), ((1674, 2857), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then")\n .add(" for i in $pid; do")\n .add(" kill -s 15 $i &>/dev/null")\n .add(" done")\n .add("else")\n .add(" echo \\"No Find Pid!\\"")\n .add("fi").over().sync'), ((1674, 2850), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then")\n .add(" for i in $pid; do")\n .add(" kill -s 15 $i &>/dev/null")\n .add(" done")\n .add("else")\n .add(" echo \\"No Find Pid!\\"")\n .add("fi").over'), ((1674, 2843), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then")\n .add(" for i in $pid; do")\n .add(" kill -s 15 $i &>/dev/null")\n .add(" done")\n .add("else")\n .add(" echo \\"No Find Pid!\\"").add'), ((1674, 2812), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then")\n .add(" for i in $pid; do")\n .add(" kill -s 15 $i &>/dev/null")\n .add(" done")\n .add("else").add'), ((1674, 2761), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then")\n .add(" for i in $pid; do")\n .add(" kill -s 15 $i &>/dev/null")\n .add(" done").add'), ((1674, 2728), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then")\n .add(" for i in $pid; do")\n .add(" kill -s 15 $i &>/dev/null").add'), ((1674, 2694), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then")\n .add(" for i in $pid; do").add'), ((1674, 2638), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then").add'), ((1674, 2591), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi").add'), ((1674, 2535), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids").add'), ((1674, 2504), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then").add'), ((1674, 2465), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi").add'), ((1674, 2408), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done").add'), ((1674, 2377), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi").add'), ((1674, 2342), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi").add'), ((1674, 2308), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"").add'), ((1674, 2273), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else").add'), ((1674, 2221), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i").add'), ((1674, 2184), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then").add'), ((1674, 2142), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then").add'), ((1674, 2081), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do").add'), ((1674, 1989), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")").add'), ((1674, 1941), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"").add'), ((1674, 1841), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then").add'), ((1674, 1802), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)").add'), ((1674, 1746), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add'), ((2909, 2941), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().getOutPut'), ((2981, 3012), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().getError')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.mms; import android.content.Context; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.ClassMatcher; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; import org.luckypray.dexkit.result.MethodDataList; import java.lang.reflect.Method; import java.lang.reflect.Modifier; public class DisableAd extends BaseHook { @Override public void init() throws NoSuchMethodException { findAndHookMethod("com.miui.smsextra.ui.BottomMenu", "allowMenuMode", Context.class, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { param.setResult(false); } }); try { MethodData methodData1 = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .declaredClass(ClassMatcher.create() .usingStrings("Unknown type of the message: ")) .usingNumbers(3, 4) .returnType(boolean.class) .paramCount(0) ) ).singleOrThrow(() -> new IllegalStateException("DisableAd: Cannot found Method addAdButton()")); Method method1 = methodData1.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "addAdButton() method is " + method1); hookMethod(method1, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { param.setResult(false); } }); } catch (Exception e) { logE(TAG, lpparam.packageName, "find addAdButton() error", e); } try { MethodDataList methodDataList = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .name("setHideButton") ) ); if (methodDataList == null) throw new IllegalStateException("DisableAd: Cannot found Method setHideButton()"); for (MethodData methodData : methodDataList) { Method method2 = methodData.getMethodInstance(lpparam.classLoader); if (!Modifier.isAbstract(method2.getModifiers())) { logD(TAG, lpparam.packageName, "Current hooking setHideButton() method is " + method2); hookMethod(method2, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { param.args[0] = true; } }); } } } catch (Exception e) { logE(TAG, lpparam.packageName, "find setHideButton() error", e); } } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings(\"Unknown type of the message: \"))\n .usingNumbers(3, 4)\n .returnType(boolean.class)\n .paramCount(0)\n )\n ).singleOrThrow", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod" ]
[((1732, 2222), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("Unknown type of the message: "))\n .usingNumbers(3, 4)\n .returnType(boolean.class)\n .paramCount(0)\n )\n ).singleOrThrow'), ((1732, 2127), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1732, 1765), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1777, 2113), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1822, 2095), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("Unknown type of the message: "))\n .usingNumbers(3, 4)\n .returnType(boolean.class).paramCount'), ((1822, 2060), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("Unknown type of the message: "))\n .usingNumbers(3, 4).returnType'), ((1822, 2013), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("Unknown type of the message: ")).usingNumbers'), ((1822, 1973), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().declaredClass'), ((1880, 1972), 'org.luckypray.dexkit.query.matchers.ClassMatcher.create().usingStrings'), ((2799, 2986), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((2799, 2832), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((2844, 2972), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((2889, 2954), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().name')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.utils; import android.annotation.SuppressLint; import android.content.Context; import android.util.Log; import com.sevtinge.hyperceiler.callback.ITAG; import com.sevtinge.hyperceiler.utils.shell.ShellInit; import com.sevtinge.hyperceiler.utils.shell.ShellUtils; @SuppressLint("PrivateApi") public class PropUtils { private static final String TAG = ITAG.TAG; public static String getProp(Context context, String name) { try { return classLoaderMethod(context, name); } catch (Throwable e) { Log.e(TAG, "PropUtils classLoader getProp String", e); return ""; } } public static boolean getProp(String name, boolean def) { try { Class<?> cls = Class.forName("android.os.SystemProperties"); return Boolean.TRUE.equals(invokeMethod(cls, "getBoolean", new Class[]{String.class, boolean.class}, name, def)); } catch (Throwable e) { Log.e(TAG, "PropUtils getProp int", e); return false; } } public static int getProp(String name, int def) { try { Class<?> cls = Class.forName("android.os.SystemProperties"); return invokeMethod(cls, "getInt", new Class[]{String.class, int.class}, name, def); } catch (Throwable e) { Log.e(TAG, "PropUtils getProp int", e); return 0; } } public static long getProp(String name, long def) { try { Class<?> cls = Class.forName("android.os.SystemProperties"); return invokeMethod(cls, "getLong", new Class[]{String.class, long.class}, name, def); } catch (Throwable e) { Log.e(TAG, "PropUtils getProp long", e); return 0L; } } public static String getProp(String name, String def) { try { return invokeMethod(Class.forName("android.os.SystemProperties"), "get", new Class[]{String.class, String.class}, name, def); } catch (Throwable e) { Log.e(TAG, "PropUtils getProp String", e); return ""; } } public static String getProp(String name) { try { return invokeMethod(Class.forName("android.os.SystemProperties"), "get", new Class[]{String.class}, name); } catch (Throwable e) { Log.e(TAG, "PropUtils getProp String no def", e); return ""; } } /** * 系统限制只能使用Root。 * 返回 true 表示成功。 * * @return boolean */ public static boolean setProp(String name, Object vale) { if (ShellInit.getShell() != null) { return ShellInit.getShell().run("setprop " + name + " " + vale).sync().isResult(); } return ShellUtils.getResultBoolean("setprop " + name + " " + vale, true); } private static String classLoaderMethod(Context context, String name) throws Throwable { ClassLoader classLoader = context.getClassLoader(); return InvokeUtils.invokeStaticMethod("android.os.SystemProperties", classLoader, "get", new Class[]{String.class}, name); } /** * @noinspection unchecked */ private static <T> T invokeMethod(Class<?> cls, String str, Class<?>[] clsArr, Object... objArr) throws Throwable { return InvokeUtils.invokeStaticMethod(cls, str, clsArr, objArr); } }
[ "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run(\"setprop \" + name + \" \" + vale).sync", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run(\"setprop \" + name + \" \" + vale).sync().isResult", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run" ]
[((3463, 3537), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run("setprop " + name + " " + vale).sync().isResult'), ((3463, 3526), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run("setprop " + name + " " + vale).sync'), ((3463, 3519), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.securitycenter; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; import java.lang.reflect.Method; public class InstallIntercept extends BaseHook { @Override public void init() throws NoSuchMethodException { MethodData methodData = DexKit.INSTANCE.getDexKitBridge().findMethod( FindMethod.create() .matcher(MethodMatcher.create() .usingStrings("permcenter_install_intercept_enabled") .returnType(boolean.class) ) ).singleOrThrow(() -> new IllegalStateException("Find permcenter_install_intercept_enabled E")); // logE(TAG, "find: " + methodData.getMethodInstance(lpparam.classLoader)); Method method = methodData.getMethodInstance(lpparam.classLoader); hookMethod(method, new MethodHook() { @Override protected void before(MethodHookParam param) { param.setResult(false); } } ); } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(\n FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(\"permcenter_install_intercept_enabled\")\n .returnType(boolean.class)\n )\n ).singleOrThrow" ]
[((1245, 1613), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(\n FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings("permcenter_install_intercept_enabled")\n .returnType(boolean.class)\n )\n ).singleOrThrow'), ((1245, 1519), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1245, 1278), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1303, 1509), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1348, 1491), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .usingStrings("permcenter_install_intercept_enabled").returnType'), ((1348, 1444), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.ui.fragment.sub; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.os.Bundle; import android.os.Handler; import android.os.Parcelable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.CheckBox; import android.widget.EditText; import android.widget.ListView; import android.widget.ProgressBar; import androidx.fragment.app.Fragment; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.callback.IAppSelectCallback; import com.sevtinge.hyperceiler.callback.IEditCallback; import com.sevtinge.hyperceiler.data.AppData; import com.sevtinge.hyperceiler.data.adapter.AppDataAdapter; import com.sevtinge.hyperceiler.utils.BitmapUtils; import com.sevtinge.hyperceiler.utils.PackagesUtils; import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import moralnorm.appcompat.app.AlertDialog; public class AppPicker extends Fragment { private final String TAG = "AppPicker"; private String key = null; private int modeSelection; private View mRootView; private ProgressBar mAmProgress; private ListView mAppListRv; private AppDataAdapter mAppListAdapter; public Handler mHandler; private Set<String> selectedApps; private List<AppData> appDataList = new ArrayList<>(); private final HashMap<String, Integer> hashMap = new HashMap<>(); private IAppSelectCallback mAppSelectCallback; public static IEditCallback iEditCallback; public static final int APP_OPEN_MODE = 0; public static final int LAUNCHER_MODE = 1; public static final int CALLBACK_MODE = 2; public static final int INPUT_MODE = 3; public void setAppSelectCallback(IAppSelectCallback callback) { mAppSelectCallback = callback; } public interface EditDialogCallback { void onInputReceived(String userInput); } public static void setEditCallback(IEditCallback editCallback) { iEditCallback = editCallback; } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { mRootView = inflater.inflate(R.layout.fragment_app_picker, container, false); initView(); return mRootView; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requireActivity().setTitle(R.string.array_global_actions_launch_choose); Bundle args = requireActivity().getIntent().getExtras(); assert args != null; modeSelection = args.getInt("mode"); switch (modeSelection) { case APP_OPEN_MODE, LAUNCHER_MODE, INPUT_MODE -> key = args.getString("key"); default -> { } } mHandler = new Handler(); initData(); } private void initView() { mAmProgress = mRootView.findViewById(R.id.am_progressBar); mAppListRv = mRootView.findViewById(R.id.app_list_rv); mAppListRv.setVisibility(View.GONE); mAppListRv.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { AppData appData = appDataList.get((int) id); // Log.e(TAG, "onItemClick: " + appData.packageName, null); switch (modeSelection) { case CALLBACK_MODE -> { mAppSelectCallback.sendMsgToActivity(BitmapUtils.Bitmap2Bytes(appData.icon), appData.label, appData.packageName, appData.versionName + "(" + appData.versionCode + ")", appData.activityName); requireActivity().finish(); } case LAUNCHER_MODE, APP_OPEN_MODE -> { CheckBox checkBox = view.findViewById(android.R.id.checkbox); selectedApps = new LinkedHashSet<>(PrefsUtils.mSharedPreferences.getStringSet(key, new LinkedHashSet<>())); if (checkBox.isChecked()) { checkBox.setChecked(false); selectedApps.remove(appData.packageName); } else { checkBox.setChecked(true); selectedApps.add(appData.packageName); } PrefsUtils.mSharedPreferences.edit().putStringSet(key, selectedApps).apply(); } case INPUT_MODE -> { showEditDialog(appData.label, new EditDialogCallback() { @Override public void onInputReceived(String userInput) { iEditCallback.editCallback(appData.label, appData.packageName, userInput); } } ); } } } }); } private void showEditDialog(String defaultText, EditDialogCallback callback) { View view = LayoutInflater.from(getActivity()).inflate(R.layout.edit_dialog, null); EditText input = view.findViewById(R.id.title); input.setText(defaultText); new AlertDialog.Builder(requireActivity()) .setTitle(R.string.edit) .setView(view) .setPositiveButton(android.R.string.ok, (dialog, which) -> { String userInput = input.getText().toString(); callback.onInputReceived(userInput); dialog.dismiss(); }) .setNegativeButton(android.R.string.cancel, (dialog, which) -> { dialog.dismiss(); }) .show(); } private void initData() { new Thread(new Runnable() { @Override public void run() { mHandler.postDelayed(new Runnable() { @Override public void run() { appDataList = getAppInfo(); mAppListAdapter = new AppDataAdapter(requireActivity(), R.layout.item_app_list, appDataList, key, modeSelection); mAppListRv.setAdapter(mAppListAdapter); mAmProgress.setVisibility(View.GONE); mAppListRv.setVisibility(View.VISIBLE); } }, 120); } }).start(); } public List<AppData> getAppInfo() { return switch (modeSelection) { case LAUNCHER_MODE, CALLBACK_MODE, INPUT_MODE -> PackagesUtils.getPackagesByCode(new PackagesUtils.IPackageCode() { @Override public List<Parcelable> getPackageCodeList(PackageManager pm) { Intent intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_LAUNCHER); List<ResolveInfo> resolveInfoList = new ArrayList<>(); List<ResolveInfo> resolveInfos = pm.queryIntentActivities(intent, PackageManager.GET_ACTIVITIES); hashMap.clear(); for (ResolveInfo resolveInfo : resolveInfos) { Integer added = hashMap.get(resolveInfo.activityInfo.applicationInfo.packageName); if (added == null || added != 1) { hashMap.put(resolveInfo.activityInfo.applicationInfo.packageName, 1); } else { continue; } resolveInfoList.add(resolveInfo); } return new ArrayList<>(resolveInfoList); } }); case APP_OPEN_MODE -> PackagesUtils.getOpenWithApps(); default -> new ArrayList<>(); }; } }
[ "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putStringSet(key, selectedApps).apply", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putStringSet", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getStringSet" ]
[((5019, 5089), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getStringSet'), ((5475, 5551), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putStringSet(key, selectedApps).apply'), ((5475, 5543), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putStringSet'), ((5475, 5511), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit'), ((6197, 6267), 'android.view.LayoutInflater.from(getActivity()).inflate')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.ui.fragment; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreAndroidVersion; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; import com.sevtinge.hyperceiler.utils.devicesdk.TelephonyManager; import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils; import moralnorm.preference.Preference; import moralnorm.preference.SwitchPreference; public class SystemFrameworkFragment extends SettingsPreferenceFragment { SwitchPreference mDisableCreak; SwitchPreference mShareUser; SwitchPreference mDisableIntegrity; SwitchPreference mDisableLowApiCheck; Preference mNetwork; @Override public int getContentResId() { return R.xml.framework; } @Override public void initPrefs() { boolean mCreak = PrefsUtils.getSharedBoolPrefs(getContext(), "prefs_key_system_framework_core_patch_auth_creak", false); mDisableCreak = findPreference("prefs_key_system_framework_core_patch_auth_creak"); mShareUser = findPreference("prefs_key_system_framework_core_patch_shared_user"); mDisableIntegrity = findPreference("prefs_key_system_framework_core_patch_disable_integrity"); mDisableLowApiCheck = findPreference("prefs_key_system_framework_disable_low_api_check"); mNetwork = findPreference("prefs_key_system_framework_network"); mDisableIntegrity.setVisible(isMoreAndroidVersion(33) && !mCreak); mShareUser.setVisible(isMoreAndroidVersion(33)); // 暂时仅开放给 Android 13 及以上使用 mNetwork.setVisible(TelephonyManager.getDefault().isFiveGCapable()); mDisableLowApiCheck.setVisible(isMoreAndroidVersion(34)); mDisableCreak.setOnPreferenceChangeListener((preference, o) -> { if ((boolean) o) { mDisableIntegrity.setChecked(false); mDisableIntegrity.setVisible(false); } else { mDisableIntegrity.setVisible(isMoreAndroidVersion(33)); } return true; }); } }
[ "com.sevtinge.hyperceiler.utils.devicesdk.TelephonyManager.getDefault().isFiveGCapable" ]
[((2371, 2417), 'com.sevtinge.hyperceiler.utils.devicesdk.TelephonyManager.getDefault().isFiveGCapable')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.huanji; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; import java.lang.reflect.Method; public class AllowMoveAllApps extends BaseHook { @Override public void init() throws NoSuchMethodException { MethodData methodData = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .usingStrings(" skip file path ") ) ).singleOrThrow(() -> new IllegalStateException("Cannot found MethodData")); Method method = methodData.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "isSkipDataApp() method is " + method); hookMethod(method, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { param.setResult(false); } }); } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(\" skip file path \")\n )\n ).singleOrThrow", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod" ]
[((1237, 1493), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(" skip file path ")\n )\n ).singleOrThrow'), ((1237, 1419), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1237, 1270), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1282, 1409), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1323, 1395), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.ui.fragment.settings.development; import android.view.LayoutInflater; import android.view.View; import android.widget.EditText; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils; import java.util.Arrays; import java.util.HashSet; import java.util.Map; import moralnorm.appcompat.app.AlertDialog; import moralnorm.preference.Preference; public class DevelopmentPrefsFragment extends SettingsPreferenceFragment { Preference mType; Preference mClean; public interface EditDialogCallback { void onInputReceived(String userInput); } @Override public int getContentResId() { return R.xml.prefs_development_prefs; } @Override public void initPrefs() { mType = findPreference("prefs_key_development_prefs_check"); mClean = findPreference("prefs_key_development_prefs_clean"); assert mType != null; assert mClean != null; mClean.setOnPreferenceClickListener( preference -> { showInDialog( userInput -> { if (cleanPrefs(userInput)) { showOutDialog(getResources().getString(R.string.prefs_2) + userInput); } else { showOutDialog(getResources().getString(R.string.prefs_3) + userInput); } } ); return true; }); mType.setOnPreferenceClickListener( preference -> { showInDialog( userInput -> { if (havePrefs(userInput)) { Object prefs = getPrefs(userInput, false, getType("prefs_key_development_prefs_type")); if (prefs == null) return; if (prefs instanceof String) { showOutDialog((String) prefs); } else if (prefs instanceof Integer) { showOutDialog(Integer.toString((int) prefs)); } else if (prefs instanceof Boolean) { showOutDialog(Boolean.toString((Boolean) prefs)); } else if (prefs instanceof HashSet<?>) { showOutDialog(Arrays.toString(((HashSet<?>) prefs).toArray())); } } else { showOutDialog(getResources().getString(R.string.prefs_1) + userInput); } } ); return true; } ); } private int getType(String key) { return Integer.parseInt((String) getPrefs(key, true, 0)); } private boolean havePrefs(String key) { Map<String, ?> prefs = PrefsUtils.mSharedPreferences.getAll(); return !(prefs.get(key) == null); } private boolean cleanPrefs(String key) { if (havePrefs(key)) { PrefsUtils.mSharedPreferences.edit().remove(key).apply(); return true; } return havePrefs(key); } private Object getPrefs(String key, boolean type, int needType) { if (type) return PrefsUtils.mSharedPreferences.getString(key, "null"); try { switch (needType) { case 0 -> { return PrefsUtils.mSharedPreferences.getInt(key, -1); } case 1 -> { return PrefsUtils.mSharedPreferences.getString(key, "null"); } case 2 -> { return Integer.parseInt(PrefsUtils.mSharedPreferences.getString(key, "-1")); } case 3 -> { return PrefsUtils.mSharedPreferences.getStringSet(key, new HashSet<>()); } case 4 -> { return PrefsUtils.mSharedPreferences.getBoolean(key, false); } default -> { return null; } } } catch (Throwable throwable) { showOutDialog(getResources().getString(R.string.prefs_4) + "\n E: " + throwable.getMessage()); return null; } } private void showInDialog(EditDialogCallback callback) { View view = LayoutInflater.from(getActivity()).inflate(R.layout.edit_dialog, null); EditText input = view.findViewById(R.id.title); new AlertDialog.Builder(getActivity()) .setTitle(R.string.edit_key) .setView(view) .setCancelable(false) .setPositiveButton(android.R.string.ok, (dialog, which) -> { String userInput = input.getText().toString(); if (userInput.equals("")) { dialog.dismiss(); showInDialog(callback); return; } callback.onInputReceived(userInput); dialog.dismiss(); }) .setNegativeButton(android.R.string.cancel, (dialog, which) -> dialog.dismiss()) .show(); } private void showOutDialog(String show) { new AlertDialog.Builder(getActivity()) .setCancelable(false) .setTitle(R.string.edit_out) .setMessage(show) .setPositiveButton(android.R.string.ok, null) .show(); } }
[ "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().remove(key).apply", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getString", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getBoolean", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getInt", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getAll", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().remove", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getStringSet" ]
[((3773, 3811), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getAll'), ((3949, 4005), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().remove(key).apply'), ((3949, 3997), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().remove'), ((3949, 3985), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit'), ((4175, 4227), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getString'), ((4330, 4375), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getInt'), ((4450, 4502), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getString'), ((4594, 4644), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getString'), ((4720, 4784), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getStringSet'), ((4859, 4911), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getBoolean'), ((5295, 5365), 'android.view.LayoutInflater.from(getActivity()).inflate')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.ui.fragment.helper; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.prefs.PreferenceHeader; import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; import moralnorm.preference.Preference; public class CantSeeAppsFragment extends SettingsPreferenceFragment { Preference mHelpCantSeeApps; @Override public int getContentResId() { return R.xml.prefs_help_cant_see_apps; } @Override public void initPrefs() { setTitle(R.string.help); mHelpCantSeeApps = findPreference("prefs_key_textview_help_cant_see_apps"); if (mHelpCantSeeApps != null) { if (!PreferenceHeader.mUninstallApp.isEmpty() && !PreferenceHeader.mDisableOrHiddenApp.isEmpty()) { mHelpCantSeeApps.setSummary(getString(R.string.help_cant_see_apps_desc) + getString(R.string.help_cant_see_apps_uninstall) + String.join("\n", PreferenceHeader.mUninstallApp) + "\n" + getString(R.string.help_cant_see_apps_disable) + String.join("\n", PreferenceHeader.mDisableOrHiddenApp)); } else if (!PreferenceHeader.mUninstallApp.isEmpty()) { mHelpCantSeeApps.setSummary(getString(R.string.help_cant_see_apps_desc) + getString(R.string.help_cant_see_apps_uninstall) + String.join("\n", PreferenceHeader.mUninstallApp)); } else if (!PreferenceHeader.mDisableOrHiddenApp.isEmpty()) { mHelpCantSeeApps.setSummary(getString(R.string.help_cant_see_apps_desc) + getString(R.string.help_cant_see_apps_disable) + String.join("\n", PreferenceHeader.mDisableOrHiddenApp)); } } } }
[ "com.sevtinge.hyperceiler.prefs.PreferenceHeader.mUninstallApp.isEmpty", "com.sevtinge.hyperceiler.prefs.PreferenceHeader.mDisableOrHiddenApp.isEmpty" ]
[((1413, 1453), 'com.sevtinge.hyperceiler.prefs.PreferenceHeader.mUninstallApp.isEmpty'), ((1458, 1504), 'com.sevtinge.hyperceiler.prefs.PreferenceHeader.mDisableOrHiddenApp.isEmpty'), ((1887, 1927), 'com.sevtinge.hyperceiler.prefs.PreferenceHeader.mUninstallApp.isEmpty'), ((2172, 2218), 'com.sevtinge.hyperceiler.prefs.PreferenceHeader.mDisableOrHiddenApp.isEmpty')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.ui.base; import android.app.backup.BackupManager; import android.content.SharedPreferences; import android.net.Uri; import android.os.Bundle; import android.os.FileObserver; import android.util.Log; import android.view.View; import android.widget.ImageView; import androidx.annotation.DrawableRes; import androidx.annotation.Nullable; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.provider.SharedPrefsProvider; import com.sevtinge.hyperceiler.utils.Helpers; import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils; import java.util.Set; import moralnorm.appcompat.app.AppCompatActivity; public abstract class BaseActivity extends AppCompatActivity { protected BaseSettingsProxy mProxy; @Override public void onCreate(@Nullable Bundle savedInstanceState) { mProxy = new SettingsProxy(this); super.onCreate(savedInstanceState); initActionBar(); registerObserver(); } protected void initActionBar() { setDisplayHomeAsUpEnabled(!(this instanceof NavigationActivity)); } public void setDisplayHomeAsUpEnabled(boolean isEnable) { getAppCompatActionBar().setDisplayHomeAsUpEnabled(isEnable); } public void setActionBarEndView(View view) { getAppCompatActionBar().setEndView(view); } public void setActionBarEndIcon(@DrawableRes int resId, View.OnClickListener listener) { ImageView mRestartView = new ImageView(this); mRestartView.setImageResource(resId); mRestartView.setOnClickListener(listener); setActionBarEndView(mRestartView); } public void setRestartView(View.OnClickListener listener) { if (listener != null) setActionBarEndIcon(R.drawable.ic_reboot_small, listener); } private void registerObserver() { PrefsUtils.mSharedPreferences.registerOnSharedPreferenceChangeListener(mSharedPreferenceChangeListener); Helpers.fixPermissionsAsync(getApplicationContext()); registerFileObserver(); } SharedPreferences.OnSharedPreferenceChangeListener mSharedPreferenceChangeListener = (sharedPreferences, s) -> { Log.i("prefs", "Changed: " + s); requestBackup(); Object val = sharedPreferences.getAll().get(s); String path = ""; if (val instanceof String) path = "string/"; else if (val instanceof Set<?>) path = "stringset/"; else if (val instanceof Integer) path = "integer/"; else if (val instanceof Boolean) path = "boolean/"; getContentResolver().notifyChange(Uri.parse("content://" + SharedPrefsProvider.AUTHORITY + "/" + path + s), null); if (!path.isEmpty()) getContentResolver().notifyChange(Uri.parse("content://" + SharedPrefsProvider.AUTHORITY + "/pref/" + path + s), null); }; private void registerFileObserver() { try { FileObserver mFileObserver = new FileObserver(PrefsUtils.getSharedPrefsPath(), FileObserver.CLOSE_WRITE) { @Override public void onEvent(int event, String path) { Helpers.fixPermissionsAsync(getApplicationContext()); } }; mFileObserver.startWatching(); } catch (Throwable t) { Log.e("prefs", "Failed to start FileObserver!"); } } public void requestBackup() { new BackupManager(getApplicationContext()).dataChanged(); } }
[ "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.registerOnSharedPreferenceChangeListener" ]
[((2571, 2674), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.registerOnSharedPreferenceChangeListener')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.weather; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindField; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.ClassMatcher; import org.luckypray.dexkit.query.matchers.FieldMatcher; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.FieldData; import org.luckypray.dexkit.result.MethodData; import java.lang.reflect.Field; import java.lang.reflect.Method; import de.robv.android.xposed.XposedHelpers; public class SetCardLightDarkMode extends BaseHook { private static final String METHOD_NAME = "judgeCurrentColor() mLightDarkMode : "; private static final MethodMatcher METHOD_MATCHER = MethodMatcher.create().usingStrings(METHOD_NAME); @Override public void init() { try { MethodData methodData = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(METHOD_MATCHER) ).singleOrThrow(() -> new NoSuchMethodException("SetCardLightDarkMode: Cannot find method judgeCurrentColor()")); Method method = methodData.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "judgeCurrentColor() method is " + method); FieldData fieldData = DexKit.INSTANCE.getDexKitBridge().findField(FindField.create() .matcher(FieldMatcher.create() .declaredClass(ClassMatcher.create() .usingStrings(METHOD_NAME)) .addWriteMethod(METHOD_MATCHER) .addReadMethod(METHOD_MATCHER) .type(int.class) ) ).singleOrThrow(() -> new NoSuchFieldException("SetCardLightDarkMode: Cannot find field mLightDarkMode")); Field field = fieldData.getFieldInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "mLightDarkMode field is " + field); hookMethod(method, new MethodHook() { @Override protected void after(MethodHookParam param) { XposedHelpers.setIntField(param.thisObject, field.getName(), mPrefsMap.getStringAsInt("weather_card_display_type", 0)); } }); } catch (Exception e) { logE(TAG, lpparam.packageName, e); } } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(METHOD_MATCHER)\n ).singleOrThrow", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findField(FindField.create()\n .matcher(FieldMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings(METHOD_NAME))\n .addWriteMethod(METHOD_MATCHER)\n .addReadMethod(METHOD_MATCHER)\n .type(int.class)\n )\n ).singleOrThrow", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findField" ]
[((1557, 1605), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings'), ((1697, 1931), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(METHOD_MATCHER)\n ).singleOrThrow'), ((1697, 1820), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1697, 1730), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1742, 1806), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((2133, 2679), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findField(FindField.create()\n .matcher(FieldMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings(METHOD_NAME))\n .addWriteMethod(METHOD_MATCHER)\n .addReadMethod(METHOD_MATCHER)\n .type(int.class)\n )\n ).singleOrThrow'), ((2133, 2575), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findField'), ((2133, 2166), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((2177, 2561), 'org.luckypray.dexkit.query.FindField.create().matcher'), ((2225, 2539), 'org.luckypray.dexkit.query.matchers.FieldMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings(METHOD_NAME))\n .addWriteMethod(METHOD_MATCHER)\n .addReadMethod(METHOD_MATCHER).type'), ((2225, 2494), 'org.luckypray.dexkit.query.matchers.FieldMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings(METHOD_NAME))\n .addWriteMethod(METHOD_MATCHER).addReadMethod'), ((2225, 2435), 'org.luckypray.dexkit.query.matchers.FieldMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings(METHOD_NAME)).addWriteMethod'), ((2225, 2375), 'org.luckypray.dexkit.query.matchers.FieldMatcher.create().declaredClass'), ((2290, 2374), 'org.luckypray.dexkit.query.matchers.ClassMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.home; import android.content.Context; import android.os.Handler; import android.os.Message; import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; import com.sevtinge.hyperceiler.XposedInit; import com.sevtinge.hyperceiler.module.base.BaseHook; import de.robv.android.xposed.XposedHelpers; public class SeekPoints extends BaseHook { public int points = XposedInit.mPrefsMap.getStringAsInt("home_other_seek_points", 0); @Override public void init() { findAndHookMethod("com.miui.home.launcher.ScreenView", "setSeekBarPosition", "android.widget.FrameLayout$LayoutParams", new MethodHook() { @Override protected void after(MethodHookParam param) { showSeekBar((View) param.thisObject); } } ); findAndHookMethod("com.miui.home.launcher.ScreenView", "refreshScrollBound", new MethodHook() { @Override protected void after(MethodHookParam param) { if (points == 2) showSeekBar((View) param.thisObject); } } ); findAndHookMethod("com.miui.home.launcher.ScreenView", "updateSeekPoints", int.class, new MethodHook() { @Override protected void before(final MethodHookParam param) { showSeekBar((View) param.thisObject); } } ); findAndHookMethod("com.miui.home.launcher.ScreenView", "addView", View.class, int.class, ViewGroup.LayoutParams.class, new MethodHook() { @Override protected void before(final MethodHookParam param) { showSeekBar((View) param.thisObject); } } ); findAndHookMethod("com.miui.home.launcher.ScreenView", "removeScreen", int.class, new MethodHook() { @Override protected void before(final MethodHookParam param) { showSeekBar((View) param.thisObject); } } ); findAndHookMethod("com.miui.home.launcher.ScreenView", "removeScreensInLayout", int.class, int.class, new MethodHook() { @Override protected void before(final MethodHookParam param) { showSeekBar((View) param.thisObject); } } ); } private void showSeekBar(View workspace) { if (!"Workspace".equals(workspace.getClass().getSimpleName())) return; boolean isInEditingMode = (boolean) XposedHelpers.callMethod(workspace, "isInNormalEditingMode"); View mScreenSeekBar = (View) XposedHelpers.getObjectField(workspace, "mScreenSeekBar"); if (mScreenSeekBar == null) { logI(TAG, this.lpparam.packageName, "showSeekBar HideSeekPointsHook Cannot find seekbar"); return; } Context mContext = workspace.getContext(); Handler mHandler = (Handler) XposedHelpers.getAdditionalInstanceField(workspace, "mHandlerEx"); if (mHandler == null) { mHandler = new Handler(mContext.getMainLooper()) { @Override public void handleMessage(@NonNull Message msg) { View seekBar = (View) msg.obj; if (seekBar != null) seekBar.animate().alpha(0.0f).setDuration(600).withEndAction(() -> seekBar.setVisibility(View.GONE)); } }; XposedHelpers.setAdditionalInstanceField(workspace, "mHandlerEx", mHandler); } if (mHandler == null) { logI(TAG, this.lpparam.packageName, "showSeekBar HideSeekPointsHook Cannot create handler"); return; } if (mHandler.hasMessages(666)) mHandler.removeMessages(666); mScreenSeekBar.animate().cancel(); if (!isInEditingMode && points == 2) { mScreenSeekBar.setAlpha(0.0f); mScreenSeekBar.setVisibility(View.GONE); return; } mScreenSeekBar.setVisibility(View.VISIBLE); mScreenSeekBar.animate().alpha(1.0f).setDuration(300); if (!isInEditingMode) { Message msg = Message.obtain(mHandler, 666); msg.obj = mScreenSeekBar; mHandler.sendMessageDelayed(msg, 1500); } } }
[ "com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getStringAsInt" ]
[((1180, 1244), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getStringAsInt')]
package com.sevtinge.hyperceiler.module.hook.calendar; import static de.robv.android.xposed.XposedHelpers.callStaticMethod; import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.ClassMatcher; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; import java.lang.reflect.Method; public class UnlockSubscription extends BaseHook { @Override public void init() throws NoSuchMethodException { MethodData methodData1 = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .declaredClass(ClassMatcher.create() .usingStrings("Cal:D:CalendarApplicationDelegate")) .usingStrings("key_subscription_display", "key_import_todo", "key_chinese_almanac_pref", "key_weather_display", "key_ai_time_parse") .paramCount(0) ) ).singleOrThrow(() -> new IllegalStateException("UnlockSubscription: Cannot found MethodData")); Method method1 = methodData1.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "Method is " + method1); hookMethod(method1, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { 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; } }); } catch (Exception e) { logE(TAG, lpparam.packageName, "Cannot hook android.app.SharedPreferencesImpl$EditorImpl.putBoolean(String, boolean)", e); } } }); } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings(\"Cal:D:CalendarApplicationDelegate\"))\n .usingStrings(\"key_subscription_display\", \"key_import_todo\", \"key_chinese_almanac_pref\", \"key_weather_display\", \"key_ai_time_parse\")\n .paramCount(0)\n )\n ).singleOrThrow" ]
[((755, 1330), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("Cal:D:CalendarApplicationDelegate"))\n .usingStrings("key_subscription_display", "key_import_todo", "key_chinese_almanac_pref", "key_weather_display", "key_ai_time_parse")\n .paramCount(0)\n )\n ).singleOrThrow'), ((755, 1236), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((755, 788), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((800, 1226), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((845, 1208), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("Cal:D:CalendarApplicationDelegate"))\n .usingStrings("key_subscription_display", "key_import_todo", "key_chinese_almanac_pref", "key_weather_display", "key_ai_time_parse").paramCount'), ((845, 1169), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("Cal:D:CalendarApplicationDelegate")).usingStrings'), ((845, 1012), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().declaredClass'), ((907, 1011), 'org.luckypray.dexkit.query.matchers.ClassMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.powerkeeper; import androidx.annotation.NonNull; import com.github.kyuubiran.ezxhelper.HookFactory; import com.github.kyuubiran.ezxhelper.interfaces.IMethodHookCallback; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.ClassMatcher; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; import java.util.function.Consumer; import de.robv.android.xposed.XC_MethodHook; public class PreventBatteryWitelist extends BaseHook { @Override public void init() { // hookAllMethods("com.miui.powerkeeper.utils.CommonAdapter", lpparam.classLoader, "addPowerSaveWhitelistApps", new MethodHook(20000) { // @Override // protected void before(MethodHookParam param) throws Throwable { // param.setResult(null); // } // }); MethodData methodData = DexKit.INSTANCE.getDexKitBridge().findMethod( FindMethod.create() .matcher(MethodMatcher.create() .declaredClass(ClassMatcher.create() .usingStrings("addPowerSaveWhitelistApps: ")) .usingStrings("addPowerSaveWhitelistApps: ") ) ).singleOrThrow(() -> new IllegalStateException("PreventBatteryWitelist: No class found MethodData")); try { HookFactory.createMethodHook(methodData.getMethodInstance(lpparam.classLoader), new Consumer<HookFactory>() { @Override public void accept(HookFactory hookFactory) { hookFactory.before(new IMethodHookCallback() { @Override public void onMethodHooked(@NonNull XC_MethodHook.MethodHookParam methodHookParam) { String[] strArr = (String[]) methodHookParam.args[0]; if (strArr.length > 1) { methodHookParam.setResult(null); } } }); } }); } catch (NoSuchMethodException e) { logE(TAG, this.lpparam.packageName, "NoSuchMethodException: " + e); } } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(\n FindMethod.create()\n .matcher(MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings(\"addPowerSaveWhitelistApps: \"))\n .usingStrings(\"addPowerSaveWhitelistApps: \")\n )\n ).singleOrThrow" ]
[((1806, 2251), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(\n FindMethod.create()\n .matcher(MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("addPowerSaveWhitelistApps: "))\n .usingStrings("addPowerSaveWhitelistApps: ")\n )\n ).singleOrThrow'), ((1806, 2151), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1806, 1839), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1864, 2141), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1909, 2123), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("addPowerSaveWhitelistApps: ")).usingStrings'), ((1909, 2058), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().declaredClass'), ((1967, 2057), 'org.luckypray.dexkit.query.matchers.ClassMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.ui.fragment; import static com.sevtinge.hyperceiler.utils.DisplayUtils.dip2px; import static com.sevtinge.hyperceiler.utils.DisplayUtils.sp2px; import static com.sevtinge.hyperceiler.utils.api.VoyagerApisKt.isPad; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.getBaseOs; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.getRomAuthor; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isAndroidVersion; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion; import android.content.Intent; import android.content.res.Resources; import android.content.res.XmlResourceParser; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.text.SpannableString; import android.view.View; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.core.graphics.Insets; import androidx.core.view.OnApplyWindowInsetsListener; import androidx.core.view.ViewCompat; import androidx.core.view.WindowInsetsCompat; import androidx.recyclerview.widget.RecyclerView; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.prefs.PreferenceHeader; import com.sevtinge.hyperceiler.prefs.RecommendPreference; import com.sevtinge.hyperceiler.prefs.TipsPreference; import com.sevtinge.hyperceiler.ui.MainActivityContextHelper; import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; import com.sevtinge.hyperceiler.ui.fragment.helper.CantSeeAppsFragment; import com.sevtinge.hyperceiler.ui.fragment.helper.HomepageEntrance; import com.sevtinge.hyperceiler.utils.PackagesUtils; import com.sevtinge.hyperceiler.utils.ThreadPoolManager; import com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt; import com.sevtinge.hyperceiler.utils.log.AndroidLogUtils; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import java.io.IOException; import java.util.Objects; import moralnorm.preference.Preference; public class MainFragment extends SettingsPreferenceFragment implements HomepageEntrance.EntranceState { Preference mCamera; Preference mCameraNew; Preference mPowerSetting; Preference mMTB; Preference mSecurityCenter; Preference mMiLink; Preference mAod; Preference mGuardProvider; Preference mMirror; Preference mHeadtipWarn; TipsPreference mTips; MainActivityContextHelper mainActivityContextHelper; Handler mHandler = new Handler() { @Override public void handleMessage(@NonNull Message msg) { super.handleMessage(msg); if (msg.what == 0x11) { mTips.updateTips(); removeMessages(0x11); sendEmptyMessageDelayed(0x11, 6000); } } }; private final String TAG = "MainFragment"; public static final String ANDROID_NS = "http://schemas.android.com/apk/res/android"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Message message = mHandler.obtainMessage(0x11); mHandler.sendMessageDelayed(message, 6000); } @Override public int getContentResId() { return R.xml.prefs_main; } @Override public void initPrefs() { HomepageEntrance.setEntranceStateListen(this); Resources resources = getResources(); ThreadPoolManager.getInstance().submit(() -> { try (XmlResourceParser xml = resources.getXml(R.xml.prefs_set_homepage_entrance)) { try { int event = xml.getEventType(); while (event != XmlPullParser.END_DOCUMENT) { if (event == XmlPullParser.START_TAG) { if (xml.getName().equals("SwitchPreference")) { String key = xml.getAttributeValue(ANDROID_NS, "key"); if (key != null) { String checkKey = key.replace("_state", ""); boolean state = getSharedPreferences().getBoolean(key, true); if (!state) { PreferenceHeader preferenceHeader = findPreference(checkKey); if (preferenceHeader != null) { boolean visible = preferenceHeader.isVisible(); if (visible) { preferenceHeader.setVisible(false); } } } } } } event = xml.next(); } } catch (XmlPullParserException | IOException e) { AndroidLogUtils.logE(TAG, "An error occurred when reading the XML:", e); } } }); mCamera = findPreference("prefs_key_camera"); mCameraNew = findPreference("prefs_key_camera_new"); mPowerSetting = findPreference("prefs_key_powerkeeper"); mMTB = findPreference("prefs_key_mtb"); mSecurityCenter = findPreference("prefs_key_security_center"); mMiLink = findPreference("prefs_key_milink"); mAod = findPreference("prefs_key_aod"); mGuardProvider = findPreference("prefs_key_guardprovider"); mMirror = findPreference("prefs_key_mirror"); mTips = findPreference("prefs_key_tips"); mHeadtipWarn = findPreference("prefs_key_headtip_warn"); mCamera.setVisible(!isMoreHyperOSVersion(1f) && !PackagesUtils.checkAppStatus(getContext(), "com.android.camera")); mCameraNew.setVisible(isMoreHyperOSVersion(1f) && !PackagesUtils.checkAppStatus(getContext(), "com.android.camera")); mPowerSetting.setVisible(!isAndroidVersion(30) && !PackagesUtils.checkAppStatus(getContext(), "com.miui.powerkeeper")); mMTB.setVisible(!isAndroidVersion(30) && !PackagesUtils.checkAppStatus(getContext(), "com.xiaomi.mtb")); if (isMoreHyperOSVersion(1f)) { mAod.setTitle(R.string.aod_hyperos); mMiLink.setTitle(R.string.milink_hyperos); mGuardProvider.setTitle(R.string.guard_provider_hyperos); mMirror.setTitle(R.string.mirror_hyperos); mSecurityCenter.setTitle(R.string.security_center_hyperos); } else { mAod.setTitle(R.string.aod); mMiLink.setTitle(R.string.milink); mGuardProvider.setTitle(R.string.guard_provider); mMirror.setTitle(R.string.mirror); if (isPad()) { mSecurityCenter.setTitle(R.string.security_center_pad); } else { mSecurityCenter.setTitle(R.string.security_center); } } mainActivityContextHelper = new MainActivityContextHelper(requireContext()); isOfficialRom(); if (!getIsOfficialRom()) isSignPass(); mTips = findPreference("prefs_key_tips"); } public void isOfficialRom() { mHeadtipWarn.setTitle(R.string.headtip_warn_not_offical_rom); mHeadtipWarn.setVisible(getIsOfficialRom()); } public boolean getIsOfficialRom() { return ( !getBaseOs().startsWith("V") && !getBaseOs().startsWith("Xiaomi") && !getBaseOs().startsWith("Redmi") && !getBaseOs().startsWith("POCO") && !getBaseOs().isEmpty() ) || !getRomAuthor().isEmpty() || Objects.equals(SystemSDKKt.getHost(), "xiaomi.eu") || ( !SystemSDKKt.getHost().startsWith("pangu-build-component-system") && !SystemSDKKt.getHost().startsWith("non-pangu-pod-g0sww") ); } public void isSignPass() { mHeadtipWarn.setTitle(R.string.headtip_warn_sign_verification_failed); mHeadtipWarn.setVisible(!mainActivityContextHelper.isSignCheckPass()); } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); RecyclerView recyclerView = view.findViewById(moralnorm.preference.R.id.recycler_view); ViewCompat.setOnApplyWindowInsetsListener(recyclerView, new OnApplyWindowInsetsListener() { @NonNull @Override public WindowInsetsCompat onApplyWindowInsets(@NonNull View v, @NonNull WindowInsetsCompat insets) { Insets inset = Insets.max(insets.getInsets(WindowInsetsCompat.Type.systemBars()), insets.getInsets(WindowInsetsCompat.Type.displayCutout())); // 22dp + 2dp + 12sp + 10dp + 18dp + 0.5dp + inset.bottom + 4dp(?) v.setPadding(inset.left, 0, inset.right, inset.bottom + dip2px(requireContext(), 56.5F) + sp2px(requireContext(), 12)); return insets; } }); } @Override public void onEntranceStateChange(String key, boolean state) { String mainKey = key.replace("_state", ""); PreferenceHeader preferenceHeader = findPreference(mainKey); if (preferenceHeader != null) { boolean last = preferenceHeader.isVisible(); if (!last || state) return; preferenceHeader.setVisible(false); } } }
[ "com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.getHost().startsWith", "com.sevtinge.hyperceiler.utils.ThreadPoolManager.getInstance().submit" ]
[((4166, 5849), 'com.sevtinge.hyperceiler.utils.ThreadPoolManager.getInstance().submit'), ((8633, 8697), 'com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.getHost().startsWith'), ((8734, 8789), 'com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.getHost().startsWith'), ((9583, 9619), 'androidx.core.view.WindowInsetsCompat.Type.systemBars'), ((9663, 9702), 'androidx.core.view.WindowInsetsCompat.Type.displayCutout')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.utils.log; import static com.sevtinge.hyperceiler.utils.log.XposedLogUtils.mPrefsMap; import com.sevtinge.hyperceiler.BuildConfig; public class LogManager { public static final int logLevel = getLogLevel(); public static int getLogLevel() { int level = mPrefsMap.getStringAsInt("log_level", 2); if (BuildConfig.BUILD_TYPE.equals("canary")) { return level == 0 ? 3 : 4; } return level; } public static String logLevelDesc() { return switch (logLevel) { case 0 -> ("Disable"); case 1 -> ("Error"); case 2 -> ("Warn"); case 3 -> ("Info"); case 4 -> ("Debug"); default -> ("Unknown"); }; } }
[ "com.sevtinge.hyperceiler.BuildConfig.BUILD_TYPE.equals" ]
[((1094, 1133), 'com.sevtinge.hyperceiler.BuildConfig.BUILD_TYPE.equals')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.home.folder; import android.content.Context; import android.graphics.LinearGradient; import android.graphics.Shader; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.PaintDrawable; import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.shapes.RectShape; import android.os.Handler; import android.view.View; import androidx.annotation.NonNull; import com.sevtinge.hyperceiler.XposedInit; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils; import de.robv.android.xposed.XposedHelpers; public class FolderShade extends BaseHook { private Class<?> mWallpaperUtilsCls = null; private boolean isLight = false; @Override public void init() { mWallpaperUtilsCls = XposedHelpers.findClassIfExists("com.miui.home.launcher.WallpaperUtils", lpparam.classLoader); MethodHook hook = new MethodHook() { @Override protected void after(MethodHookParam param) { View folder = (View) param.thisObject; new Thread(() -> { try { Context context = folder.getContext(); int opt = Integer.parseInt(PrefsUtils.getSharedStringPrefs(context, "prefs_key_home_folder_shade", "0")); int level = PrefsUtils.getSharedIntPrefs(context, "prefs_key_home_folder_shade_level", 40); if (mWallpaperUtilsCls != null) { try { isLight = (boolean) XposedHelpers.callStaticMethod(mWallpaperUtilsCls, "hasAppliedLightWallpaper"); } catch (Throwable tr) { logW(TAG, "isLight is abnormal", tr); } } Drawable bkg; if (opt == 1) { int bgColor = (isLight ? 0x00ffffff : 0x00000000) | (Math.round(255 * level / 100f) * 0x1000000); bkg = new ColorDrawable(bgColor); } else if (opt == 2) { bkg = getPaintDrawable(level); } else { bkg = null; } new Handler(context.getMainLooper()).post(() -> { XposedInit.mPrefsMap.put("prefs_key_home_folder_shade", String.valueOf(opt)); XposedInit.mPrefsMap.put("prefs_key_home_folder_shade_level", level); folder.setBackground(bkg); }); } catch (Throwable t) { logW(TAG, "", t); } }).start(); } }; hookAllConstructors("com.miui.home.launcher.FolderCling", hook); findAndHookMethod("com.miui.home.launcher.FolderCling", "onWallpaperColorChanged", hook); findAndHookMethod("com.miui.home.launcher.FolderCling", "updateLayout", boolean.class, hook); findAndHookMethod("com.miui.home.launcher.Folder", "setBackgroundAlpha", float.class, new MethodHook() { @Override protected void after(MethodHookParam param) { int opt = mPrefsMap.getStringAsInt("home_folder_shade", 0); Object mLauncher = XposedHelpers.getObjectField(param.thisObject, "mLauncher"); View folderCling = (View) XposedHelpers.callMethod(mLauncher, "getFolderCling"); if (opt == 1 || mLauncher == null || folderCling == null) return; Drawable bkg = folderCling.getBackground(); if (bkg != null) bkg.setAlpha(Math.round((float) param.args[0] * 255)); } }); } @NonNull private PaintDrawable getPaintDrawable(int level) { PaintDrawable pd = new PaintDrawable(); pd.setShape(new RectShape()); pd.setShaderFactory(new ShapeDrawable.ShaderFactory() { @Override public Shader resize(int width, int height) { int bgColor1 = (isLight ? 0x00ffffff : 0x00000000) | (Math.round(255 / 6f * level / 100f) * 0x1000000); int bgColor2 = (isLight ? 0x00ffffff : 0x00000000) | (Math.round(255 * level / 100f) * 0x1000000); return new LinearGradient( 0, 0, 0, height, new int[]{bgColor1, bgColor2, bgColor2, bgColor1}, new float[]{0.0f, 0.25f, 0.65f, 1.0f}, Shader.TileMode.CLAMP ); } }); return pd; } }
[ "com.sevtinge.hyperceiler.XposedInit.mPrefsMap.put" ]
[((3250, 3326), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.put'), ((3356, 3424), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.put')]
package com.sevtinge.hyperceiler.ui.fragment.systemui.statusbar; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion; import android.view.View; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.ui.base.BaseSettingsActivity; import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils; import moralnorm.preference.DropDownPreference; import moralnorm.preference.SeekBarPreferenceEx; import moralnorm.preference.SwitchPreference; public class IconManageNewSettings extends SettingsPreferenceFragment { DropDownPreference mAlarmClockIcon; SeekBarPreferenceEx mAlarmClockIconN; SeekBarPreferenceEx mNotificationIconMaximum; SeekBarPreferenceEx mNotificationIconColumns; SwitchPreference mBatteryNumber; SwitchPreference mBatteryPercentage; @Override public int getContentResId() { return R.xml.system_ui_status_bar_icon_manage_new; } @Override public View.OnClickListener addRestartListener() { return view -> ((BaseSettingsActivity) getActivity()).showRestartDialog( getResources().getString(R.string.system_ui), "com.android.systemui" ); } @Override public void initPrefs() { mAlarmClockIcon = findPreference("prefs_key_system_ui_status_bar_icon_alarm_clock"); mAlarmClockIconN = findPreference("prefs_key_system_ui_status_bar_icon_alarm_clock_n"); mNotificationIconMaximum = findPreference("prefs_key_system_ui_status_bar_notification_icon_maximum"); mBatteryNumber = findPreference("prefs_key_system_ui_status_bar_battery_percent"); mBatteryPercentage = findPreference("prefs_key_system_ui_status_bar_battery_percent_mark"); mNotificationIconColumns = findPreference("prefs_key_system_ui_status_bar_notification_icon_maximum"); mNotificationIconColumns.setDefaultValue(isMoreHyperOSVersion(1f) ? 1 : 3); mAlarmClockIconN.setVisible(Integer.parseInt(PrefsUtils.mSharedPreferences.getString("prefs_key_system_ui_status_bar_icon_alarm_clock", "0")) == 3); mAlarmClockIcon.setOnPreferenceChangeListener((preference, o) -> { mAlarmClockIconN.setVisible(Integer.parseInt((String) o) == 3); return true; }); mNotificationIconMaximum.setOnPreferenceChangeListener((preference, o) -> { if ((int) o == 16) { mNotificationIconMaximum.setValue(R.string.unlimited); } return true; }); mBatteryNumber.setOnPreferenceChangeListener((preference, o) -> { if (!(boolean) o) { mBatteryPercentage.setChecked(false); } return true; }); } }
[ "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getString" ]
[((2054, 2149), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getString')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.utils; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Intent; import android.content.SharedPreferences; import android.net.Uri; import androidx.annotation.Nullable; import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils; import org.json.JSONException; import org.json.JSONObject; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; public class BackupUtils { public static final int CREATE_DOCUMENT_CODE = 255774; public static final int OPEN_DOCUMENT_CODE = 277451; public static final String BACKUP_FILE_NAME = "HyperCeiler_settings_backup"; public static void backup(Activity activity) { @SuppressLint("SimpleDateFormat") String backupFileName = BACKUP_FILE_NAME + new SimpleDateFormat("_yyyy-MM-dd-HH:mm:ss").format(new java.util.Date()); Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT); intent.addCategory(Intent.CATEGORY_OPENABLE); intent.setType("application/json"); intent.putExtra(Intent.EXTRA_TITLE, backupFileName); activity.startActivityForResult(intent, CREATE_DOCUMENT_CODE); } public static void restore(Activity activity) { Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); intent.addCategory(Intent.CATEGORY_OPENABLE); intent.setType("application/json"); intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, false); activity.startActivityForResult(intent, OPEN_DOCUMENT_CODE); } public static void handleCreateDocument(Activity activity, @Nullable Uri data) throws IOException, JSONException { if (data == null) return; OutputStream outputStream = activity.getContentResolver().openOutputStream(data); BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(outputStream)); JSONObject jsonObject = new JSONObject(); for (Map.Entry<String, ?> entry : PrefsUtils.mSharedPreferences.getAll().entrySet()) { jsonObject.put(entry.getKey(), entry.getValue()); } bufferedWriter.write(jsonObject.toString()); bufferedWriter.close(); } public static void handleReadDocument(Activity activity, @Nullable Uri data) throws IOException, JSONException { if (data == null) return; SharedPreferences.Editor edit = PrefsUtils.mSharedPreferences.edit(); InputStream inputStream = activity.getContentResolver().openInputStream(data); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); StringBuilder stringBuilder = new StringBuilder(); String line = bufferedReader.readLine(); while (line != null) { stringBuilder.append(line); line = bufferedReader.readLine(); } String read = stringBuilder.toString(); JSONObject jsonObject = new JSONObject(read); Iterator<String> keys = jsonObject.keys(); while (keys.hasNext()) { String key = keys.next(); Object value = jsonObject.get(key); if (value instanceof String) { if (((String) value).contains("[") && ((String) value).contains("]")) { value = ((String) value).replace("[", "").replace("]", "").replace(" ", ""); String[] array = ((String) value).split(","); List<String> list = Arrays.asList(array); Set<String> stringSet = new HashSet<>(list); edit.putStringSet(key, stringSet); } else { edit.putString(key, (String) value); } } else if (value instanceof Boolean) { edit.putBoolean(key, (Boolean) value); } else if (value instanceof Integer) { edit.putInt(key, (Integer) value); } } bufferedReader.close(); edit.apply(); } }
[ "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getAll", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getAll().entrySet" ]
[((3019, 3068), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getAll().entrySet'), ((3019, 3057), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getAll'), ((3427, 3463), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit')]
package com.sevtinge.hyperceiler.module.hook.securitycenter.battery; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindClass; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.ClassMatcher; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.ClassData; import org.luckypray.dexkit.result.ClassDataList; import org.luckypray.dexkit.result.MethodData; import org.luckypray.dexkit.result.MethodDataList; import java.lang.reflect.Method; public class PowerConsumptionRanking extends BaseHook { @Override public void init() throws NoSuchMethodException { ClassDataList data = DexKit.INSTANCE.getDexKitBridge().findClass( FindClass.create() .matcher(ClassMatcher.create() .usingStrings("%d %s %d %s") ) ); MethodDataList methodDataList = DexKit.INSTANCE.getDexKitBridge().findMethod( FindMethod.create() .matcher(MethodMatcher.create() .declaredClass(ClassMatcher.create() .usingStrings("ro.miui.ui.version.code")) .usingNumbers(9) .returnType(boolean.class) ) ); for (ClassData clazzData : data) { try { logI(TAG, lpparam.packageName, "Current hooking clazz is " + clazzData.getInstance(lpparam.classLoader)); try { hookAllConstructors(clazzData.getInstance(lpparam.classLoader), new MethodHook() { @Override protected void before(MethodHookParam param) throws NoSuchMethodException { for (MethodData methodData : methodDataList) { Method method = methodData.getMethodInstance(lpparam.classLoader); logI(TAG, lpparam.packageName, "Current hooking method is " + method); try { hookMethod(method, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { param.setResult(false); } }); } catch (Exception ignore) { } } } }); } catch (Exception ignored) { } } catch (ClassNotFoundException e) { logE(TAG, lpparam.packageName, "Cannot found any clazz" + e); } } } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findClass", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod" ]
[((772, 971), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findClass'), ((772, 805), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((829, 961), 'org.luckypray.dexkit.query.FindClass.create().matcher'), ((873, 943), 'org.luckypray.dexkit.query.matchers.ClassMatcher.create().usingStrings'), ((1013, 1373), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1013, 1046), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1071, 1363), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1116, 1345), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("ro.miui.ui.version.code"))\n .usingNumbers(9).returnType'), ((1116, 1298), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("ro.miui.ui.version.code")).usingNumbers'), ((1116, 1261), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().declaredClass'), ((1174, 1260), 'org.luckypray.dexkit.query.matchers.ClassMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.securitycenter.sidebar; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; import java.lang.reflect.Method; public class DockSuggest extends BaseHook { @Override public void init() throws NoSuchMethodException { MethodData methodData = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .usingStrings("supportFreeform") ) ).singleOrThrow(() -> new RuntimeException("Method not found")); Method method = methodData.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "Current hooking method is " + method); hookMethod(method, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { if (mPrefsMap.getStringAsInt("security_center_sidebar_show_suggest", 0) == 1) { param.setResult(false); } else if (mPrefsMap.getStringAsInt("security_center_sidebar_show_suggest", 0) == 2) { param.setResult(true); } } }); } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(\"supportFreeform\")\n )\n ).singleOrThrow", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod" ]
[((1248, 1491), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings("supportFreeform")\n )\n ).singleOrThrow'), ((1248, 1429), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1248, 1281), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1293, 1419), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1334, 1405), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.securitycenter; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; import java.lang.reflect.Method; public class EnableGameSpeed extends BaseHook { @Override public void init() throws NoSuchMethodException { MethodData getPropVoidData = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .usingStrings("android.os.SystemProperties", "set", "SystemPropertiesUtils", "SystemPropertiesUtils getInt:") .returnType(void.class) ) ).singleOrThrow(() -> new IllegalStateException("EnableGameSpeed: Cannot found getPropVoid method")); Method getPropVoid = getPropVoidData.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "getPropVoid method is " + getPropVoid); hookMethod(getPropVoid, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { if (param.args[0] == "debug.game.video.speed") param.args[1] = "true"; } }); MethodData getPropBooleanData = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .usingStrings("android.os.SystemProperties", "getBoolean", "SystemPropertiesUtils", "SystemPropertiesUtils getInt:") .returnType(boolean.class) ) ).singleOrThrow(() -> new IllegalStateException("EnableGameSpeed: Cannot found getPropBoolean method")); Method getBooleanVoid = getPropBooleanData.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "getPropBoolean method is " + getBooleanVoid); hookMethod(getBooleanVoid, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { if (param.args[0] == "debug.game.video.support") param.setResult(true); } }); MethodData methodData1 = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .usingStrings("debug.game.video.support") .returnType(boolean.class) ) ).singleOrThrow(() -> new IllegalStateException("EnableGameSpeed: Cannot found MethodData usingString \"debug.game.video.support\"")); Method method1 = methodData1.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "UsingString \"debug.game.video.support\" method is " + method1); hookMethod(method1, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { param.setResult(true); } }); MethodData methodData2 = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .usingStrings("pref_open_game_booster") .returnType(boolean.class) ) ).singleOrThrow(() -> new IllegalStateException("EnableGameSpeed: Cannot found MethodData usingString \"pref_open_game_booster\"")); Method method2 = methodData2.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "UsingString \"pref_open_game_booster\" method is " + method2); hookMethod(method2, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { param.setResult(true); } }); MethodData methodData3 = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .usingStrings("debug.game.video.boot") ) ).singleOrThrow(() -> new IllegalStateException("EnableGameSpeed: Cannot found MethodData usingString \"debug.game.video.boot\"")); Method method3 = methodData3.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "UsingString \"debug.game.video.boot\" method is " + method3); hookMethod(method3, new MethodHook() { @Override protected void before(MethodHookParam param) { mSetProp(); param.setResult(null); } }); findAndHookMethod("com.miui.gamebooster.service.GameBoosterService", "onCreate", new MethodHook() { @Override protected void after(MethodHookParam param) { mSetProp(); } } ); } public void mSetProp() { setProp("debug.game.video.boot", "true"); setProp("debug.game.video.speed", "true"); } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(\"android.os.SystemProperties\", \"set\", \"SystemPropertiesUtils\", \"SystemPropertiesUtils getInt:\")\n .returnType(void.class)\n )\n ).singleOrThrow", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(\"android.os.SystemProperties\", \"getBoolean\", \"SystemPropertiesUtils\", \"SystemPropertiesUtils getInt:\")\n .returnType(boolean.class)\n )\n ).singleOrThrow", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(\"debug.game.video.boot\")\n )\n ).singleOrThrow", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(\"pref_open_game_booster\")\n .returnType(boolean.class)\n )\n ).singleOrThrow", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(\"debug.game.video.support\")\n .returnType(boolean.class)\n )\n ).singleOrThrow" ]
[((1250, 1647), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings("android.os.SystemProperties", "set", "SystemPropertiesUtils", "SystemPropertiesUtils getInt:")\n .returnType(void.class)\n )\n ).singleOrThrow'), ((1250, 1548), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1250, 1283), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1295, 1538), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1336, 1524), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .usingStrings("android.os.SystemProperties", "set", "SystemPropertiesUtils", "SystemPropertiesUtils getInt:").returnType'), ((1336, 1484), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings'), ((2117, 2527), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings("android.os.SystemProperties", "getBoolean", "SystemPropertiesUtils", "SystemPropertiesUtils getInt:")\n .returnType(boolean.class)\n )\n ).singleOrThrow'), ((2117, 2425), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((2117, 2150), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((2162, 2415), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((2203, 2401), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .usingStrings("android.os.SystemProperties", "getBoolean", "SystemPropertiesUtils", "SystemPropertiesUtils getInt:").returnType'), ((2203, 2358), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings'), ((3006, 3371), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings("debug.game.video.support")\n .returnType(boolean.class)\n )\n ).singleOrThrow'), ((3006, 3239), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((3006, 3039), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((3051, 3229), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((3092, 3215), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .usingStrings("debug.game.video.support").returnType'), ((3092, 3172), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings'), ((3799, 4160), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings("pref_open_game_booster")\n .returnType(boolean.class)\n )\n ).singleOrThrow'), ((3799, 4030), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((3799, 3832), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((3844, 4020), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((3885, 4006), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .usingStrings("pref_open_game_booster").returnType'), ((3885, 3963), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings'), ((4586, 4902), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings("debug.game.video.boot")\n )\n ).singleOrThrow'), ((4586, 4773), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((4586, 4619), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((4631, 4763), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((4672, 4749), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.ui.fragment; import android.view.View; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.ui.base.BaseSettingsActivity; import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; import com.sevtinge.hyperceiler.utils.shell.ShellInit; import moralnorm.preference.Preference; public class PhoneFragment extends SettingsPreferenceFragment { Preference mPhone; @Override public int getContentResId() { return R.xml.phone; } @Override public View.OnClickListener addRestartListener() { return view -> ((BaseSettingsActivity) getActivity()).showRestartDialog( getResources().getString(R.string.phone), "com.android.phone" ); } @Override public void initPrefs() { mPhone = findPreference("prefs_key_phone_additional_network_settings"); mPhone.setOnPreferenceClickListener( preference -> { ShellInit.getShell().run("am start -n com.android.phone/.SwitchDebugActivity").sync(); return true; } ); } }
[ "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run(\"am start -n com.android.phone/.SwitchDebugActivity\").sync", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run" ]
[((1707, 1792), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run("am start -n com.android.phone/.SwitchDebugActivity").sync'), ((1707, 1785), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.base; import com.github.kyuubiran.ezxhelper.EzXHelper; import com.sevtinge.hyperceiler.XposedInit; import com.sevtinge.hyperceiler.module.base.dexkit.InitDexKit; import com.sevtinge.hyperceiler.utils.ContextUtils; import com.sevtinge.hyperceiler.utils.api.ProjectApi; import com.sevtinge.hyperceiler.utils.log.XposedLogUtils; import com.sevtinge.hyperceiler.utils.prefs.PrefsMap; import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam; public abstract class BaseModule implements IXposedHook { public LoadPackageParam mLoadPackageParam = null; public String TAG = getClass().getSimpleName(); public static ILoadDexKit loadDexKit; public final PrefsMap<String, Object> mPrefsMap = XposedInit.mPrefsMap; public interface ILoadDexKit { void createDexKit(LoadPackageParam lpparam, String TAG); } public static void setLoadDexKit(ILoadDexKit iLoadDexKit) { loadDexKit = iLoadDexKit; } public void init(LoadPackageParam lpparam) { EzXHelper.initHandleLoadPackage(lpparam); EzXHelper.setLogTag(TAG); EzXHelper.setToastTag(TAG); // 把模块资源加载到目标应用 try { if (!ProjectApi.mAppModulePkg.equals(lpparam.packageName)) { ContextUtils.getWaitContext( context -> { if (context != null) { BaseXposedInit.mResHook.loadModuleRes(context); // mResHook.loadModuleRes(context); } }, "android".equals(lpparam.packageName)); } } catch (Throwable e) { XposedLogUtils.logE(TAG, "get context failed!" + e); } mLoadPackageParam = lpparam; initZygote(); DexKitHelper helper = new DexKitHelper(); InitDexKit kit = new InitDexKit(); loadDexKit.createDexKit(mLoadPackageParam, TAG); handleLoadPackage(); if (helper.useDexKit) { try { kit.closeHostDir(); // XposedLogUtils.logE(TAG, "close dexkit s: " + lpparam.packageName); } catch (Exception e) { XposedLogUtils.logE(TAG, "close dexkit failed!" + e); } } } @Override public void initZygote() { } public void initHook(BaseHook baseHook) { initHook(baseHook, true); } public void initHook(BaseHook baseHook, boolean isInit) { if (isInit) { baseHook.onCreate(mLoadPackageParam); } } private static class DexKitHelper implements InitDexKit.IUseDexKit { public boolean useDexKit = false; public DexKitHelper() { InitDexKit.setUseDexKit(this); } @Override public void useDexKit(boolean use) { useDexKit = use; } } }
[ "com.sevtinge.hyperceiler.utils.api.ProjectApi.mAppModulePkg.equals" ]
[((1963, 2015), 'com.sevtinge.hyperceiler.utils.api.ProjectApi.mAppModulePkg.equals')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.systemui.controlcenter; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreAndroidVersion; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.database.ContentObserver; import android.os.Build; import android.os.Handler; import android.provider.Settings; import android.util.ArrayMap; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.utils.TileUtils; import com.sevtinge.hyperceiler.utils.devicesdk.TelephonyManager; import de.robv.android.xposed.XC_MethodHook.MethodHookParam; import de.robv.android.xposed.XposedHelpers; public class FiveGTile extends TileUtils { String mNfcTileClsName = isMoreAndroidVersion(Build.VERSION_CODES.TIRAMISU) ? "com.android.systemui.qs.tiles.MiuiNfcTile" : "com.android.systemui.qs.tiles.NfcTile"; boolean Style = mPrefsMap.getStringAsInt("system_control_center_5g_new_tile", 0) == 1; @Override public void init() { super.init(); } @Override public Class<?> customClass() { return findClassIfExists(mNfcTileClsName); } @Override public String setTileProvider() { return isMoreAndroidVersion(Build.VERSION_CODES.TIRAMISU) ? "nfcTileProvider" : "mNfcTileProvider"; } @Override public String customName() { return "custom_5G"; } @Override public int customRes() { return R.string.system_control_center_5g_toggle_label; } @Override public void tileCheck(MethodHookParam param, String tileName) { // 获取设置是否支持5G param.setResult(TelephonyManager.getDefault().isFiveGCapable()); } @Override public void tileLongClickIntent(MethodHookParam param, String tileName) { Intent intent = new Intent(Intent.ACTION_MAIN); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); intent.setComponent(new ComponentName("com.android.phone", "com.android.phone.settings.MiuiFiveGNetworkSetting")); // 原活动是 com.android.phone.settings.PreferredNetworkTypeListPreference param.setResult(intent); } @Override public void tileClick(MethodHookParam param, String tileName) { TelephonyManager manager = TelephonyManager.getDefault(); // 切换5G状态 manager.setUserFiveGEnabled(!manager.isUserFiveGEnabled()); // 更新磁贴状态 XposedHelpers.callMethod(param.thisObject, "refreshState"); } @Override public void tileListening(MethodHookParam param, String tileName) { Context mContext = (Context) XposedHelpers.getObjectField(param.thisObject, "mContext"); boolean mListening = (boolean) param.args[0]; if (mListening) { ContentObserver contentObserver = new ContentObserver(new Handler(mContext.getMainLooper())) { @Override public void onChange(boolean z) { XposedHelpers.callMethod(param.thisObject, "refreshState"); } }; mContext.getContentResolver().registerContentObserver(Settings.Global.getUriFor("fiveg_user_enable"), false, contentObserver); mContext.getContentResolver().registerContentObserver(Settings.Global.getUriFor("dual_nr_enabled"), false, contentObserver); XposedHelpers.setAdditionalInstanceField(param.thisObject, "tileListener", contentObserver); } else { ContentObserver contentObserver = (ContentObserver) XposedHelpers.getAdditionalInstanceField(param.thisObject, "tileListener"); mContext.getContentResolver().unregisterContentObserver(contentObserver); } } @Override public ArrayMap<String, Integer> tileUpdateState(MethodHookParam param, Class<?> mResourceIcon, String tileName) { boolean isEnable; TelephonyManager manager = TelephonyManager.getDefault(); isEnable = manager.isUserFiveGEnabled(); ArrayMap<String, Integer> tileResMap = new ArrayMap<>(); tileResMap.put("custom_5G_Enable", isEnable ? 1 : 0); tileResMap.put("custom_5G_ON", Style ? R.drawable.ic_control_center_5g_toggle_on : R.drawable.ic_control_center_5g_toggle_v2_on); tileResMap.put("custom_5G_OFF", Style ? R.drawable.ic_control_center_5g_toggle_off : R.drawable.ic_control_center_5g_toggle_v2_off); return tileResMap; } }
[ "com.sevtinge.hyperceiler.utils.devicesdk.TelephonyManager.getDefault().isFiveGCapable" ]
[((2395, 2441), 'com.sevtinge.hyperceiler.utils.devicesdk.TelephonyManager.getDefault().isFiveGCapable'), ((3920, 3966), 'android.provider.Settings.Global.getUriFor'), ((4059, 4103), 'android.provider.Settings.Global.getUriFor')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.home.dock; import android.app.Activity; import android.content.Context; import android.graphics.Color; import android.graphics.drawable.GradientDrawable; import android.os.Build; import android.os.Bundle; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; import com.sevtinge.hyperceiler.XposedInit; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.utils.DisplayUtils; import com.sevtinge.hyperceiler.utils.blur.BlurUtils; import de.robv.android.xposed.XposedHelpers; public class DockCustom extends BaseHook { FrameLayout mDockView; boolean isFolderShowing; boolean isShowEditPanel; boolean isRecentShowing; Class<?> mLauncherCls; Class<?> mLauncherStateCls; Class<?> mDeviceConfigCls; Class<?> mFolderInfo; Class<?> mBlurUtils; @Override public void init() { mLauncherCls = findClassIfExists("com.miui.home.launcher.Launcher"); mLauncherStateCls = findClassIfExists("com.miui.home.launcher.LauncherState"); mDeviceConfigCls = findClassIfExists("com.miui.home.launcher.DeviceConfig"); mFolderInfo = findClassIfExists("com.miui.home.launcher.FolderInfo"); mBlurUtils = findClassIfExists("com.miui.home.launcher.common.BlurUtils"); findAndHookMethod(mLauncherCls, "onCreate", Bundle.class, new MethodHook() { @Override protected void after(MethodHookParam param) { Activity mActivity = (Activity) param.thisObject; FrameLayout mSearchBarContainer = (FrameLayout) XposedHelpers.callMethod(param.thisObject, "getSearchBarContainer"); FrameLayout mSearchEdgeLayout = (FrameLayout) mSearchBarContainer.getParent(); int mDockHeight = DisplayUtils.dip2px(mSearchBarContainer.getContext(), XposedInit.mPrefsMap.getInt("home_dock_bg_height", 80)); int mDockMargin = DisplayUtils.dip2px(mSearchBarContainer.getContext(), XposedInit.mPrefsMap.getInt("home_dock_bg_margin_horizontal", 30)); int mDockBottomMargin = DisplayUtils.dip2px(mSearchBarContainer.getContext(), XposedInit.mPrefsMap.getInt("home_dock_bg_margin_bottom", 30)); mDockView = new FrameLayout(mSearchBarContainer.getContext()); FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, mDockHeight); layoutParams.gravity = Gravity.BOTTOM; layoutParams.setMargins(mDockMargin, 0, mDockMargin, mDockBottomMargin); mDockView.setLayoutParams(layoutParams); mSearchEdgeLayout.addView(mDockView, 0); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { new BlurUtils(mDockView, "home_dock_bg_custom"); } findAndHookMethod(mLauncherCls, "isFolderShowing", new MethodHook() { @Override protected void after(MethodHookParam param) { isFolderShowing = (boolean) param.getResult(); } }); findAndHookMethod(mLauncherCls, "showEditPanel", boolean.class, new MethodHook() { @Override protected void after(MethodHookParam param) { isShowEditPanel = (boolean) param.args[0]; mDockView.setVisibility(isShowEditPanel ? View.GONE : View.VISIBLE); } }); findAndHookMethod(mLauncherCls, "openFolder", mFolderInfo, View.class, new MethodHook() { @Override protected void after(MethodHookParam param) { mDockView.setVisibility(View.GONE); } }); findAndHookMethod(mLauncherCls, "closeFolder", boolean.class, new MethodHook() { @Override protected void after(MethodHookParam param) { if (!isShowEditPanel) mDockView.setVisibility(View.VISIBLE); } }); findAndHookMethod(mBlurUtils, "fastBlurWhenEnterRecents", mLauncherCls, mLauncherStateCls, boolean.class, new MethodHook() { @Override protected void after(MethodHookParam param) { mDockView.setVisibility(View.GONE); } }); } }); findAndHookMethod(mLauncherCls, "onStateSetStart", mLauncherStateCls, new MethodHook() { @Override protected void after(MethodHookParam param) { Boolean mLauncherState = param.args[0].getClass().getSimpleName().equals("LauncherState"); Boolean mNormalState = param.args[0].getClass().getSimpleName().equals("NormalState"); if ((mLauncherState || mNormalState) && !isFolderShowing && !isShowEditPanel) { mDockView.setVisibility(View.VISIBLE); } else { mDockView.setVisibility(View.GONE); } } }); /*findAndHookMethod(mDeviceConfigCls,"calcHotSeatsMarginTop", Context.class, boolean.class, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { Context context = (Context) param.args[0]; param.setResult(DisplayUtils.dip2px(context, XposedInit.mPrefsMap.getInt("home_dock_margin_top",25))); } }); findAndHookMethod(mDeviceConfigCls,"calcHotSeatsMarginBottom", Context.class, boolean.class, boolean.class, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { Context context = (Context) param.args[0]; param.setResult(DisplayUtils.dip2px(context, XposedInit.mPrefsMap.getInt("home_dock_icon_margin_bottom",90))); } });*/ } public GradientDrawable getDockBackground(Context context) { GradientDrawable mDockBackground = new GradientDrawable(); mDockBackground.setShape(GradientDrawable.RECTANGLE); mDockBackground.setColor(Color.argb(60, 255, 255, 255)); mDockBackground.setCornerRadius(DisplayUtils.dip2px(context, 22)); return mDockBackground; } }
[ "com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getInt" ]
[((2660, 2714), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getInt'), ((2805, 2870), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getInt'), ((2967, 3028), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getInt')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.camera; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; import java.lang.reflect.Method; import java.util.Objects; public class EnableLabOptions extends BaseHook { @Override public void init() throws NoSuchMethodException { MethodData methodData = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .usingStrings("getBoolean", "SystemProperties", "Exception while getting system property: ") ) ).singleOrThrow(() -> new IllegalStateException("EnableLabOptions: Cannot found MethodData")); Method method = methodData.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "Unlock camera.lab.options method is " + method); hookMethod(method, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { String mStr = (String) param.args[0]; if (Objects.equals(mStr, "camera.lab.options")) param.setResult(true); } }); } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(\"getBoolean\", \"SystemProperties\", \"Exception while getting system property: \")\n )\n ).singleOrThrow" ]
[((1263, 1596), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings("getBoolean", "SystemProperties", "Exception while getting system property: ")\n )\n ).singleOrThrow'), ((1263, 1504), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1263, 1296), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1308, 1494), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1349, 1480), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.data.adapter; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.CheckBox; import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.sevtinge.hyperceiler.callback.IEditCallback; import com.sevtinge.hyperceiler.data.AppData; import com.sevtinge.hyperceiler.ui.fragment.sub.AppPicker; import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils; import java.util.ArrayList; import java.util.Collection; import java.util.LinkedHashSet; import java.util.List; import java.util.Random; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; public class AppDataAdapter extends ArrayAdapter<AppData> implements IEditCallback { private final String TAG = "AppDataAdapter"; public ArrayList<AppArrayList> appLists = new ArrayList<>(); private static List<AppData> appInfoList; private Set<String> selectedApps; private ImageView appIcon; private TextView appName; private TextView appEdit; private CheckBox mSelecte; private final int resourceId; private final String mKey; private final int mMode; public AppDataAdapter(@NonNull Context context, int resource, List<AppData> appInfoList, String key, int mode) { super(context, resource, appInfoList); AppPicker.setEditCallback(this); this.resourceId = resource; mKey = key; mMode = mode; } @NonNull @Override public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { AppData appInfo = getItem(position); getShared(); View view = setNewView(convertView, parent, appInfo); assert appInfo != null; if (mMode == AppPicker.INPUT_MODE) { String edit = getEdit(appInfo.packageName); if (!edit.equals("")) { appName.setText(edit); } else { appName.setText(appInfo.label); } } else appName.setText(appInfo.label); appIcon.setImageBitmap(appInfo.icon); // appEdit.setText(appInfo.packageName); mSelecte.setChecked(shouldSelect(appInfo.packageName)); mSelecte.setVisibility(mMode == AppPicker.LAUNCHER_MODE || mMode == AppPicker.APP_OPEN_MODE ? View.VISIBLE : View.GONE); // Log.e(TAG, "getView: " + appInfo.label, null); return view; } public String getEdit(String packageName) { String string1 = ""; String string2 = ""; Pattern pattern = Pattern.compile(".*฿(.*)฿.*"); // ArrayList<String> have = new ArrayList<>(); for (String edit : selectedApps) { if (edit.contains(packageName + "฿")) { // have.add(edit); Matcher matcher = pattern.matcher(edit); if (matcher.find()) { string2 = matcher.group(1); } } } if (string2 != null && !string2.equals("")) { for (int i = 0; i < appLists.size(); i++) { AppArrayList arrayList = appLists.get(i); if (arrayList.mPackageName.equals(packageName)) { arrayList.mEdit = string2; } } } /*if (have.size() >= 2) { for (int i = 0; i < have.size() - 1; i++) { selectedApps.remove(have.get(i)); } putShared(); }*/ return string2; } public View setNewView(@Nullable View view, @NonNull ViewGroup parent, AppData appInfo) { if (view == null) { view = LayoutInflater.from(getContext()).inflate(resourceId, parent, false); } appIcon = view.findViewById(android.R.id.icon); appName = view.findViewById(android.R.id.title); appEdit = view.findViewById(android.R.id.summary); mSelecte = view.findViewById(android.R.id.checkbox); if (mMode == 3) { addApp(appInfo, appName); } return view; } public void addApp(AppData appData, TextView appName) { boolean appExists = false; if (appLists.isEmpty()) { appLists.add(new AppArrayList(appData.packageName, null, appName)); // Log.e(TAG, "addApp1: " + appData.label, null); } else { for (int i = 0; i < appLists.size(); i++) { AppArrayList appList = appLists.get(i); if (appList.mPackageName.equals(appData.packageName)) { if (!appList.mAppName.equals(appName)) { appList.mAppName = appName; } appExists = true; break; } } if (!appExists) { appLists.add(new AppArrayList(appData.packageName, null, appName)); // Log.e(TAG, "addApp: " + appData.label, null); } } } public boolean shouldSelect(String pkgName) { return (selectedApps.contains(pkgName)); } @Override public void editCallback(String label, String packageName, String edit) { boolean appExists = false; String mLastEdit = null; String isOriginal = null; for (int i = 0; i < appLists.size(); i++) { AppArrayList arrayList = appLists.get(i); if (arrayList.mPackageName.equals(packageName)) { if (arrayList.mEdit != null) { mLastEdit = arrayList.mEdit; } if (edit.equals(label)) { isOriginal = packageName; arrayList.mEdit = null; } else { arrayList.mEdit = edit; } arrayList.mAppName.setText(edit); appExists = true; break; } } if (appExists) { if (mLastEdit != null) { deleteEdit(packageName, mLastEdit); } if (isOriginal != null) { deleteEdit(packageName, isOriginal); return; } // getShared(); String randomString = generateRandomString(5); selectedApps.add(packageName + "฿" + edit + "฿" + randomString); putShared(); } } public void getShared() { selectedApps = new LinkedHashSet<>(PrefsUtils.mSharedPreferences.getStringSet(mKey, new LinkedHashSet<>())); // Log.e(TAG, "getShared: " + mKey, null); } public void putShared() { PrefsUtils.mSharedPreferences.edit().putStringSet(mKey, selectedApps).apply(); } public void deleteAll() { // selectedApps.remove(delete); Collection<String> deleteAll = new ArrayList<>(selectedApps); if (!deleteAll.isEmpty()) { deleteAll.forEach(selectedApps::remove); putShared(); } } public void deleteEdit(String packageName, String lastEdit) { Collection<String> deleteAll = new ArrayList<>(); for (String delete : selectedApps) { if (delete.contains(packageName)) { if (delete.contains(lastEdit)) { deleteAll.add(delete); // selectedApps.remove(delete); // putShared(); } } } if (!deleteAll.isEmpty()) { deleteAll.forEach(selectedApps::remove); putShared(); } } private String generateRandomString(int length) { // 定义包含所有可能字符的字符串 String possibleCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; // 使用StringBuilder构建字符串 StringBuilder randomStringBuilder = new StringBuilder(length); // 使用Random类生成随机索引,并将对应的字符添加到StringBuilder中 Random random = new Random(); for (int i = 0; i < length; i++) { int randomIndex = random.nextInt(possibleCharacters.length()); char randomChar = possibleCharacters.charAt(randomIndex); randomStringBuilder.append(randomChar); } // 将StringBuilder转换为String并返回 return randomStringBuilder.toString(); } public static class AppArrayList { public String mPackageName; public String mEdit; // public String mLastEdit; public TextView mAppName; public AppArrayList(String packageName, String edit, TextView appName) { mPackageName = packageName; mEdit = edit; // mLastEdit = lastEdit; mAppName = appName; } } }
[ "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putStringSet(mKey, selectedApps).apply", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putStringSet", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getStringSet" ]
[((4537, 4605), 'android.view.LayoutInflater.from(getContext()).inflate'), ((7338, 7409), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getStringSet'), ((7508, 7585), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putStringSet(mKey, selectedApps).apply'), ((7508, 7577), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putStringSet'), ((7508, 7544), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.ui.base; import android.content.Intent; import android.os.Bundle; import android.text.TextUtils; import androidx.fragment.app.Fragment; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.utils.log.AndroidLogUtils; import com.sevtinge.hyperceiler.utils.shell.ShellInit; import java.util.ArrayList; import java.util.List; import moralnorm.appcompat.app.AlertDialog; public abstract class BaseSettingsActivity extends BaseActivity { private String initialFragmentName; public Fragment mFragment; public static List<BaseSettingsActivity> mActivityList = new ArrayList<>(); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent intent = getIntent(); initialFragmentName = mProxy.getInitialFragmentName(intent); if (TextUtils.isEmpty(initialFragmentName)) { initialFragmentName = intent.getStringExtra(":android:show_fragment"); } createUiFromIntent(savedInstanceState, intent); } protected void createUiFromIntent(Bundle savedInstanceState, Intent intent) { mProxy.setupContentView(); mActivityList.add(this); Fragment targetFragment = mProxy.getTargetFragment(this, initialFragmentName, savedInstanceState); if (targetFragment != null) { targetFragment.setArguments(mProxy.getArguments(intent)); setFragment(targetFragment); } } public void showRestartSystemDialog() { showRestartDialog(true, "", new String[]{""}); } public void showRestartDialog(String appLabel, String packageName) { showRestartDialog(false, appLabel, new String[]{packageName}); } public void showRestartDialog(String appLabel, String[] packageName) { showRestartDialog(false, appLabel, packageName); } public void showRestartDialog(boolean isRestartSystem, String appLabel, String[] packageName) { String isSystem = getResources().getString(R.string.restart_app_desc, appLabel); String isOther = getResources().getString(R.string.restart_app_desc, " " + appLabel + " "); new AlertDialog.Builder(this) .setCancelable(false) .setTitle(getResources().getString(R.string.soft_reboot) + " " + appLabel) .setMessage(isRestartSystem ? isSystem : isOther) .setHapticFeedbackEnabled(true) .setPositiveButton(android.R.string.ok, (dialog, which) -> doRestart(packageName, isRestartSystem)) .setNegativeButton(android.R.string.cancel, null) .show(); } public void setFragment(Fragment fragment) { mFragment = fragment; getSupportFragmentManager() .beginTransaction() .replace(R.id.frame_content, fragment) .commit(); } public Fragment getFragment() { return mFragment; } public void doRestart(String[] packageName, boolean isRestartSystem) { boolean result = false; boolean pid = true; if (isRestartSystem) { result = ShellInit.getShell().run("reboot").sync().isResult(); } else { if (packageName != null) { for (String packageGet : packageName) { if (packageGet == null) { continue; } // String test = "XX"; // ShellUtils.CommandResult commandResult = ShellUtils.execCommand("{ [[ $(pgrep -f '" + packageGet + // "' | grep -v $$) != \"\" ]] && { pkill -l 9 -f \"" + packageGet + // "\"; }; } || { echo \"kill error\"; }", true, true); boolean getResult = ShellInit.getShell().add("pid=$(pgrep -f \"" + packageGet + "\" | grep -v $$)") .add("if [[ $pid == \"\" ]]; then") .add(" pids=\"\"") .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \"" + packageGet + "\" | grep -v \"grep\")") .add(" for i in $pid; do") .add(" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \"\" ]]; then") .add(" if [[ $pids == \"\" ]]; then") .add(" pids=$i") .add(" else") .add(" pids=\"$pids $i\"") .add(" fi") .add(" fi") .add(" done") .add("fi") .add("if [[ $pids != \"\" ]]; then") .add(" pid=$pids") .add("fi") .add("if [[ $pid != \"\" ]]; then") .add(" for i in $pid; do") .add(" kill -s 15 $i &>/dev/null") .add(" done") .add("else") .add(" echo \"No Find Pid!\"") .add("fi").over().sync().isResult(); ArrayList<String> outPut = ShellInit.getShell().getOutPut(); ArrayList<String> error = ShellInit.getShell().getError(); if (getResult) { if (!outPut.isEmpty()) { if (outPut.get(0).equals("No Find Pid!")) { pid = false; } else { result = true; } } else result = true; } else AndroidLogUtils.logE("doRestart: ", "result: " + ShellInit.getShell().getResult() + " errorMsg: " + error + " package: " + packageGet); } } else { AndroidLogUtils.logE("doRestart: ", "packageName is null"); } // result = ShellUtils.getResultBoolean("pkill -l 9 -f " + packageName, true); } if (!result) { new AlertDialog.Builder(this) .setCancelable(false) .setTitle(R.string.tip) .setMessage(isRestartSystem ? R.string.reboot_failed : pid ? R.string.kill_failed : R.string.pid_failed) .setHapticFeedbackEnabled(true) .setPositiveButton(android.R.string.ok, null) .show(); } } }
[ "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + packageGet + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().getResult", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + packageGet + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + packageGet + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run(\"reboot\").sync", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + packageGet + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\")\n .add(\" for i in $pid; do\")\n .add(\" kill -s 15 $i &>/dev/null\")\n .add(\" done\")\n .add(\"else\")\n .add(\" echo \\\"No Find Pid!\\\"\")\n .add(\"fi\").over().sync().isResult", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + packageGet + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + packageGet + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run(\"reboot\").sync().isResult", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + packageGet + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\")\n .add(\" for i in $pid; do\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + packageGet + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\")\n .add(\" for i in $pid; do\")\n .add(\" kill -s 15 $i &>/dev/null\")\n .add(\" done\")\n .add(\"else\")\n .add(\" echo \\\"No Find Pid!\\\"\")\n .add(\"fi\").over", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + packageGet + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + packageGet + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\")\n .add(\" for i in $pid; do\")\n .add(\" kill -s 15 $i &>/dev/null\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + packageGet + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().getOutPut", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + packageGet + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + packageGet + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\")\n .add(\" for i in $pid; do\")\n .add(\" kill -s 15 $i &>/dev/null\")\n .add(\" done\")\n .add(\"else\")\n .add(\" echo \\\"No Find Pid!\\\"\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + packageGet + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + packageGet + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + packageGet + \"\\\" | grep -v \\\"grep\\\")\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + packageGet + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\")\n .add(\" for i in $pid; do\")\n .add(\" kill -s 15 $i &>/dev/null\")\n .add(\" done\")\n .add(\"else\")\n .add(\" echo \\\"No Find Pid!\\\"\")\n .add(\"fi\").over().sync", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + packageGet + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + packageGet + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().getError", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + packageGet + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + packageGet + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\")\n .add(\" for i in $pid; do\")\n .add(\" kill -s 15 $i &>/dev/null\")\n .add(\" done\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + packageGet + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\")\n .add(\" for i in $pid; do\")\n .add(\" kill -s 15 $i &>/dev/null\")\n .add(\" done\")\n .add(\"else\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + packageGet + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + packageGet + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\").add" ]
[((3849, 3901), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run("reboot").sync().isResult'), ((3849, 3890), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run("reboot").sync'), ((3849, 3883), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run'), ((4520, 5912), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + packageGet + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then")\n .add(" for i in $pid; do")\n .add(" kill -s 15 $i &>/dev/null")\n .add(" done")\n .add("else")\n .add(" echo \\"No Find Pid!\\"")\n .add("fi").over().sync().isResult'), ((4520, 5901), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + packageGet + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then")\n .add(" for i in $pid; do")\n .add(" kill -s 15 $i &>/dev/null")\n .add(" done")\n .add("else")\n .add(" echo \\"No Find Pid!\\"")\n .add("fi").over().sync'), ((4520, 5894), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + packageGet + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then")\n .add(" for i in $pid; do")\n .add(" kill -s 15 $i &>/dev/null")\n .add(" done")\n .add("else")\n .add(" echo \\"No Find Pid!\\"")\n .add("fi").over'), ((4520, 5887), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + packageGet + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then")\n .add(" for i in $pid; do")\n .add(" kill -s 15 $i &>/dev/null")\n .add(" done")\n .add("else")\n .add(" echo \\"No Find Pid!\\"").add'), ((4520, 5848), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + packageGet + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then")\n .add(" for i in $pid; do")\n .add(" kill -s 15 $i &>/dev/null")\n .add(" done")\n .add("else").add'), ((4520, 5789), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + packageGet + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then")\n .add(" for i in $pid; do")\n .add(" kill -s 15 $i &>/dev/null")\n .add(" done").add'), ((4520, 5748), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + packageGet + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then")\n .add(" for i in $pid; do")\n .add(" kill -s 15 $i &>/dev/null").add'), ((4520, 5706), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + packageGet + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then")\n .add(" for i in $pid; do").add'), ((4520, 5642), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + packageGet + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then").add'), ((4520, 5587), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + packageGet + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi").add'), ((4520, 5523), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + packageGet + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids").add'), ((4520, 5484), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + packageGet + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then").add'), ((4520, 5437), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + packageGet + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi").add'), ((4520, 5372), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + packageGet + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done").add'), ((4520, 5333), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + packageGet + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi").add'), ((4520, 5290), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + packageGet + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi").add'), ((4520, 5248), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + packageGet + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"").add'), ((4520, 5205), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + packageGet + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else").add'), ((4520, 5145), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + packageGet + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i").add'), ((4520, 5100), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + packageGet + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then").add'), ((4520, 5050), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + packageGet + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then").add'), ((4520, 4981), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + packageGet + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do").add'), ((4520, 4881), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + packageGet + "\\" | grep -v \\"grep\\")").add'), ((4520, 4825), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"").add'), ((4520, 4710), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then").add'), ((4520, 4663), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + packageGet + "\\" | grep -v $$)").add'), ((4520, 4599), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add'), ((5961, 5993), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().getOutPut'), ((6041, 6072), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().getError'), ((6538, 6570), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().getResult')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.camera; import android.util.SparseArray; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.AnnotationMatcher; import org.luckypray.dexkit.query.matchers.AnnotationsMatcher; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; import org.luckypray.dexkit.result.MethodDataList; import java.lang.reflect.Method; public class CustomWatermark extends BaseHook { @Override public void init() throws NoSuchMethodException { MethodDataList methodDataList = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .returnType(SparseArray.class) .paramCount(0) .annotations(AnnotationsMatcher.create() .add(AnnotationMatcher.create() .usingStrings("Ljava/lang/String;") ) ) ) ); for (MethodData methodData : methodDataList) { Method method = methodData.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "Current hooking method is " + method); hookMethod(method, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { SparseArray<String[]> sparseArray = new SparseArray<>(1); sparseArray.put(0, new String[]{mPrefsMap.getString("camera_custom_watermark_manufacturer", "XIAOMI"), mPrefsMap.getString("camera_custom_watermark_device", "MI PHONE")}); param.setResult(sparseArray); } }); } } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod" ]
[((1454, 1873), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1454, 1487), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1499, 1863), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1540, 1849), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .returnType(SparseArray.class)\n .paramCount(0).annotations'), ((1540, 1640), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .returnType(SparseArray.class).paramCount'), ((1540, 1609), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().returnType'), ((1670, 1831), 'org.luckypray.dexkit.query.matchers.AnnotationsMatcher.create().add'), ((1723, 1809), 'org.luckypray.dexkit.query.matchers.AnnotationMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.utils.blur; import static com.sevtinge.hyperceiler.utils.log.XposedLogUtils.logW; import android.content.Context; import android.graphics.Color; import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; import android.os.Build; import android.text.TextUtils; import android.view.View; import androidx.annotation.RequiresApi; import com.sevtinge.hyperceiler.XposedInit; import com.sevtinge.hyperceiler.utils.DisplayUtils; import com.sevtinge.hyperceiler.utils.color.ColorUtilsStatic; import de.robv.android.xposed.XposedHelpers; @RequiresApi(Build.VERSION_CODES.S) public class BlurUtils { private final Context mContext; private Object mViewRootImpl; private Drawable mBlurDrawable; private int mColor; private int mAlpha; private int mCornerRadius; private int mBlurRadius; private boolean isBlurEnable; public BlurUtils(View view) { this(view, ""); } public BlurUtils(View view, String key) { mContext = view.getContext(); setKey(mContext, key); setBlurView(view); } public void setBlurView(View view) { setOnAttachStateChangeListener(view); } public void setBlurEnable(boolean blurEnable) { isBlurEnable = blurEnable; } public static Drawable createBlurDrawable(View view, int blurRadius, int cornerRadius) { return createBlurDrawable(view, blurRadius, cornerRadius, -1); } public static Drawable createBlurDrawable(View view, int blurRadius, int cornerRadius, int color) { try { Object mViewRootImpl = XposedHelpers.callMethod(view, "getViewRootImpl"); if (mViewRootImpl == null) return null; Drawable blurDrawable = (Drawable) XposedHelpers.callMethod(mViewRootImpl, "createBackgroundBlurDrawable"); XposedHelpers.callMethod(blurDrawable, "setBlurRadius", blurRadius); XposedHelpers.callMethod(blurDrawable, "setCornerRadius", cornerRadius); if (color != -1) XposedHelpers.callMethod(blurDrawable, "setColor", color); return blurDrawable; } catch (Throwable e) { logW("createBlurDrawable", "Create BlurDrawable Error", e); return null; } } public static boolean isBlurDrawable(Drawable drawable) { // 不够严谨,可以用 if (drawable == null) { return false; } String drawableClassName = drawable.getClass().getName(); return drawableClassName.contains("BackgroundBlurDrawable"); } public void setKey(Context context, String key) { if (!TextUtils.isEmpty(key)) { String mBlurEnableKey = key + "_blur_enabled"; String mBlurRadiusKey = key + "_blur_radius"; String mColorKey = key + "_color"; String mAlphaKey = key + "_color_alpha"; String mCornerRadiusKey = key + "_corner_radius"; isBlurEnable = XposedInit.mPrefsMap.getBoolean(mBlurEnableKey); mBlurRadius = XposedInit.mPrefsMap.getInt(mBlurRadiusKey, 60); mColor = XposedInit.mPrefsMap.getInt(mColorKey, 2113929215); mAlpha = XposedInit.mPrefsMap.getInt(mAlphaKey, 60); mCornerRadius = DisplayUtils.dip2px(context, XposedInit.mPrefsMap.getInt(mCornerRadiusKey, 18)); } else { isBlurEnable = false; mBlurRadius = 60; mColor = 2113929215; mAlpha = 60; mCornerRadius = DisplayUtils.dip2px(context, 90); } } private void setOnAttachStateChangeListener(View view) { view.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() { @Override public void onViewAttachedToWindow(View v) { mViewRootImpl = XposedHelpers.callMethod(v, "getViewRootImpl"); mBlurDrawable = createBackgroundDrawable(mViewRootImpl, isBlurEnable, ColorUtilsStatic.colorToHexARGB(mColor), mCornerRadius, mBlurRadius); v.setBackground(mBlurDrawable); } @Override public void onViewDetachedFromWindow(View v) { v.setBackground(null); } }); } private Drawable createBackgroundDrawable(Object viewRootImpl, boolean isBlurEnable, int color, int cornerRadius, int blurRadius) { Drawable mBackgroundDrawable; if (isBlurEnable) { mBackgroundDrawable = (Drawable) XposedHelpers.callMethod(viewRootImpl, "createBackgroundBlurDrawable", new Object[0]); setColor(mBackgroundDrawable, color); setCornerRadius(mBackgroundDrawable, cornerRadius); setBlurRadius(mBackgroundDrawable, blurRadius); } else { mBackgroundDrawable = createGradientDrawable(color, cornerRadius); } return mBackgroundDrawable; } private Drawable createBackgroundDrawable(Object viewRootImpl, boolean isBlurEnable, String color, int cornerRadius, int blurRadius) { Drawable mBackgroundDrawable; if (isBlurEnable) { mBackgroundDrawable = (Drawable) XposedHelpers.callMethod(viewRootImpl, "createBackgroundBlurDrawable", new Object[0]); setColor(mBackgroundDrawable, color); setCornerRadius(mBackgroundDrawable, cornerRadius); setBlurRadius(mBackgroundDrawable, blurRadius); } else { mBackgroundDrawable = createGradientDrawable(color, cornerRadius); } return mBackgroundDrawable; } private GradientDrawable createGradientDrawable(int color, int cornerRadius) { int mColorAlpha = (color & 0xff000000) >> 24; int mColorRed = (color & 0x00ff0000) >> 16; int mColorGreen = (color & 0x0000ff00) >> 8; int mColorBlue = (color & 0x000000ff); GradientDrawable mBackgroundDrawable = new GradientDrawable(); mBackgroundDrawable.setShape(GradientDrawable.RECTANGLE); mBackgroundDrawable.setColor(Color.argb(mColorAlpha, mColorRed, mColorGreen, mColorBlue)); mBackgroundDrawable.setCornerRadius(cornerRadius); return mBackgroundDrawable; } private GradientDrawable createGradientDrawable(String color, int cornerRadius) { GradientDrawable mBackgroundDrawable = new GradientDrawable(); mBackgroundDrawable.setShape(GradientDrawable.RECTANGLE); mBackgroundDrawable.setColor(Color.parseColor(color)); mBackgroundDrawable.setCornerRadius(cornerRadius); return mBackgroundDrawable; } public void setColor(Drawable drawable, int color) { int mColorAlpha = (color & 0xff000000) >> 24; int mColorRed = (color & 0x00ff0000) >> 16; int mColorGreen = (color & 0x0000ff00) >> 8; int mColorBlue = (color & 0x000000ff); XposedHelpers.callMethod(drawable, "setColor", Color.argb(mColorAlpha, mColorRed, mColorGreen, mColorBlue)); } public void setColor(Drawable drawable, String color) { XposedHelpers.callMethod(drawable, "setColor", Color.parseColor(color)); } public void setCornerRadius(Drawable drawable, int cornerRadius) { XposedHelpers.callMethod(drawable, "setCornerRadius", new Object[]{cornerRadius}); } public void setBlurRadius(Drawable drawable, int blurRadius) { XposedHelpers.callMethod(drawable, "setBlurRadius", new Object[]{blurRadius}); } /*public BlurUtils(View view) { this(view, null); } public BlurUtils(View view, String key) { mView = view; mKey = key; if (mView != null) { mContext = mView.getContext(); } if (mKey != null) { mBlurRadiusKey = mKey + "_blur_radius"; mBgCornerRadiusKey = mKey + "_bg_corner_radius"; mBgAlphaKey = mKey + "_bg_alpha"; mBgColorKey = mKey + "_bg_color"; mBlurRadius = XposedInit.mPrefsMap.getInt(mBlurRadiusKey,60); mBgCornerRadius = DisplayUtils.dip2px(mContext, XposedInit.mPrefsMap.getInt(mBgCornerRadiusKey, 90)); mBgAlpha = XposedInit.mPrefsMap.getInt(mBgAlphaKey,60); mBgColor = XposedInit.mPrefsMap.getInt(mBgColorKey,-1); } setBlur(mView); } void setBlur(View view) { view.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() { @Override public void onViewAttachedToWindow(View v) { onAttachedToWindow(); } @Override public void onViewDetachedFromWindow(View v) { onDetachedFromWindow(); } }); } void onAttachedToWindow() { mViewRootImpl = XposedHelpers.callMethod(mView,"getViewRootImpl",new Object[0]); mBlurDrawable = (Drawable) XposedHelpers.callMethod(mViewRootImpl,"createBackgroundBlurDrawable",new Object[0]); initBlur(); } void onDetachedFromWindow() { mView.setBackground(null); } void initBlur() { setBlurRadius(); setCornerRadius(); setColor(); setBlurBackground(); } void setBlurBackground() { mView.setBackground(mBlurDrawable); } void setBlurRadius() { XposedHelpers.callMethod(mBlurDrawable,"setBlurRadius",new Object[]{mBlurRadius}); } void setCornerRadius() { XposedHelpers.callMethod(mBlurDrawable,"setCornerRadius",new Object[]{mBgCornerRadius}); } private static void setColor() { int mColorRed = (mBgColor & 0x00ff0000) >> 16; int mColorGreen = (mBgColor & 0x0000ff00) >> 8; int mColorBlue = (mBgColor & 0x000000ff); XposedHelpers.callMethod(mBlurDrawable,"setColor", Color.argb(mBgAlpha, mColorRed, mColorGreen, mColorBlue)); }*/ }
[ "com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getBoolean", "com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getInt" ]
[((3731, 3778), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getBoolean'), ((3806, 3853), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getInt'), ((3877, 3927), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getInt'), ((3950, 3992), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getInt'), ((4051, 4100), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getInt')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.data.adapter; import android.annotation.SuppressLint; import android.content.Context; import android.text.Spannable; import android.text.SpannableString; import android.text.style.ForegroundColorSpan; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Filter; import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.data.ModData; import com.sevtinge.hyperceiler.utils.search.SearchHelper; import java.util.ArrayList; import java.util.Comparator; import java.util.HashMap; import java.util.Locale; import java.util.concurrent.CopyOnWriteArrayList; public class ModSearchAdapter extends RecyclerView.Adapter<ModSearchAdapter.ViewHolder> { private Context mContext; private String filterString = ""; private ItemFilter mFilter; private boolean isChina; private final static String TAG = "ModSearchAdapter"; private onItemClickListener mItemClickListener;// item点击监听 private final CopyOnWriteArrayList<ModData> modsList = new CopyOnWriteArrayList<ModData>(); public void setOnItemClickListener(onItemClickListener onItemClick) { mItemClickListener = onItemClick; } @NonNull @Override public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int position) { mContext = viewGroup.getContext(); View view = LayoutInflater.from(mContext).inflate(R.layout.item_search_result, viewGroup, false); // 创建一个VIewHolder return new ViewHolder(view); } @Override public void onBindViewHolder(@NonNull ViewHolder viewHolder, int position) { ModData ad = modsList.get(position); Spannable spannable = new SpannableString(ad.title); if (isChina) { for (int i = 0; i < filterString.length(); i++) { char ch = filterString.charAt(i); String str = String.valueOf(ch); int start = ad.title.toLowerCase().indexOf(str); if (start >= 0) { spannable.setSpan(new ForegroundColorSpan(SearchHelper.MARK_COLOR_VIBRANT), start, start + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); } } viewHolder.mName.setText(spannable, TextView.BufferType.SPANNABLE); } else { int start = ad.title.toLowerCase().indexOf(filterString); if (start >= 0) { spannable.setSpan(new ForegroundColorSpan(SearchHelper.MARK_COLOR_VIBRANT), start, start + filterString.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); viewHolder.mName.setText(spannable, TextView.BufferType.SPANNABLE); } else { viewHolder.mName.setText(ad.title); } } viewHolder.mPackageName.setText(ad.breadcrumbs); // 设置item点击监听事件 viewHolder.itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { mItemClickListener.onItemClick(view, ad); } }); } @Override public int getItemCount() { return modsList.size(); } public Filter getFilter(Context context) { // 如果ItemFilter对象为空,那么重写创建一个 if (mFilter == null) { mFilter = new ItemFilter(context); } return mFilter; } public static class ViewHolder extends RecyclerView.ViewHolder { private final ImageView mIcon; private final TextView mName; private final TextView mPackageName; public ViewHolder(View itemView) { super(itemView); mIcon = itemView.findViewById(android.R.id.icon); mName = itemView.findViewById(android.R.id.title); mPackageName = itemView.findViewById(android.R.id.summary); } } public interface onItemClickListener { void onItemClick(View view, ModData ad); } private class ItemFilter extends Filter { private final Context context; ItemFilter(Context context) { this.context = context; } private final HashMap<String, Integer> modMap = new HashMap<>(); @Override protected FilterResults performFiltering(CharSequence constraint) { filterString = constraint.toString().toLowerCase(); ArrayList<ModData> nlist = new ArrayList<>(); modMap.clear(); isChina = isChina(context); if (isChina) { for (int i = 0; i < filterString.length(); i++) { char ch = filterString.charAt(i); String str = String.valueOf(ch); findList(constraint, str, nlist); } } else findList(constraint, filterString, nlist); FilterResults results = new FilterResults(); results.values = nlist; results.count = nlist.size(); return results; } private void findList(CharSequence constraint, String str, ArrayList<ModData> nlist) { for (ModData filterableData : SearchHelper.allModsList) { if (constraint.toString().equals(SearchHelper.NEW_MODS_SEARCH_QUERY)) { if (SearchHelper.NEW_MODS.contains(filterableData.key)) { if (check(filterableData.key)) { nlist.add(filterableData); modMap.put(filterableData.key, 0); } } } else if (filterableData.title.toLowerCase().contains(str)) { if (check(filterableData.key)) { nlist.add(filterableData); modMap.put(filterableData.key, 0); } } } } private boolean check(String key) { return modMap.get(key) == null; } @SuppressLint("NotifyDataSetChanged") @Override protected void publishResults(CharSequence constraint, FilterResults results) { modsList.clear(); if (results.count > 0 && results.values != null) { modsList.addAll((ArrayList<ModData>) results.values); } if (isChina) modsList.sort(new ModDataComparator(filterString)); else sortList(); notifyDataSetChanged(); } } private boolean isChina(Context context) { Locale locale = context.getResources().getConfiguration().getLocales().get(0); return locale.getLanguage().contains(new Locale("zh").getLanguage()); } private void sortList() { modsList.sort(new Comparator<ModData>() { public int compare(ModData app1, ModData app2) { int breadcrumbs = app1.breadcrumbs.compareToIgnoreCase(app2.breadcrumbs); if (breadcrumbs == 0) return app1.title.compareToIgnoreCase(app2.title); else return breadcrumbs; } }); } public static class ModDataComparator implements Comparator<ModData> { private final String searchTerm; public ModDataComparator(String searchTerm) { this.searchTerm = searchTerm; } @Override public int compare(ModData app1, ModData app2) { int frequency1 = calculateFrequency(app1.title); int frequency2 = calculateFrequency(app2.title); return Integer.compare(frequency2, frequency1); // 频率高的排在前面 } private int calculateFrequency(String str) { int frequency = 0; for (int i = 0; i < searchTerm.length(); i++) { char ch = searchTerm.charAt(i); String chStr = String.valueOf(ch); if (str.contains(chStr)) { frequency = frequency + 1; } } return frequency; } } }
[ "com.sevtinge.hyperceiler.utils.search.SearchHelper.NEW_MODS.contains" ]
[((2271, 2355), 'android.view.LayoutInflater.from(mContext).inflate'), ((6190, 6240), 'com.sevtinge.hyperceiler.utils.search.SearchHelper.NEW_MODS.contains')]
package com.sevtinge.hyperceiler.module.hook.clipboard; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.ClassMatcher; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; import org.luckypray.dexkit.result.MethodDataList; public class BaiduClipboard extends BaseHook { @Override public void init() throws NoSuchMethodException { MethodData methodData = null; MethodData methodData1 = null; MethodDataList methodDataList = new MethodDataList(); if ("com.baidu.input".equals(lpparam.packageName)) { methodData = DexKit.INSTANCE.getDexKitBridge().findMethod( FindMethod.create() .matcher( MethodMatcher.create() .declaredClass( ClassMatcher.create() .usingStrings("begin to checkMaxQueryCount") ) .returnType(int.class) .usingStrings("clipboard.config.max_query_count") ) ).singleOrNull(); methodData1 = DexKit.INSTANCE.getDexKitBridge().findMethod( FindMethod.create() .matcher( MethodMatcher.create() .declaredClass( ClassMatcher.create() .usingStrings("begin to checkMaxQueryCount") ) .name("getMaxCount") ) ).singleOrNull(); } else if ("com.baidu.input_mi".equals(lpparam.packageName)) { methodDataList = DexKit.INSTANCE.getDexKitBridge().findMethod( FindMethod.create() .matcher( MethodMatcher.create() .declaredClass( ClassMatcher.create() .usingStrings("clipboard.config.max_query_count") ) .returnType(int.class) ) ); } if (methodData == null && methodData1 == null) { if (methodDataList.isEmpty()) { logE(TAG, "list is empty!"); return; } if (methodDataList.size() == 1) { logW(TAG, "list size only one!"); } if (methodDataList.size() == 1 || methodDataList.size() == 2) { for (MethodData method : methodDataList) { // logE(TAG, "find method: " + method.getMethodInstance(lpparam.classLoader)); hookMethod(method.getMethodInstance(lpparam.classLoader), new MethodHook() { @Override protected void before(MethodHookParam param) { param.setResult(Integer.MAX_VALUE); } } ); } return; } logE(TAG, "list size to more!"); return; } if (methodData != null) { hookMethod(methodData.getMethodInstance(lpparam.classLoader), new MethodHook() { @Override protected void before(MethodHookParam param) { param.setResult(Integer.MAX_VALUE); } } ); } else { logE(TAG, "no find method 1"); } if (methodData1 != null) { hookMethod(methodData1.getMethodInstance(lpparam.classLoader), new MethodHook() { @Override protected void before(MethodHookParam param) { param.setResult(Integer.MAX_VALUE); } } ); } else { logE(TAG, "no find method 2"); } } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(\n FindMethod.create()\n .matcher(\n MethodMatcher.create()\n .declaredClass(\n ClassMatcher.create()\n .usingStrings(\"begin to checkMaxQueryCount\")\n )\n .returnType(int.class)\n .usingStrings(\"clipboard.config.max_query_count\")\n )\n ).singleOrNull", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(\n FindMethod.create()\n .matcher(\n MethodMatcher.create()\n .declaredClass(\n ClassMatcher.create()\n .usingStrings(\"begin to checkMaxQueryCount\")\n )\n .name(\"getMaxCount\")\n )\n ).singleOrNull" ]
[((771, 1318), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(\n FindMethod.create()\n .matcher(\n MethodMatcher.create()\n .declaredClass(\n ClassMatcher.create()\n .usingStrings("begin to checkMaxQueryCount")\n )\n .returnType(int.class)\n .usingStrings("clipboard.config.max_query_count")\n )\n ).singleOrNull'), ((771, 1303), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((771, 804), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((833, 1289), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((907, 1267), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .declaredClass(\n ClassMatcher.create()\n .usingStrings("begin to checkMaxQueryCount")\n )\n .returnType(int.class).usingStrings'), ((907, 1189), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .declaredClass(\n ClassMatcher.create()\n .usingStrings("begin to checkMaxQueryCount")\n ).returnType'), ((907, 1138), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().declaredClass'), ((1006, 1108), 'org.luckypray.dexkit.query.matchers.ClassMatcher.create().usingStrings'), ((1347, 1814), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(\n FindMethod.create()\n .matcher(\n MethodMatcher.create()\n .declaredClass(\n ClassMatcher.create()\n .usingStrings("begin to checkMaxQueryCount")\n )\n .name("getMaxCount")\n )\n ).singleOrNull'), ((1347, 1799), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1347, 1380), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1409, 1785), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1483, 1763), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .declaredClass(\n ClassMatcher.create()\n .usingStrings("begin to checkMaxQueryCount")\n ).name'), ((1483, 1714), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().declaredClass'), ((1582, 1684), 'org.luckypray.dexkit.query.matchers.ClassMatcher.create().usingStrings'), ((1916, 2375), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1916, 1949), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1978, 2361), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((2052, 2339), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .declaredClass(\n ClassMatcher.create()\n .usingStrings("clipboard.config.max_query_count")\n ).returnType'), ((2052, 2288), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().declaredClass'), ((2151, 2258), 'org.luckypray.dexkit.query.matchers.ClassMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.various; import android.content.Context; import android.content.res.Configuration; import android.os.Build; import android.view.Gravity; import android.view.View; import android.widget.FrameLayout; import com.sevtinge.hyperceiler.XposedInit; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.utils.DisplayUtils; import com.sevtinge.hyperceiler.utils.blur.BlurUtils; import com.sevtinge.hyperceiler.utils.log.AndroidLogUtils; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.Arrays; import java.util.LinkedList; import java.util.List; import de.robv.android.xposed.XposedHelpers; public class DialogGravity extends BaseHook { public Context mContext; public View mParentPanel = null; final Class<?> mDialogCls = XposedHelpers.findClassIfExists("miuix.appcompat.app.AlertController", lpparam.classLoader); final Class<?> mDialogParentPanelCls = XposedHelpers.findClassIfExists("miuix.internal.widget.DialogParentPanel", lpparam.classLoader); final List<Method> methodList = new LinkedList<>(); @Override public void init() { if (mDialogCls != null) { boolean oldMethodFound = false; for (Method method : mDialogCls.getDeclaredMethods()) { if (method.getName().equals("setupDialogPanel")) oldMethodFound = true; methodList.add(method); AndroidLogUtils.logI(TAG, method.getName()); } int mDialogGravity = XposedInit.mPrefsMap.getStringAsInt("various_dialog_gravity", 0); int mDialogHorizontalMargin = XposedInit.mPrefsMap.getInt("various_dialog_horizontal_margin", 0); int mDialogBottomMargin = XposedInit.mPrefsMap.getInt("various_dialog_bottom_margin", 0); if (oldMethodFound) { findAndHookMethod(mDialogCls, "setupDialogPanel", Configuration.class, new MethodHook() { @Override protected void after(MethodHookParam param) throws Throwable { mParentPanel = (View) XposedHelpers.getObjectField(param.thisObject, "mParentPanel"); mContext = mParentPanel.getContext(); FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) mParentPanel.getLayoutParams(); if (mDialogGravity != 0) { layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT; layoutParams.gravity = mDialogGravity == 1 ? Gravity.CENTER : Gravity.BOTTOM | Gravity.CENTER; layoutParams.setMarginStart(mDialogHorizontalMargin == 0 ? 0 : DisplayUtils.dip2px(mContext, mDialogHorizontalMargin)); layoutParams.setMarginEnd(mDialogHorizontalMargin == 0 ? 0 : DisplayUtils.dip2px(mContext, mDialogHorizontalMargin)); layoutParams.bottomMargin = mDialogGravity == 1 ? 0 : DisplayUtils.dip2px(mContext, mDialogBottomMargin); } mParentPanel.setLayoutParams(layoutParams); /*new BlurUtils(mParentPanel);*/ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { new BlurUtils(mParentPanel, "default"); } } }); } for (Method method : methodList) { if (Arrays.equals(method.getParameterTypes(), new Class[]{Configuration.class}) && method.getReturnType() == Void.TYPE && method.getModifiers() == 2 && method.getParameterCount() == 1) { XposedHelpers.findAndHookMethod(mDialogCls, method.getName(), new MethodHook() { @Override protected void after(MethodHookParam param) throws Throwable { Field field = XposedHelpers.findFirstFieldByExactType(mDialogCls, mDialogParentPanelCls); mParentPanel = (View) field.get(param.thisObject); mContext = mParentPanel.getContext(); FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) mParentPanel.getLayoutParams(); if (mDialogGravity != 0) { layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT; layoutParams.gravity = mDialogGravity == 1 ? Gravity.CENTER : Gravity.BOTTOM | Gravity.CENTER; layoutParams.setMarginStart(mDialogHorizontalMargin == 0 ? 0 : DisplayUtils.dip2px(mContext, mDialogHorizontalMargin)); layoutParams.setMarginEnd(mDialogHorizontalMargin == 0 ? 0 : DisplayUtils.dip2px(mContext, mDialogHorizontalMargin)); layoutParams.bottomMargin = mDialogGravity == 1 ? 0 : DisplayUtils.dip2px(mContext, mDialogBottomMargin); } mParentPanel.setLayoutParams(layoutParams); /*new BlurUtils(mParentPanel);*/ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { new BlurUtils(mParentPanel, "default"); } } }); } } } hookAllMethods(mDialogCls, "dismiss", new MethodHook() { @Override protected void after(MethodHookParam param) throws Throwable { super.after(param); View mParentPanel = (View) XposedHelpers.getObjectField(param.thisObject, "mParentPanel"); mParentPanel.setVisibility(View.INVISIBLE); } }); } }
[ "com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getStringAsInt", "com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getInt" ]
[((2292, 2356), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getStringAsInt'), ((2401, 2467), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getInt'), ((2507, 2569), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getInt')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.ui.fragment.systemui.statusbar; import android.view.View; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.ui.base.BaseSettingsActivity; import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; import com.sevtinge.hyperceiler.utils.api.miuiStringToast.MiuiStringToast; import moralnorm.preference.Preference; public class StrongToastSettings extends SettingsPreferenceFragment { Preference mShortToast; Preference mLongToast; @Override public int getContentResId() { return R.xml.system_ui_status_bar_strong_toast; } @Override public void initPrefs() { mShortToast = findPreference("prefs_key_system_ui_status_bar_strong_toast_test_short_text"); mLongToast = findPreference("prefs_key_system_ui_status_bar_strong_toast_test_long_text"); mShortToast.setOnPreferenceClickListener(preference -> { MiuiStringToast.INSTANCE.showStringToast(requireActivity(), getResources().getString(R.string.system_ui_status_bar_strong_toast_test_short_text_0), 1); return true; }); mLongToast.setOnPreferenceClickListener(preference -> { MiuiStringToast.INSTANCE.showStringToast(requireActivity(), getResources().getString(R.string.system_ui_status_bar_strong_toast_test_long_text_1), 1); return true; }); } @Override public View.OnClickListener addRestartListener() { return view -> ((BaseSettingsActivity)getActivity()).showRestartDialog( getResources().getString(R.string.system_ui), "com.android.systemui" ); } }
[ "com.sevtinge.hyperceiler.utils.api.miuiStringToast.MiuiStringToast.INSTANCE.showStringToast" ]
[((1666, 1816), 'com.sevtinge.hyperceiler.utils.api.miuiStringToast.MiuiStringToast.INSTANCE.showStringToast'), ((1931, 2080), 'com.sevtinge.hyperceiler.utils.api.miuiStringToast.MiuiStringToast.INSTANCE.showStringToast')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.browser; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; import java.lang.reflect.Method; public class EnableDebugEnvironment extends BaseHook { @Override public void init() throws NoSuchMethodException { MethodData methodData = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .usingStrings("pref_key_debug_mode_" + getPackageVersionCode(lpparam)) .name("getDebugMode") .returnType(boolean.class) ) ).singleOrThrow(() -> new IllegalStateException("EnableDebugEnvironment: Cannot found MethodData")); Method method = methodData.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "getDebugMode() method is " + method); hookMethod(method, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { param.setResult(true); } }); } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(\"pref_key_debug_mode_\" + getPackageVersionCode(lpparam))\n .name(\"getDebugMode\")\n .returnType(boolean.class)\n )\n ).singleOrThrow", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod" ]
[((1244, 1642), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings("pref_key_debug_mode_" + getPackageVersionCode(lpparam))\n .name("getDebugMode")\n .returnType(boolean.class)\n )\n ).singleOrThrow'), ((1244, 1544), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1244, 1277), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1289, 1534), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1330, 1520), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .usingStrings("pref_key_debug_mode_" + getPackageVersionCode(lpparam))\n .name("getDebugMode").returnType'), ((1330, 1477), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .usingStrings("pref_key_debug_mode_" + getPackageVersionCode(lpparam)).name'), ((1330, 1439), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.ui.fragment.systemui.statusbar; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isAndroidVersion; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreAndroidVersion; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion; import android.view.View; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.ui.base.BaseSettingsActivity; import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils; import moralnorm.preference.DropDownPreference; import moralnorm.preference.Preference; import moralnorm.preference.SeekBarPreferenceEx; import moralnorm.preference.SwitchPreference; public class IconManageSettings extends SettingsPreferenceFragment { Preference UseNewHD; DropDownPreference IconNewHD; DropDownPreference mAlarmClockIcon; SeekBarPreferenceEx mAlarmClockIconN; SeekBarPreferenceEx mNotificationIconMaximum; SeekBarPreferenceEx mNotificationIconColumns; SwitchPreference mBatteryNumber; SwitchPreference mBatteryPercentage; @Override public int getContentResId() { return R.xml.system_ui_status_bar_icon_manage; } @Override public View.OnClickListener addRestartListener() { return view -> ((BaseSettingsActivity) getActivity()).showRestartDialog( getResources().getString(R.string.system_ui), "com.android.systemui" ); } @Override public void initPrefs() { mAlarmClockIcon = findPreference("prefs_key_system_ui_status_bar_icon_alarm_clock"); mAlarmClockIconN = findPreference("prefs_key_system_ui_status_bar_icon_alarm_clock_n"); mNotificationIconMaximum = findPreference("prefs_key_system_ui_status_bar_notification_icon_maximum"); mBatteryNumber = findPreference("prefs_key_system_ui_status_bar_battery_percent"); mBatteryPercentage = findPreference("prefs_key_system_ui_status_bar_battery_percent_mark"); mNotificationIconColumns = findPreference("prefs_key_system_ui_status_bar_notification_icon_maximum"); UseNewHD = findPreference("prefs_key_system_ui_status_bar_use_new_hd"); IconNewHD = findPreference("prefs_key_system_ui_status_bar_icon_new_hd"); UseNewHD.setVisible(isAndroidVersion(33)); IconNewHD.setVisible(isMoreAndroidVersion(33)); mNotificationIconColumns.setDefaultValue(isMoreHyperOSVersion(1f) ? 1 : 3); mAlarmClockIconN.setVisible(Integer.parseInt(PrefsUtils.mSharedPreferences.getString("prefs_key_system_ui_status_bar_icon_alarm_clock", "0")) == 3); mAlarmClockIcon.setOnPreferenceChangeListener((preference, o) -> { mAlarmClockIconN.setVisible(Integer.parseInt((String) o) == 3); return true; }); mNotificationIconMaximum.setOnPreferenceChangeListener((preference, o) -> { if ((int) o == 16) { mNotificationIconMaximum.setValue(R.string.unlimited); } return true; }); mBatteryNumber.setOnPreferenceChangeListener((preference, o) -> { if (!(boolean) o) { mBatteryPercentage.setChecked(false); } return true; }); } }
[ "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getString" ]
[((3324, 3419), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getString')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.securitycenter; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; import java.lang.reflect.Method; public class UnlockFbo extends BaseHook { @Override public void init() throws NoSuchMethodException { MethodData isFboStateOpenInCloud = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .usingStrings("FBO_STATE_OPEN") .returnType(boolean.class) .paramCount(0) ) ).singleOrThrow(() -> new IllegalStateException("UnlockFbo: Cannot found MethodData FBO_STATE_OPEN")); hookMethod(isFboStateOpenInCloud.getMethodInstance(lpparam.classLoader), MethodHook.returnConstant(true)); MethodData methodData = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .usingStrings("miui.fbo.FboManager") .returnType(boolean.class) .paramTypes(String.class) ) ).singleOrThrow(() -> new IllegalStateException("UnlockFbo: Cannot found MethodData")); Method method = methodData.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "Unlock FBO method is " + method); hookMethod(method, MethodHook.returnConstant(true)); } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(\"miui.fbo.FboManager\")\n .returnType(boolean.class)\n .paramTypes(String.class)\n )\n ).singleOrThrow", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(\"FBO_STATE_OPEN\")\n .returnType(boolean.class)\n .paramCount(0)\n )\n ).singleOrThrow", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod" ]
[((1249, 1603), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings("FBO_STATE_OPEN")\n .returnType(boolean.class)\n .paramCount(0)\n )\n ).singleOrThrow'), ((1249, 1503), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1249, 1282), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1294, 1493), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1335, 1479), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .usingStrings("FBO_STATE_OPEN")\n .returnType(boolean.class).paramCount'), ((1335, 1448), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .usingStrings("FBO_STATE_OPEN").returnType'), ((1335, 1405), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings'), ((1753, 2108), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings("miui.fbo.FboManager")\n .returnType(boolean.class)\n .paramTypes(String.class)\n )\n ).singleOrThrow'), ((1753, 2023), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1753, 1786), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1798, 2013), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1839, 1999), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .usingStrings("miui.fbo.FboManager")\n .returnType(boolean.class).paramTypes'), ((1839, 1957), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .usingStrings("miui.fbo.FboManager").returnType'), ((1839, 1914), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.view; import android.content.Context; import android.graphics.Color; import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; import android.os.Build; import android.text.TextUtils; import android.view.View; import android.widget.FrameLayout; import androidx.annotation.RequiresApi; import com.sevtinge.hyperceiler.XposedInit; import com.sevtinge.hyperceiler.utils.DisplayUtils; import de.robv.android.xposed.XposedHelpers; @RequiresApi(Build.VERSION_CODES.S) public class BlurFrameLayout { int mBgColor; int mBgAlpha; int mBgCornerRadius; int mBlurRadius; boolean isBlurEnable; Context mContext; Drawable mBlurDrawable; Object mViewRootImpl; View mBlurView; public BlurFrameLayout(Context context, boolean blurEnable) { isBlurEnable = blurEnable; } public BlurFrameLayout(View view, String key) { this(view.getContext(), false); mContext = view.getContext(); mBlurView = new FrameLayout(mContext); if (!TextUtils.isEmpty(key)) { String mBgColorKey = key + "_bg_color"; String mBgAlphaKey = key + "_bg_alpha"; String mBgCornerRadiusKey = key + "_bg_corner_radius"; String mBlurRadiusKey = key + "_blur_radius"; mBlurRadius = XposedInit.mPrefsMap.getInt(mBlurRadiusKey, 60); mBgColor = XposedInit.mPrefsMap.getInt(mBgColorKey, -1); mBgAlpha = XposedInit.mPrefsMap.getInt(mBgAlphaKey, 60); mBgCornerRadius = DisplayUtils.dip2px(mContext, XposedInit.mPrefsMap.getInt(mBgCornerRadiusKey, 90)); } setOnAttachStateChangeListener(mBlurView); } private void setOnAttachStateChangeListener(View view) { view.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() { @Override public void onViewAttachedToWindow(View v) { mViewRootImpl = XposedHelpers.callMethod(v, "getViewRootImpl"); mBlurDrawable = (Drawable) XposedHelpers.callMethod(mViewRootImpl, "createBackgroundBlurDrawable", new Object[0]); setBackgroundDrawable(mContext, v, isBlurEnable, mBgColor, mBgAlpha, mBgCornerRadius, mBlurRadius); } @Override public void onViewDetachedFromWindow(View v) { v.setBackground(null); } }); } private void setBackgroundDrawable(Context context, View view, boolean isBlurEnable, int color, int alpha, int cornerRadius, int blurRadius) { if (isBlurEnable) { setColor(color, alpha); setCornerRadius(cornerRadius); setBlurRadius(blurRadius); } else { view.setBackground(createGradientDrawable(context, color, alpha, cornerRadius)); } } public void setColor(int color, int alpha) { int mColorRed = (color & 0x00ff0000) >> 16; int mColorGreen = (color & 0x0000ff00) >> 8; int mColorBlue = (color & 0x000000ff); XposedHelpers.callMethod(mBlurDrawable, "setColor", Color.argb(alpha, mColorRed, mColorGreen, mColorBlue)); } public void setCornerRadius(int cornerRadius) { XposedHelpers.callMethod(mBlurDrawable, "setCornerRadius", cornerRadius); } public void setBlurRadius(int blurRadius) { XposedHelpers.callMethod(mBlurDrawable, "setBlurRadius", blurRadius); } private GradientDrawable createGradientDrawable(Context context, int color, int alpha, int cornerRadius) { int mColorRed = (color & 0x00ff0000) >> 16; int mColorGreen = (color & 0x0000ff00) >> 8; int mColorBlue = (color & 0x000000ff); GradientDrawable mBackgroundDrawable = new GradientDrawable(); mBackgroundDrawable.setShape(GradientDrawable.RECTANGLE); mBackgroundDrawable.setColor(Color.argb(alpha, mColorRed, mColorGreen, mColorBlue)); mBackgroundDrawable.setCornerRadius(DisplayUtils.dip2px(context, cornerRadius)); return mBackgroundDrawable; } }
[ "com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getInt" ]
[((2091, 2138), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getInt'), ((2164, 2208), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getInt'), ((2233, 2277), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getInt'), ((2339, 2390), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getInt')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.ui.fragment.settings; import static com.sevtinge.hyperceiler.utils.DisplayUtils.dip2px; import static com.sevtinge.hyperceiler.utils.DisplayUtils.sp2px; import android.app.Activity; import android.content.ComponentName; import android.content.pm.PackageManager; import android.os.Bundle; import android.view.View; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.core.graphics.Insets; import androidx.core.view.OnApplyWindowInsetsListener; import androidx.core.view.ViewCompat; import androidx.core.view.WindowInsetsCompat; import androidx.recyclerview.widget.RecyclerView; import com.sevtinge.hyperceiler.BuildConfig; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.ui.LauncherActivity; import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; import com.sevtinge.hyperceiler.utils.BackupUtils; import com.sevtinge.hyperceiler.utils.DialogHelper; import com.sevtinge.hyperceiler.utils.LanguageHelper; import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils; import com.sevtinge.hyperceiler.utils.shell.ShellInit; import moralnorm.appcompat.app.AppCompatActivity; import moralnorm.preference.DropDownPreference; import moralnorm.preference.Preference; import moralnorm.preference.SwitchPreference; public class ModuleSettingsFragment extends SettingsPreferenceFragment implements Preference.OnPreferenceChangeListener { DropDownPreference mIconModePreference; DropDownPreference mIconModeValue; SwitchPreference mHideAppIcon; DropDownPreference mLogLevel; DropDownPreference mLanguage; @Override public int getContentResId() { return R.xml.prefs_settings; } @Override public void initPrefs() { int mIconMode = Integer.parseInt(PrefsUtils.getSharedStringPrefs(getContext(), "prefs_key_settings_icon", "0")); mIconModePreference = findPreference("prefs_key_settings_icon"); mIconModeValue = findPreference("prefs_key_settings_icon_mode"); mLanguage = findPreference("prefs_key_settings_app_language"); mHideAppIcon = findPreference("prefs_key_settings_hide_app_icon"); mLogLevel = findPreference("prefs_key_log_level"); setIconMode(mIconMode); mIconModePreference.setOnPreferenceChangeListener(this); String language = LanguageHelper.getLanguage(getContext()); int value = LanguageHelper.resultIndex(LanguageHelper.appLanguages, language); mLanguage.setValueIndex(value); mLanguage.setOnPreferenceChangeListener( new Preference.OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(@NonNull Preference preference, Object o) { String v = LanguageHelper.appLanguages[Integer.parseInt((String) o)]; switch (v) { case "en" -> { LanguageHelper.setLanguage(getContext(), "en"); getActivity().recreate(); } case "zh_CN" -> { LanguageHelper.setLanguage(getContext(), "zh", "CN"); getActivity().recreate(); } case "zh_TW" -> { LanguageHelper.setLanguage(getContext(), "zh", "TW"); getActivity().recreate(); } case "zh_HK" -> { LanguageHelper.setLanguage(getContext(), "zh", "HK"); getActivity().recreate(); } case "ja_JP" -> { LanguageHelper.setLanguage(getContext(), "ja", "JP"); getActivity().recreate(); } case "ru_RU" -> { LanguageHelper.setLanguage(getContext(), "ru", "RU"); getActivity().recreate(); } case "es_ES" -> { LanguageHelper.setLanguage(getContext(), "es", "ES"); getActivity().recreate(); } case "pt_BR" -> { LanguageHelper.setLanguage(getContext(), "pt", "BR"); getActivity().recreate(); } case "in_ID" -> { LanguageHelper.setLanguage(getContext(), "in", "ID"); getActivity().recreate(); } case "tr_TR" -> { LanguageHelper.setLanguage(getContext(), "tr", "TR"); getActivity().recreate(); } case "vi_VN" -> { LanguageHelper.setLanguage(getContext(), "vi", "VN"); getActivity().recreate(); } } return true; } } ); switch (BuildConfig.BUILD_TYPE) { case "canary" -> { mLogLevel.setValueIndex(0); mLogLevel.setEntries(new CharSequence[]{"Info", "Debug"}); mLogLevel.setOnPreferenceChangeListener( (preference, o) -> { setLogLevel(Integer.parseInt((String) o) + 3); return true; } ); } /*case "debug" -> { mLogLevel.setEnabled(false); mLogLevel.setValueIndex(4); mLogLevel.setSummary(R.string.disable_detailed_log_more); }*/ default -> { mLogLevel.setOnPreferenceChangeListener( (preference, o) -> { setLogLevel(Integer.parseInt((String) o)); return true; } ); } } if (mHideAppIcon != null) { mHideAppIcon.setOnPreferenceChangeListener((preference, o) -> { PackageManager pm = requireActivity().getPackageManager(); int mComponentEnabledState; if ((Boolean) o) { mComponentEnabledState = PackageManager.COMPONENT_ENABLED_STATE_ENABLED; } else { mComponentEnabledState = PackageManager.COMPONENT_ENABLED_STATE_DISABLED; } pm.setComponentEnabledSetting(new ComponentName(requireActivity(), LauncherActivity.class), mComponentEnabledState, PackageManager.DONT_KILL_APP); return true; }); } findPreference("prefs_key_back").setOnPreferenceClickListener(preference -> { final AppCompatActivity activity = (AppCompatActivity) getActivity(); backupSettings(activity); return true; }); findPreference("prefs_key_rest").setOnPreferenceClickListener(preference -> { restoreSettings(getActivity()); return true; }); findPreference("prefs_key_reset").setOnPreferenceClickListener(preference -> { DialogHelper.showDialog(getActivity(), R.string.reset_title, R.string.reset_desc, (dialog, which) -> { PrefsUtils.mSharedPreferences.edit().clear().apply(); Toast.makeText(getActivity(), R.string.reset_okay, Toast.LENGTH_LONG).show(); }); return true; }); } @Override public boolean onPreferenceChange(Preference preference, Object o) { if (preference == mIconModePreference) { setIconMode(Integer.parseInt((String) o)); } return true; } private void setLogLevel(int level) { ShellInit.getShell().run("setprop persist.hyperceiler.log.level " + level); } private void setIconMode(int mode) { mIconModeValue.setVisible(mode != 0); } public void backupSettings(Activity activity) { BackupUtils.backup(activity); } public void restoreSettings(Activity activity) { BackupUtils.restore(activity); } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); RecyclerView recyclerView = view.findViewById(moralnorm.preference.R.id.recycler_view); ViewCompat.setOnApplyWindowInsetsListener(recyclerView, new OnApplyWindowInsetsListener() { @NonNull @Override public WindowInsetsCompat onApplyWindowInsets(@NonNull View v, @NonNull WindowInsetsCompat insets) { Insets inset = Insets.max(insets.getInsets(WindowInsetsCompat.Type.systemBars()), insets.getInsets(WindowInsetsCompat.Type.displayCutout())); // 22dp + 2dp + 12sp + 10dp + 18dp + 0.5dp + inset.bottom + 4dp(?) v.setPadding(inset.left, 0, inset.right, inset.bottom + dip2px(requireContext(), 56.5F) + sp2px(requireContext(), 12)); return insets; } }); } }
[ "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().clear().apply", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().clear", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run" ]
[((8520, 8572), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().clear().apply'), ((8520, 8564), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().clear'), ((8520, 8556), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit'), ((8590, 8666), 'android.widget.Toast.makeText(getActivity(), R.string.reset_okay, Toast.LENGTH_LONG).show'), ((9007, 9081), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run'), ((9950, 9986), 'androidx.core.view.WindowInsetsCompat.Type.systemBars'), ((10030, 10069), 'androidx.core.view.WindowInsetsCompat.Type.displayCutout')]
package com.sevtinge.hyperceiler.ui.fragment.helper; import android.content.res.Resources; import android.content.res.XmlResourceParser; import androidx.annotation.NonNull; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; import com.sevtinge.hyperceiler.utils.PackagesUtils; import com.sevtinge.hyperceiler.utils.ThreadPoolManager; import com.sevtinge.hyperceiler.utils.ToastHelper; import com.sevtinge.hyperceiler.utils.log.AndroidLogUtils; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import java.io.IOException; import moralnorm.preference.Preference; import moralnorm.preference.SwitchPreference; public class HomepageEntrance extends SettingsPreferenceFragment implements Preference.OnPreferenceChangeListener { public static final String ANDROID_NS = "http://schemas.android.com/apk/res/android"; private boolean isInit = false; private final String TAG = "HomepageEntrance"; private static EntranceState entranceState = null; @Override public int getContentResId() { return R.xml.prefs_set_homepage_entrance; } public static void setEntranceStateListen(EntranceState entranceState) { HomepageEntrance.entranceState = entranceState; } @Override public void initPrefs() { super.initPrefs(); if (isInit) return; Resources resources = getResources(); ThreadPoolManager.getInstance().submit(() -> { try (XmlResourceParser xml = resources.getXml(R.xml.prefs_set_homepage_entrance)) { try { int event = xml.getEventType(); while (event != XmlPullParser.END_DOCUMENT) { if (event == XmlPullParser.START_TAG) { if (xml.getName().equals("SwitchPreference")) { String key = xml.getAttributeValue(ANDROID_NS, "key"); SwitchPreference switchPreference = findPreference(key); if (switchPreference != null) { String summary = (String) switchPreference.getSummary(); if (summary != null && !summary.equals("android")) { if (PackagesUtils.checkAppStatus(getContext(), summary)) { switchPreference.setVisible(false); } } switchPreference.setOnPreferenceChangeListener(HomepageEntrance.this); } } } event = xml.next(); } isInit = true; } catch (XmlPullParserException | IOException e) { AndroidLogUtils.logE(TAG, "An error occurred when reading the XML:", e); } } }); } @Override public boolean onPreferenceChange(@NonNull Preference preference, Object o) { if (!isInit) { ToastHelper.makeText(getContext(), "尚未加载完毕,请稍后"); return false; } entranceState.onEntranceStateChange(preference.getKey(), (boolean) o); return true; } public interface EntranceState { void onEntranceStateChange(String key, boolean state); } }
[ "com.sevtinge.hyperceiler.utils.ThreadPoolManager.getInstance().submit" ]
[((1458, 3062), 'com.sevtinge.hyperceiler.utils.ThreadPoolManager.getInstance().submit')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.systemsettings; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.content.res.Resources; import android.os.Bundle; import android.os.UserHandle; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.ui.MainActivity; import com.sevtinge.hyperceiler.utils.api.ProjectApi; import java.util.ArrayList; import java.util.List; import de.robv.android.xposed.XposedHelpers; import moralnorm.os.Build; public class HyperCeilerSettings extends BaseHook { private int settingsIconResId; private Class<?> mPreferenceHeader; int mIconModeInt = mPrefsMap.getStringAsInt("settings_icon_mode", 0); @Override public void init() { addIconResource(); Class<?> mMiuiSettings = findClassIfExists("com.android.settings.MiuiSettings"); findAndHookMethod(mMiuiSettings, "updateHeaderList", List.class, new MethodHook() { @Override @SuppressLint("DiscouragedApi") protected void after(MethodHookParam param) throws Throwable { if (param.args[0] == null) return; Context mContext = ((Activity) param.thisObject).getBaseContext(); int opt = Integer.parseInt(mPrefsMap.getString("settings_icon", "0")); if (opt == 0) return; Resources modRes = getModuleRes(mContext); mPreferenceHeader = findClassIfExists("com.android.settingslib.miuisettings.preference.PreferenceActivity$Header"); if (mPreferenceHeader == null) return; Intent mIntent = new Intent(); mIntent.putExtra("isDisplayHomeAsUpEnabled", true); mIntent.setClassName(ProjectApi.mAppModulePkg, MainActivity.class.getCanonicalName()); Object header = XposedHelpers.newInstance(mPreferenceHeader); XposedHelpers.setLongField(header, "id", 666); XposedHelpers.setObjectField(header, "intent", mIntent); XposedHelpers.setIntField(header, "iconRes", settingsIconResId); XposedHelpers.setObjectField(header, "title", modRes.getString(R.string.app_name)); Bundle bundle = new Bundle(); ArrayList<UserHandle> users = new ArrayList<>(); users.add((UserHandle) XposedHelpers.newInstance(UserHandle.class, 0)); bundle.putParcelableArrayList("header_user", users); XposedHelpers.setObjectField(header, "extras", bundle); int themes = mContext.getResources().getIdentifier("launcher_settings", "id", mContext.getPackageName()); int special = mContext.getResources().getIdentifier("other_special_feature_settings", "id", mContext.getPackageName()); int timer = mContext.getResources().getIdentifier("app_timer", "id", mContext.getPackageName()); List<Object> headers = (List<Object>) param.args[0]; int position = 0; for (Object head : headers) { position++; long id = XposedHelpers.getLongField(head, "id"); if (opt == 1 && id == -1) { headers.add(position - 1, header); } else if (opt == 2 && id == themes) { headers.add(position, header); } else if (opt == 3 && id == (Integer.parseInt(Build.getMiuiVersionCode()) < 14 ? special : timer)) { headers.add(position, header); } } if (headers.size() > 25) { headers.add(25, header); } else { headers.add(header); } } }); } private void addIconResource() { if (mIconModeInt == 0) { settingsIconResId = R.drawable.ic_hyperceiler_settings_v140; } else { settingsIconResId = R.drawable.ic_hyperceiler_settings_v130; } } }
[ "com.sevtinge.hyperceiler.ui.MainActivity.class.getCanonicalName" ]
[((2611, 2648), 'com.sevtinge.hyperceiler.ui.MainActivity.class.getCanonicalName')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.mediaeditor; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; import org.luckypray.dexkit.result.MethodDataList; import java.lang.reflect.Method; public class UnlockMinimumCropLimit extends BaseHook { @Override public void init() throws NoSuchMethodException { MethodDataList methodDataList = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .returnType(int.class) .paramCount(0) .usingNumbers(0.5f, 200) ) ); for (MethodData methodData : methodDataList) { Method method = methodData.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "Current hooking method is " + method); hookMethod(method, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { param.setResult(0); } }); } } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod" ]
[((1296, 1539), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1296, 1329), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1341, 1529), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1382, 1515), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .returnType(int.class)\n .paramCount(0).usingNumbers'), ((1382, 1474), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .returnType(int.class).paramCount'), ((1382, 1443), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().returnType')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.ui; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import androidx.annotation.Nullable; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.callback.IResult; import com.sevtinge.hyperceiler.prefs.PreferenceHeader; import com.sevtinge.hyperceiler.ui.base.NavigationActivity; import com.sevtinge.hyperceiler.utils.BackupUtils; import com.sevtinge.hyperceiler.utils.Helpers; import com.sevtinge.hyperceiler.utils.PropUtils; import com.sevtinge.hyperceiler.utils.ThreadPoolManager; import com.sevtinge.hyperceiler.utils.api.ProjectApi; import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils; import com.sevtinge.hyperceiler.utils.search.SearchHelper; import com.sevtinge.hyperceiler.utils.shell.ShellInit; import moralnorm.appcompat.app.AlertDialog; public class MainActivity extends NavigationActivity implements IResult { private Handler handler; private Context context; @Override public void onCreate(Bundle savedInstanceState) { handler = new Handler(this.getMainLooper()); context = this; int def = Integer.parseInt(PrefsUtils.mSharedPreferences.getString("prefs_key_log_level", "2")); super.onCreate(savedInstanceState); new Thread(() -> SearchHelper.getAllMods(MainActivity.this, savedInstanceState != null)).start(); Helpers.checkXposedActivateState(this); ShellInit.init(this); PropUtils.setProp("persist.hyperceiler.log.level", (ProjectApi.isRelease() ? def : ProjectApi.isCanary() ? (def == 0 ? 3 : 4) : def)); // test(); } @Override public void error(String reason) { handler.post(() -> new AlertDialog.Builder(context) .setCancelable(false) .setTitle(getResources().getString(R.string.tip)) .setMessage(getResources().getString(R.string.root)) .setHapticFeedbackEnabled(true) .setPositiveButton(android.R.string.ok, null) .show()); } @Override protected void onDestroy() { ShellInit.destroy(); ThreadPoolManager.shutdown(); PreferenceHeader.mUninstallApp.clear(); PreferenceHeader.mDisableOrHiddenApp.clear(); super.onDestroy(); } public void test() { /*boolean ls = shellExec.append("ls").sync().isResult(); AndroidLogUtils.LogI(ITAG.TAG, "ls: " + ls); AndroidLogUtils.LogI(ITAG.TAG, shellExec.getOutPut().toString() + shellExec.getError().toString()); boolean f = shellExec.append("for i in $(seq 1 500); do echo $i; done").isResult(); AndroidLogUtils.LogI(ITAG.TAG, "for: " + f); AndroidLogUtils.LogI(ITAG.TAG, shellExec.getOutPut().toString()); boolean k = shellExec.append("for i in $(seq 1 500); do echo $i; done").sync().isResult(); AndroidLogUtils.LogI(ITAG.TAG, "fork: " + k); AndroidLogUtils.LogI(ITAG.TAG, shellExec.getOutPut().toString());*/ } private void requestCta() { /*if (!CtaUtils.isCtaEnabled(this)) { CtaUtils.showCtaDialog(this, REQUEST_CODE); }*/ } @Override protected void onNewIntent(Intent intent) { super.onNewIntent(intent); requestCta(); } @Override protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) { super.onActivityResult(requestCode, resultCode, data); if (data == null) return; try { AlertDialog.Builder alert = new AlertDialog.Builder(this); switch (requestCode) { case BackupUtils.CREATE_DOCUMENT_CODE -> { BackupUtils.handleCreateDocument(this, data.getData()); alert.setTitle(R.string.backup_success); } case BackupUtils.OPEN_DOCUMENT_CODE -> { BackupUtils.handleReadDocument(this, data.getData()); alert.setTitle(R.string.rest_success); } default -> { return; } } alert.setPositiveButton(android.R.string.ok, (dialog, which) -> { }); alert.show(); } catch (Exception e) { AlertDialog.Builder alert = new AlertDialog.Builder(this); switch (requestCode) { case BackupUtils.CREATE_DOCUMENT_CODE -> alert.setTitle(R.string.backup_failed); case BackupUtils.OPEN_DOCUMENT_CODE -> alert.setTitle(R.string.rest_failed); } alert.setMessage(e.toString()); alert.setPositiveButton(android.R.string.ok, (dialog, which) -> { }); alert.show(); } } }
[ "com.sevtinge.hyperceiler.prefs.PreferenceHeader.mUninstallApp.clear", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getString", "com.sevtinge.hyperceiler.prefs.PreferenceHeader.mDisableOrHiddenApp.clear" ]
[((1904, 1971), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getString'), ((2938, 2976), 'com.sevtinge.hyperceiler.prefs.PreferenceHeader.mUninstallApp.clear'), ((2986, 3030), 'com.sevtinge.hyperceiler.prefs.PreferenceHeader.mDisableOrHiddenApp.clear')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.milink; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; import java.lang.reflect.Method; public class UnlockHMind extends BaseHook { @Override public void init() throws NoSuchMethodException { MethodData methodData = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .usingStrings("HMindManager", "isHMindAble() context == null") ) ).singleOrThrow(() -> new IllegalStateException("UnlockHMind: Cannot found MethodData")); Method method = methodData.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "isHMindAble() method is " + method); hookMethod(method, new MethodHook() { @Override protected void after(MethodHookParam param) throws Throwable { param.setResult(true); } }); } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(\"HMindManager\", \"isHMindAble() context == null\")\n )\n ).singleOrThrow" ]
[((1232, 1530), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings("HMindManager", "isHMindAble() context == null")\n )\n ).singleOrThrow'), ((1232, 1443), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1232, 1265), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1277, 1433), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1318, 1419), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.various; import android.content.Context; import android.content.res.Configuration; import android.os.Build; import android.view.Gravity; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.widget.FrameLayout; import com.sevtinge.hyperceiler.XposedInit; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.utils.DisplayUtils; import com.sevtinge.hyperceiler.utils.blur.BlurUtils; import java.lang.reflect.Method; import java.util.LinkedList; import java.util.List; import de.robv.android.xposed.XposedHelpers; public class DialogCustom extends BaseHook { Context mContext; View mParentPanel = null; Class<?> mAlertControllerCls; Class<?> mDialogParentPanelCls; int mDialogGravity; int mDialogHorizontalMargin; int mDialogBottomMargin; @Override public void init() { if (lpparam.packageName.equals("com.miui.home")) { mAlertControllerCls = findClassIfExists("miui.home.lib.dialog.AlertController"); } else { mAlertControllerCls = findClassIfExists("miuix.appcompat.app.AlertController"); } mDialogParentPanelCls = findClassIfExists("miuix.internal.widget.DialogParentPanel"); List<Method> mAllMethodList = new LinkedList<>(); if (mPrefsMap.getBoolean("various_dialog_window_blur")) { hookAllConstructors(mAlertControllerCls, new MethodHook() { @Override protected void after(MethodHookParam param) { Window mWindow = (Window) XposedHelpers.getObjectField(param.thisObject, "mWindow"); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { mWindow.getAttributes().setBlurBehindRadius(mPrefsMap.getInt("various_dialog_window_blur_radius", 60)); // android.R.styleable.Window_windowBlurBehindRadius } mWindow.addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND); } }); } boolean oldMethodFound = false; if (mAlertControllerCls != null) { for (Method method : mAlertControllerCls.getDeclaredMethods()) { if (method.getName().equals("setupDialogPanel")) { oldMethodFound = true; logI(TAG, this.lpparam.packageName, method.getName()); } mAllMethodList.add(method); } mDialogGravity = XposedInit.mPrefsMap.getStringAsInt("various_dialog_gravity", 0); mDialogHorizontalMargin = XposedInit.mPrefsMap.getInt("various_dialog_margin_horizontal", 0); mDialogBottomMargin = XposedInit.mPrefsMap.getInt("various_dialog_margin_bottom", 0); } if (oldMethodFound) { logI(TAG, this.lpparam.packageName, "oldMethod found."); findAndHookMethod(mAlertControllerCls, "setupDialogPanel", Configuration.class, new MethodHook() { @Override protected void after(MethodHookParam param) { mParentPanel = (View) XposedHelpers.getObjectField(param.thisObject, "mParentPanel"); mContext = mParentPanel.getContext(); FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) mParentPanel.getLayoutParams(); if (mDialogGravity != 0) { layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT; layoutParams.gravity = mDialogGravity == 1 ? Gravity.CENTER : Gravity.BOTTOM | Gravity.CENTER; layoutParams.setMarginStart(mDialogHorizontalMargin == 0 ? 0 : DisplayUtils.dip2px(mContext, mDialogHorizontalMargin)); layoutParams.setMarginEnd(mDialogHorizontalMargin == 0 ? 0 : DisplayUtils.dip2px(mContext, mDialogHorizontalMargin)); layoutParams.bottomMargin = mDialogGravity == 1 ? 0 : DisplayUtils.dip2px(mContext, mDialogBottomMargin); } mParentPanel.setLayoutParams(layoutParams); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { new BlurUtils(mParentPanel, "various_dialog_bg_blur"); } } }); } else { logI(TAG, this.lpparam.packageName, "oldMethod not found."); hookAllMethods(mAlertControllerCls, "updateDialogPanel", new MethodHook() { @Override protected void after(MethodHookParam param) { mParentPanel = (View) XposedHelpers.getObjectField(param.thisObject, "mParentPanel"); mContext = mParentPanel.getContext(); FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) mParentPanel.getLayoutParams(); if (mDialogGravity != 0) { layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT; layoutParams.gravity = mDialogGravity == 1 ? Gravity.CENTER : Gravity.BOTTOM | Gravity.CENTER; layoutParams.setMarginStart(mDialogHorizontalMargin == 0 ? 0 : DisplayUtils.dip2px(mContext, mDialogHorizontalMargin)); layoutParams.setMarginEnd(mDialogHorizontalMargin == 0 ? 0 : DisplayUtils.dip2px(mContext, mDialogHorizontalMargin)); layoutParams.bottomMargin = mDialogGravity == 1 ? 0 : DisplayUtils.dip2px(mContext, mDialogBottomMargin); } mParentPanel.setLayoutParams(layoutParams); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { new BlurUtils(mParentPanel, "various_dialog_bg_blur"); } } }); } try { hookAllMethods(mAlertControllerCls, "updateParentPanelMarginByWindowInsets", new MethodHook() { @Override protected void after(MethodHookParam param) { mParentPanel = (View) XposedHelpers.getObjectField(param.thisObject, "mParentPanel"); mContext = mParentPanel.getContext(); FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) mParentPanel.getLayoutParams(); if (mDialogGravity != 0) { layoutParams.width = FrameLayout.LayoutParams.MATCH_PARENT; layoutParams.gravity = mDialogGravity == 1 ? Gravity.CENTER : Gravity.BOTTOM | Gravity.CENTER; layoutParams.setMarginStart(mDialogHorizontalMargin == 0 ? 0 : DisplayUtils.dip2px(mContext, mDialogHorizontalMargin)); layoutParams.setMarginEnd(mDialogHorizontalMargin == 0 ? 0 : DisplayUtils.dip2px(mContext, mDialogHorizontalMargin)); layoutParams.bottomMargin = mDialogGravity == 1 ? 0 : DisplayUtils.dip2px(mContext, mDialogBottomMargin); } mParentPanel.setLayoutParams(layoutParams); } }); } catch (Exception e) { logE(TAG, this.lpparam.packageName, e); } } }
[ "com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getStringAsInt", "com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getInt" ]
[((3289, 3353), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getStringAsInt'), ((3393, 3459), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getInt'), ((3495, 3557), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getInt')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.clipboard; import androidx.annotation.NonNull; import com.github.kyuubiran.ezxhelper.HookFactory; import com.github.kyuubiran.ezxhelper.interfaces.IMethodHookCallback; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.ClassMatcher; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; import java.util.function.Consumer; import de.robv.android.xposed.XC_MethodHook; public class SoGouClipboard extends BaseHook { public boolean clipboard; @Override public void init() { // DexKit.INSTANCE.initDexKit(lpparam); MethodData methodData = DexKit.INSTANCE.getDexKitBridge().findMethod( FindMethod.create() .matcher(MethodMatcher.create() .declaredClass(ClassMatcher.create() .usingStrings("sogou_clipboard_tmp")) .usingNumbers("com.sohu.inputmethod.sogou.xiaomi".equals(lpparam.packageName) ? 150 : 80064) ) ).singleOrThrow(() -> new IllegalStateException("Clipboard: No class found MethodData")); // logE("find class: " + lpparam.packageName); try { HookFactory.createMethodHook(methodData.getMethodInstance(lpparam.classLoader), new Consumer<HookFactory>() { @Override public void accept(HookFactory hookFactory) { hookFactory.before( new IMethodHookCallback() { @Override public void onMethodHooked(@NonNull XC_MethodHook.MethodHookParam methodHookParam) { clipboard = true; // logE(TAG, "im run true"); } } ); hookFactory.after( new IMethodHookCallback() { @Override public void onMethodHooked(@NonNull XC_MethodHook.MethodHookParam methodHookParam) { clipboard = false; // logE(TAG, "im run false"); } } ); } }); } catch (NoSuchMethodException e) { logE(TAG, this.lpparam.packageName, "NoSuchMethodException: " + e); } findAndHookMethod("org.greenrobot.greendao.query.QueryBuilder", "list", new MethodHook() { @Override protected void before(MethodHookParam param) { if (clipboard) { param.setResult(null); // logE(TAG, "im run"); } } } ); // DexKit.INSTANCE.closeDexKit(); } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(\n FindMethod.create()\n .matcher(MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings(\"sogou_clipboard_tmp\"))\n .usingNumbers(\"com.sohu.inputmethod.sogou.xiaomi\".equals(lpparam.packageName) ? 150 : 80064)\n )\n ).singleOrThrow", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod" ]
[((1552, 2024), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(\n FindMethod.create()\n .matcher(MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("sogou_clipboard_tmp"))\n .usingNumbers("com.sohu.inputmethod.sogou.xiaomi".equals(lpparam.packageName) ? 150 : 80064)\n )\n ).singleOrThrow'), ((1552, 1937), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1552, 1585), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1610, 1927), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1655, 1909), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("sogou_clipboard_tmp")).usingNumbers'), ((1655, 1796), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().declaredClass'), ((1713, 1795), 'org.luckypray.dexkit.query.matchers.ClassMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.securitycenter.sidebar.video; import com.github.kyuubiran.ezxhelper.HookFactory; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.ClassMatcher; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; public class VideoDolbyOpen extends BaseHook { @Override public void init() { // try { // findClassIfExists("com.miui.gamebooster.service.DockWindowManagerService").getDeclaredMethod("N"); // findAndHookMethod("com.miui.gamebooster.service.DockWindowManagerService", "N", new MethodHook() { // @Override // protected void before(MethodHookParam param) { // logI("Hook N"); // param.setResult(null); // } // }); // } catch (NoSuchMethodException e) { // logI("Don't Find DockWindowManagerService$N"); // } // 查找类 // ClassData data = DexKit.INSTANCE.getDexKitBridge().findClass(FindClass.create() // .searchPackages("com.miui.gamebooster.service") // .matcher(ClassMatcher.create() // .className("com.miui.gamebooster.service.DockWindowManagerService") // ) // ).singleOrThrow(() -> new IllegalStateException("VideoDolbyOpen: No class found ClassData")); // // 类加入列表 // List<ClassData> list = Collections.singletonList(data); // 查找方法 MethodData methodData = DexKit.INSTANCE.getDexKitBridge().findMethod( FindMethod.create() .matcher(MethodMatcher.create() .declaredClass(ClassMatcher.create() .usingStrings("checkMiGamePermission error")) .usingStrings("dolby") ) ).singleOrThrow(() -> new IllegalStateException("VideoDolbyOpen: No class found MethodData")); // 执行Hook try { HookFactory.createMethodHook(methodData.getMethodInstance(lpparam.classLoader), hookFactory -> hookFactory.before( methodHookParam -> methodHookParam.setResult(null) )); } catch (NoSuchMethodException e) { logE(TAG, this.lpparam.packageName, "NoSuchMethodException: " + e); } } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(\n FindMethod.create()\n .matcher(MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings(\"checkMiGamePermission error\"))\n .usingStrings(\"dolby\")\n )\n ).singleOrThrow", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod" ]
[((2431, 2846), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(\n FindMethod.create()\n .matcher(MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("checkMiGamePermission error"))\n .usingStrings("dolby")\n )\n ).singleOrThrow'), ((2431, 2754), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((2431, 2464), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((2489, 2744), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((2534, 2726), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("checkMiGamePermission error")).usingStrings'), ((2534, 2683), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().declaredClass'), ((2592, 2682), 'org.luckypray.dexkit.query.matchers.ClassMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.ui.fragment; import static com.sevtinge.hyperceiler.utils.api.VoyagerApisKt.isPad; import android.os.Handler; import androidx.annotation.NonNull; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; import com.sevtinge.hyperceiler.utils.KillApp; import com.sevtinge.hyperceiler.utils.ThreadPoolManager; import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils; import moralnorm.preference.DropDownPreference; import moralnorm.preference.Preference; import moralnorm.preference.PreferenceCategory; import moralnorm.preference.SwitchPreference; public class VariousFragment extends SettingsPreferenceFragment implements Preference.OnPreferenceChangeListener { DropDownPreference mSuperModePreference; PreferenceCategory mDefault; SwitchPreference mClipboard; Preference mMipad; // 平板相关功能 Handler handler; @Override public int getContentResId() { return R.xml.various; } @Override public void initPrefs() { int mode = Integer.parseInt(PrefsUtils.getSharedStringPrefs(getContext(), "prefs_key_various_super_clipboard_e", "0")); mSuperModePreference = findPreference("prefs_key_various_super_clipboard_e"); mDefault = findPreference("prefs_key_various_super_clipboard_key"); mMipad = findPreference("prefs_key_various_mipad"); mClipboard = findPreference("prefs_key_sogou_xiaomi_clipboard"); mMipad.setVisible(isPad()); handler = new Handler(); mClipboard.setOnPreferenceChangeListener((preference, o) -> { initKill(); return true; }); setSuperMode(mode); mSuperModePreference.setOnPreferenceChangeListener(this); } private void initKill() { ThreadPoolManager.getInstance().submit(() -> { handler.post(() -> KillApp.killApps("com.sohu.inputmethod.sogou.xiaomi", "com.sohu.inputmethod.sogou")); }); } @Override public boolean onPreferenceChange(@NonNull Preference preference, Object o) { if (preference == mSuperModePreference) { setSuperMode(Integer.parseInt((String) o)); } return true; } private void setSuperMode(int mode) { mDefault.setVisible(mode == 1); } }
[ "com.sevtinge.hyperceiler.utils.ThreadPoolManager.getInstance().submit" ]
[((2554, 2764), 'com.sevtinge.hyperceiler.utils.ThreadPoolManager.getInstance().submit')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.systemframework; import com.sevtinge.hyperceiler.module.base.tool.HookTool; import de.robv.android.xposed.IXposedHookZygoteInit; import de.robv.android.xposed.XC_MethodHook; import de.robv.android.xposed.XposedHelpers; public class AllowManageAllNotifications implements IXposedHookZygoteInit { @Override public void initZygote(IXposedHookZygoteInit.StartupParam startupParam) throws NoSuchMethodException { XposedHelpers.findAndHookMethod("android.app.NotificationChannel", startupParam.getClass().getClassLoader(), "isBlockable", HookTool.MethodHook.returnConstant(true)); XposedHelpers.findAndHookMethod("android.app.NotificationChannel", startupParam.getClass().getClassLoader(), "setBlockable", boolean.class, new XC_MethodHook() { @Override protected void beforeHookedMethod(MethodHookParam param) throws Throwable { param.args[0] = true; } }); } }
[ "com.sevtinge.hyperceiler.module.base.tool.HookTool.MethodHook.returnConstant" ]
[((1332, 1372), 'com.sevtinge.hyperceiler.module.base.tool.HookTool.MethodHook.returnConstant')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.utils.prefs; import android.content.Context; import android.content.SharedPreferences; import android.database.Cursor; import android.net.Uri; import com.sevtinge.hyperceiler.XposedInit; import com.sevtinge.hyperceiler.utils.Helpers; import com.sevtinge.hyperceiler.utils.api.ProjectApi; import com.sevtinge.hyperceiler.utils.log.XposedLogUtils; import com.sevtinge.hyperceiler.utils.prefs.PrefsChangeObserver.PrefToUri; import java.io.File; import java.lang.reflect.Field; import java.util.LinkedHashSet; import java.util.Set; import de.robv.android.xposed.XposedBridge; public class PrefsUtils { public static SharedPreferences mSharedPreferences = null; public static String mPrefsPathCurrent = null; public static String mPrefsFileCurrent = null; public static String mPrefsName = "hyperceiler_prefs"; public static String mPrefsPath = "/data/user_de/0/" + ProjectApi.mAppModulePkg + "/shared_prefs"; public static String mPrefsFile = mPrefsPath + "/" + mPrefsName + ".xml"; public static SharedPreferences getSharedPrefs(Context context, boolean multiProcess) { context = Helpers.getProtectedContext(context); try { return context.getSharedPreferences(mPrefsName, multiProcess ? Context.MODE_MULTI_PROCESS | Context.MODE_WORLD_READABLE : Context.MODE_WORLD_READABLE); } catch (Throwable t) { return context.getSharedPreferences(mPrefsName, multiProcess ? Context.MODE_MULTI_PROCESS | Context.MODE_PRIVATE : Context.MODE_PRIVATE); } } public static SharedPreferences getSharedPrefs(Context context) { return getSharedPrefs(context, false); } public static String getSharedPrefsPath() { if (mPrefsPathCurrent == null) try { Field mFile = mSharedPreferences.getClass().getDeclaredField("mFile"); mFile.setAccessible(true); mPrefsPathCurrent = ((File) mFile.get(mSharedPreferences)).getParentFile().getAbsolutePath(); return mPrefsPathCurrent; } catch (Throwable t) { System.out.print("Test" + t); return mPrefsPath; } else return mPrefsPathCurrent; } public static String getSharedPrefsFile() { if (mPrefsFileCurrent == null) try { Field fFile = mSharedPreferences.getClass().getDeclaredField("mFile"); fFile.setAccessible(true); mPrefsFileCurrent = ((File) fFile.get(mSharedPreferences)).getAbsolutePath(); System.out.println("Test: mPrefsFileCurrent"); return mPrefsFileCurrent; } catch (Throwable t) { System.out.println("Test: mPrefsFile" + t); return mPrefsFile; } else System.out.println("Test: mPrefsFileCurrent2"); return mPrefsFileCurrent; } public static boolean contains(String key) { return mSharedPreferences.contains(key); } public static SharedPreferences.Editor editor() { return mSharedPreferences.edit(); } public static String getSharedStringPrefs(Context context, String name, String defValue) { Uri uri = PrefToUri.stringPrefToUri(name, defValue); try { Cursor cursor = context.getContentResolver().query(uri, null, null, null, null); if (cursor != null && cursor.moveToFirst()) { String prefValue = cursor.getString(0); cursor.close(); return prefValue; } else XposedLogUtils.logI("ContentResolver", "[" + name + "] Cursor fail: " + cursor); } catch (Throwable t) { XposedBridge.log(t); } if (XposedInit.mPrefsMap.containsKey(name)) return (String) XposedInit.mPrefsMap.getObject(name, defValue); else return defValue; } public static Set<String> getSharedStringSetPrefs(Context context, String name) { Uri uri = PrefToUri.stringSetPrefToUri(name); try { Cursor cursor = context.getContentResolver().query(uri, null, null, null, null); if (cursor != null) { Set<String> prefValue = new LinkedHashSet<>(); while (cursor.moveToNext()) { prefValue.add(cursor.getString(0)); } cursor.close(); return prefValue; } else { XposedLogUtils.logI("ContentResolver", "[" + name + "] Cursor fail: null"); } } catch (Throwable t) { XposedBridge.log(t); } LinkedHashSet<String> empty = new LinkedHashSet<>(); if (XposedInit.mPrefsMap.containsKey(name)) { return (Set<String>) XposedInit.mPrefsMap.getObject(name, empty); } else { return empty; } } public static int getSharedIntPrefs(Context context, String name, int defValue) { Uri uri = PrefToUri.intPrefToUri(name, defValue); try { Cursor cursor = context.getContentResolver().query(uri, null, null, null, null); if (cursor != null && cursor.moveToFirst()) { int prefValue = cursor.getInt(0); cursor.close(); return prefValue; } else XposedLogUtils.logI("ContentResolver", "[" + name + "] Cursor fail: " + cursor); } catch (Throwable t) { XposedBridge.log(t); } if (XposedInit.mPrefsMap.containsKey(name)) return (int) XposedInit.mPrefsMap.getObject(name, defValue); else return defValue; } public static boolean getSharedBoolPrefs(Context context, String name, boolean defValue) { Uri uri = PrefToUri.boolPrefToUri(name, defValue); try { Cursor cursor = context.getContentResolver().query(uri, null, null, null, null); if (cursor != null && cursor.moveToFirst()) { int prefValue = cursor.getInt(0); cursor.close(); return prefValue == 1; } else XposedLogUtils.logI("ContentResolver", "[" + name + "] Cursor fail: " + cursor); } catch (Throwable t) { XposedBridge.log(t); } if (XposedInit.mPrefsMap.containsKey(name)) return (boolean) XposedInit.mPrefsMap.getObject(name, false); else return defValue; } }
[ "com.sevtinge.hyperceiler.XposedInit.mPrefsMap.containsKey", "com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getObject" ]
[((4435, 4473), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.containsKey'), ((4503, 4549), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getObject'), ((5394, 5432), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.containsKey'), ((5469, 5512), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getObject'), ((6188, 6226), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.containsKey'), ((6253, 6299), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getObject'), ((6967, 7005), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.containsKey'), ((7036, 7079), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getObject')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.ui.fragment.sub; import android.os.Bundle; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils; import moralnorm.preference.ColorPickerPreference; import moralnorm.preference.Preference; import moralnorm.preference.SeekBarPreference; import moralnorm.preference.SwitchPreference; public class CustomBackgroundSettings extends SettingsPreferenceFragment implements Preference.OnPreferenceChangeListener { private String mKey = ""; private String mCustomBackgroundEnabledKey; private String mColorKey; private String mCornerRadiusKey; private String mBlurEnabledKey; private String mBlurRadiusKey; private SwitchPreference mCustomEnabledPreference; private ColorPickerPreference mColorPickerPreference; private SeekBarPreference mCornerRadiusPreference; private SwitchPreference mBlurEnabledPreference; private SeekBarPreference mBlurRadiusPreference; @Override public int getContentResId() { return R.xml.custom_background; } @Override public void initPrefs() { Bundle args = getArguments(); if (args != null) { mKey = args.getString("key"); mCustomBackgroundEnabledKey = mKey + "_custom_enable"; mColorKey = mKey + "_color"; mCornerRadiusKey = mKey + "_corner_radius"; mBlurEnabledKey = mKey + "_blur_enabled"; mBlurRadiusKey = mKey + "_blur_radius"; } else { finish(); } mCustomEnabledPreference = findPreference("prefs_key_custom_background_enabled"); mColorPickerPreference = findPreference("prefs_key_custom_background_color"); mCornerRadiusPreference = findPreference("prefs_key_custom_background_corner_radius"); mBlurEnabledPreference = findPreference("prefs_key_custom_background_blur_enabled"); mBlurRadiusPreference = findPreference("prefs_key_custom_background_blur_radius"); loadData(); mCustomEnabledPreference.setOnPreferenceChangeListener(this); mColorPickerPreference.setOnPreferenceChangeListener(this); mCornerRadiusPreference.setOnPreferenceChangeListener(this); mBlurEnabledPreference.setOnPreferenceChangeListener(this); mBlurRadiusPreference.setOnPreferenceChangeListener(this); } private void loadData() { mCustomEnabledPreference.setChecked(isCustomEnabled()); mColorPickerPreference.setColor(getColor(-1)); mCornerRadiusPreference.setValue(getSeekBarValue(mCornerRadiusKey, 18)); mBlurEnabledPreference.setChecked(isBackgroundBlurEnabled()); mBlurRadiusPreference.setValue(getSeekBarValue(mBlurRadiusKey, 60)); } private boolean isCustomEnabled() { return hasKey(mCustomBackgroundEnabledKey) && PrefsUtils.getSharedBoolPrefs(getContext(), mCustomBackgroundEnabledKey, false); } private void setColor() { mColorPickerPreference.setColor(getColor(2113929215)); } private int getColor(int defValue) { return hasKey(mColorKey) ? PrefsUtils.getSharedIntPrefs(getContext(), mColorKey, defValue) : defValue; } private boolean isBackgroundBlurEnabled() { return hasKey(mBlurEnabledKey) && PrefsUtils.getSharedBoolPrefs(getContext(), mBlurEnabledKey, false); } private int getSeekBarValue(String key, int defValue) { return hasKey(key) ? PrefsUtils.getSharedIntPrefs(getContext(), key, defValue) : defValue; } @Override public boolean onPreferenceChange(Preference preference, Object o) { if (preference == mCustomEnabledPreference) { setCustomEnable((Boolean) o); } else if (preference == mColorPickerPreference) { setBackgroundColor((int) o); } else if (preference == mCornerRadiusPreference) { setBackgroundCornerRadius((int) o); } else if (preference == mBlurEnabledPreference) { setBlurEnabled((Boolean) o); } else if (preference == mBlurRadiusPreference) { setBackgroundBlurRadius((int) o); } return false; } private void setCustomEnable(boolean isCustomEnabled) { mCustomEnabledPreference.setChecked(isCustomEnabled); PrefsUtils.mSharedPreferences.edit().putBoolean(mCustomBackgroundEnabledKey, isCustomEnabled).apply(); } private void setBackgroundColor(int value) { mColorPickerPreference.setColor(value); PrefsUtils.mSharedPreferences.edit().putInt(mColorKey, value).apply(); } private void setBackgroundCornerRadius(int value) { mCornerRadiusPreference.setValue(value); PrefsUtils.mSharedPreferences.edit().putInt(mCornerRadiusKey, value).apply(); } private void setBlurEnabled(boolean isBlurEnabled) { mBlurEnabledPreference.setChecked(isBlurEnabled); PrefsUtils.mSharedPreferences.edit().putBoolean(mBlurEnabledKey, isBlurEnabled).apply(); } private void setBackgroundBlurRadius(int value) { mBlurRadiusPreference.setValue(value); PrefsUtils.mSharedPreferences.edit().putInt(mBlurRadiusKey, value).apply(); } }
[ "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putInt", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putInt(mColorKey, value).apply", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putBoolean(mBlurEnabledKey, isBlurEnabled).apply", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putBoolean", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putInt(mBlurRadiusKey, value).apply", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putInt(mCornerRadiusKey, value).apply", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putBoolean(mCustomBackgroundEnabledKey, isCustomEnabled).apply" ]
[((5110, 5211), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putBoolean(mCustomBackgroundEnabledKey, isCustomEnabled).apply'), ((5110, 5203), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putBoolean'), ((5110, 5146), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit'), ((5325, 5394), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putInt(mColorKey, value).apply'), ((5325, 5386), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putInt'), ((5325, 5361), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit'), ((5516, 5592), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putInt(mCornerRadiusKey, value).apply'), ((5516, 5584), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putInt'), ((5516, 5552), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit'), ((5724, 5811), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putBoolean(mBlurEnabledKey, isBlurEnabled).apply'), ((5724, 5803), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putBoolean'), ((5724, 5760), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit'), ((5929, 6003), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putInt(mBlurRadiusKey, value).apply'), ((5929, 5995), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putInt'), ((5929, 5965), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.securitycenter; import android.content.Context; import android.database.ContentObserver; import android.os.Handler; import android.provider.Settings; import android.view.View; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindClass; import org.luckypray.dexkit.query.FindField; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.ClassMatcher; import org.luckypray.dexkit.query.matchers.FieldMatcher; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.ClassData; import org.luckypray.dexkit.result.FieldData; import org.luckypray.dexkit.result.MethodData; import java.lang.reflect.Field; /** * @author 焕晨HChen */ public class ScLockApp extends BaseHook { boolean isListen = false; boolean isLock = false; int value = 0; @Override public void init() throws NoSuchMethodException { MethodData methodData = DexKit.INSTANCE.getDexKitBridge().findMethod( FindMethod.create() .matcher(MethodMatcher.create() .declaredClass(ClassMatcher.create() .usingStrings("startRegionSampling") ) .name("dispatchTouchEvent") ) ).singleOrNull(); ClassData data = DexKit.INSTANCE.getDexKitBridge().findClass( FindClass.create() .matcher(ClassMatcher.create() .usingStrings("startRegionSampling") ) ).singleOrNull(); FieldData fieldData = null; if (methodData == null) { value = 1; methodData = DexKit.INSTANCE.getDexKitBridge().findMethod( FindMethod.create() .matcher(MethodMatcher.create() .declaredClass(ClassMatcher.create() .usingStrings("SidebarTouchListener") ) .name("onTouch") ) ).singleOrNull(); data = DexKit.INSTANCE.getDexKitBridge().findClass( FindClass.create() .matcher(ClassMatcher.create() .usingStrings("onTouch: \taction = ") ) ).singleOrNull(); fieldData = DexKit.INSTANCE.getDexKitBridge().findField( FindField.create() .matcher( FieldMatcher.create() .declaredClass( ClassMatcher.create() .usingStrings("onTouch: \taction = ") ) .type(View.class) ) ).singleOrNull(); } try { // logE(TAG, "dispatchTouchEvent: " + methodData + " Constructor: " + data + " class: " + data.getInstance(lpparam.classLoader) + " f: " + fieldData.getFieldInstance(lpparam.classLoader)); if (data == null) { logE(TAG, "Class is null"); return; } if (fieldData == null && value == 1) { logE(TAG, "Field is null"); return; } assert fieldData != null; Field field = fieldData.getFieldInstance(lpparam.classLoader); hookAllConstructors(data.getInstance(lpparam.classLoader), new MethodHook() { @Override protected void after(MethodHookParam param) { Context context = null; if (value == 1) { try { context = ((View) field.get(param.thisObject)).getContext(); } catch (IllegalAccessException e) { logE(TAG, "getContext E: " + e); } } else { context = (Context) param.args[0]; } if (context == null) { logE(TAG, "Context is null"); return; } if (!isListen) { Context finalContext = context; ContentObserver contentObserver = new ContentObserver(new Handler(finalContext.getMainLooper())) { @Override public void onChange(boolean selfChange) { isLock = getLockApp(finalContext) != -1; } }; context.getContentResolver().registerContentObserver( Settings.Global.getUriFor("key_lock_app"), false, contentObserver); isListen = true; } } }); } catch (ClassNotFoundException | NoSuchFieldException e) { logE(TAG, "hook Constructor E: " + data); } if (methodData == null) { logE(TAG, "Method is null"); return; } hookMethod(methodData.getMethodInstance(lpparam.classLoader), new MethodHook() { @Override protected void before(MethodHookParam param) { if (isLock) { param.setResult(false); } } } ); } public static int getLockApp(Context context) { try { return Settings.Global.getInt(context.getContentResolver(), "key_lock_app"); } catch (Settings.SettingNotFoundException e) { logE("LockApp", "getInt hyceiler_lock_app will set E: " + e); } return -1; } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(\n FindMethod.create()\n .matcher(MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings(\"SidebarTouchListener\")\n )\n .name(\"onTouch\")\n )\n ).singleOrNull", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findField(\n FindField.create()\n .matcher(\n FieldMatcher.create()\n .declaredClass(\n ClassMatcher.create()\n .usingStrings(\"onTouch: \\taction = \")\n )\n .type(View.class)\n )\n ).singleOrNull", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findClass(\n FindClass.create()\n .matcher(ClassMatcher.create()\n .usingStrings(\"startRegionSampling\")\n )\n ).singleOrNull", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findClass", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findClass(\n FindClass.create()\n .matcher(ClassMatcher.create()\n .usingStrings(\"onTouch: \\taction = \")\n )\n ).singleOrNull", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(\n FindMethod.create()\n .matcher(MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings(\"startRegionSampling\")\n )\n .name(\"dispatchTouchEvent\")\n )\n ).singleOrNull", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findField" ]
[((1793, 2149), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(\n FindMethod.create()\n .matcher(MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("startRegionSampling")\n )\n .name("dispatchTouchEvent")\n )\n ).singleOrNull'), ((1793, 2134), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1793, 1826), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1851, 2124), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1896, 2106), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("startRegionSampling")\n ).name'), ((1896, 2058), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().declaredClass'), ((1954, 2036), 'org.luckypray.dexkit.query.matchers.ClassMatcher.create().usingStrings'), ((2176, 2398), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findClass(\n FindClass.create()\n .matcher(ClassMatcher.create()\n .usingStrings("startRegionSampling")\n )\n ).singleOrNull'), ((2176, 2383), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findClass'), ((2176, 2209), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((2233, 2373), 'org.luckypray.dexkit.query.FindClass.create().matcher'), ((2277, 2355), 'org.luckypray.dexkit.query.matchers.ClassMatcher.create().usingStrings'), ((2518, 2896), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(\n FindMethod.create()\n .matcher(MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("SidebarTouchListener")\n )\n .name("onTouch")\n )\n ).singleOrNull'), ((2518, 2881), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((2518, 2551), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((2580, 2867), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((2629, 2845), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("SidebarTouchListener")\n ).name'), ((2629, 2804), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().declaredClass'), ((2691, 2778), 'org.luckypray.dexkit.query.matchers.ClassMatcher.create().usingStrings'), ((2917, 3160), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findClass(\n FindClass.create()\n .matcher(ClassMatcher.create()\n .usingStrings("onTouch: \\taction = ")\n )\n ).singleOrNull'), ((2917, 3145), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findClass'), ((2917, 2950), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((2978, 3131), 'org.luckypray.dexkit.query.FindClass.create().matcher'), ((3026, 3109), 'org.luckypray.dexkit.query.matchers.ClassMatcher.create().usingStrings'), ((3186, 3640), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findField(\n FindField.create()\n .matcher(\n FieldMatcher.create()\n .declaredClass(\n ClassMatcher.create()\n .usingStrings("onTouch: \\taction = ")\n )\n .type(View.class)\n )\n ).singleOrNull'), ((3186, 3625), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findField'), ((3186, 3219), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((3247, 3611), 'org.luckypray.dexkit.query.FindField.create().matcher'), ((3320, 3589), 'org.luckypray.dexkit.query.matchers.FieldMatcher.create()\n .declaredClass(\n ClassMatcher.create()\n .usingStrings("onTouch: \\taction = ")\n ).type'), ((3320, 3543), 'org.luckypray.dexkit.query.matchers.FieldMatcher.create().declaredClass'), ((3418, 3513), 'org.luckypray.dexkit.query.matchers.ClassMatcher.create().usingStrings'), ((5576, 5617), 'android.provider.Settings.Global.getUriFor'), ((6436, 6504), 'android.provider.Settings.Global.getInt')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.ui.fragment.sub; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.os.Bundle; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.ui.SubPickerActivity; import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils; import moralnorm.preference.Preference; import moralnorm.preference.RadioButtonPreference; public class MultiActionSettings extends SettingsPreferenceFragment { Bundle args; String mKey = null; String mActionKey; String mAppValue; RadioButtonPreference mClearMemory; RadioButtonPreference mInvertColors; RadioButtonPreference mNoAction; RadioButtonPreference mOpenNotificationCenter; RadioButtonPreference mScreenLock; RadioButtonPreference mScreenSleep; RadioButtonPreference mScreenCapture; RadioButtonPreference mOpenPowerMenu; RadioButtonPreference mScreenRecents; RadioButtonPreference mVolumeDialog; RadioButtonPreference mOpenApp; Preference mAppSelector; @Override public int getContentResId() { return R.xml.home_multi_action; } @Override public void initPrefs() { args = getArguments(); mKey = args.getString("key"); mActionKey = mKey + "_action"; mNoAction = findPreference("prefs_key_no_action"); mOpenNotificationCenter = findPreference("prefs_key_open_notification_center"); mScreenLock = findPreference("prefs_key_screen_lock"); mScreenSleep = findPreference("prefs_key_screen_sleep"); mScreenCapture = findPreference("prefs_key_screen_capture"); mOpenPowerMenu = findPreference("prefs_key_open_powermenu"); mClearMemory = findPreference("prefs_key_clear_memory"); mInvertColors = findPreference("prefs_key_invert_colors"); mScreenRecents = findPreference("prefs_key_screen_recents"); mVolumeDialog = findPreference("prefs_key_volume_dialog"); mOpenApp = findPreference("prefs_key_open_app"); mAppSelector = findPreference("prefs_key_open_app_selector"); updateAction(); } private void updateAction() { int value = hasKey(mActionKey) ? PrefsUtils.getSharedIntPrefs(getContext(), mActionKey, 0) : 0; switch (value) { case 0 -> mNoAction.setChecked(true); case 1 -> mOpenNotificationCenter.setChecked(true); case 2 -> mClearMemory.setChecked(true); case 3 -> mInvertColors.setChecked(true); case 4 -> mScreenLock.setChecked(true); case 5 -> mScreenSleep.setChecked(true); case 6 -> mScreenCapture.setChecked(true); case 7 -> mScreenRecents.setChecked(true); case 8 -> mVolumeDialog.setChecked(true); case 12 -> mOpenPowerMenu.setChecked(true); case 13 -> { mOpenApp.setChecked(true); updateAppSelectorTitle(); } } } @Override public boolean onPreferenceTreeClick(Preference preference) { if (preference != mAppSelector) { editActionIntSharedPrefs(getAction(preference)); } else { Intent intent = new Intent(getActivity(), SubPickerActivity.class); intent.putExtra("mode", AppPicker.CALLBACK_MODE); startActivityForResult(intent, 0); } return true; } private int getAction(Preference preference) { if (preference == mOpenNotificationCenter) { return 1; } else if (preference == mClearMemory) { return 2; } else if (preference == mInvertColors) { return 3; } else if (preference == mScreenLock) { return 4; } else if (preference == mScreenSleep) { return 5; } else if (preference == mScreenCapture) { return 6; } else if (preference == mScreenRecents) { return 7; } else if (preference == mVolumeDialog) { return 8; } else if (preference == mOpenPowerMenu) { return 12; } else if (preference == mOpenApp) { return 13; } else { return 0; } } private void editActionIntSharedPrefs(int value) { PrefsUtils.mSharedPreferences.edit().putInt(mActionKey, value).apply(); } public void updateAppSelectorTitle() { if (hasKey(mKey + "_app")) { String title = getAppName(getContext(), PrefsUtils.mSharedPreferences.getString(mKey + "_app", "")); mAppSelector.setTitle(title); } } public static String getAppName(Context context, String pkgActName) { return getAppName(context, pkgActName, false); } public static String getAppName(Context context, String pkgActName, boolean forcePkg) { PackageManager pm = context.getPackageManager(); String notSelected = "None"; String[] pkgActArray = pkgActName.split("\\|"); ApplicationInfo ai; if (!pkgActName.equals(notSelected)) { if (pkgActArray.length >= 1 && pkgActArray[0] != null) try { if (!forcePkg && pkgActArray.length >= 2 && pkgActArray[1] != null && !pkgActArray[1].trim().equals("")) { return pm.getActivityInfo(new ComponentName(pkgActArray[0], pkgActArray[1]), 0).loadLabel(pm).toString(); } else if (!pkgActArray[0].trim().equals("")) { ai = pm.getApplicationInfo(pkgActArray[0], 0); return pm.getApplicationLabel(ai).toString(); } } catch (Throwable e) { e.printStackTrace(); } } return null; } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == 1) { String mAppPackageName = data.getStringExtra("appPackageName"); String mAppActivityName = data.getStringExtra("appActivityName"); PrefsUtils.mSharedPreferences.edit().putString(mKey + "_app", mAppPackageName + "|" + mAppActivityName).apply(); updateAppSelectorTitle(); } } }
[ "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putInt", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getString", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putInt(mActionKey, value).apply", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putString", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putString(mKey + \"_app\", mAppPackageName + \"|\" + mAppActivityName).apply" ]
[((5195, 5265), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putInt(mActionKey, value).apply'), ((5195, 5257), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putInt'), ((5195, 5231), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit'), ((5406, 5464), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getString'), ((6997, 7108), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putString(mKey + "_app", mAppPackageName + "|" + mAppActivityName).apply'), ((6997, 7100), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putString'), ((6997, 7033), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.voiceassist; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; import java.lang.reflect.Method; public class DisableChatWatermark extends BaseHook { @Override public void init() throws NoSuchMethodException { MethodData methodData = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .usingStrings("userId", "add watermark") ) ).singleOrThrow(() -> new IllegalStateException("DisableChatWatermark: Cannot found MethodData")); Method method = methodData.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "addWatermarkIfNeed() method is " + method); hookMethod(method, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { param.setResult(null); } }); } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(\"userId\", \"add watermark\")\n )\n ).singleOrThrow", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod" ]
[((1246, 1531), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings("userId", "add watermark")\n )\n ).singleOrThrow'), ((1246, 1435), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1246, 1279), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1291, 1425), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1332, 1411), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.ui.fragment.systemui; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isHyperOSVersion; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreAndroidVersion; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.provider.Settings; import android.view.View; import android.widget.SeekBar; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.prefs.RecommendPreference; import com.sevtinge.hyperceiler.ui.SubPickerActivity; import com.sevtinge.hyperceiler.ui.base.BaseSettingsActivity; import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; import com.sevtinge.hyperceiler.ui.fragment.sub.AppPicker; import com.sevtinge.hyperceiler.utils.KillApp; import com.sevtinge.hyperceiler.utils.ThreadPoolManager; import com.sevtinge.hyperceiler.utils.devicesdk.TelephonyManager; import com.sevtinge.hyperceiler.utils.log.AndroidLogUtils; import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils; import moralnorm.preference.DropDownPreference; import moralnorm.preference.Preference; import moralnorm.preference.SeekBarPreferenceEx; import moralnorm.preference.SwitchPreference; public class ControlCenterSettings extends SettingsPreferenceFragment implements Preference.OnPreferenceChangeListener { Preference mExpandNotification; SwitchPreference mNotice; SwitchPreference mNoticex; SeekBarPreferenceEx mNewCCGrid; SeekBarPreferenceEx mNewCCGridColumns; SwitchPreference mNewCCGridLabel; DropDownPreference mFiveG; DropDownPreference mBluetoothSytle; SwitchPreference mRoundedRect; SeekBarPreferenceEx mRoundedRectRadius; SwitchPreference mThemeBlur; SwitchPreference mMusicCtrlPanelMix; SwitchPreference mTaplus; SwitchPreference mNotifrowmenu; RecommendPreference mRecommend; Handler handler; @Override public int getContentResId() { return R.xml.system_ui_control_center; } @Override public View.OnClickListener addRestartListener() { return view -> ((BaseSettingsActivity) getActivity()).showRestartDialog( getResources().getString(R.string.system_ui), "com.android.systemui" ); } @Override public void initPrefs() { mExpandNotification = findPreference("prefs_key_system_ui_control_center_expand_notification"); mNewCCGrid = findPreference("prefs_key_system_control_center_cc_rows"); mNewCCGridColumns = findPreference("prefs_key_system_control_center_cc_columns"); mNewCCGridLabel = findPreference("prefs_key_system_control_center_qs_tile_label"); mNotice = findPreference("prefs_key_n_enable"); mNoticex = findPreference("prefs_key_n_enable_fix"); mBluetoothSytle = findPreference("prefs_key_system_ui_control_center_cc_bluetooth_tile_style"); mFiveG = findPreference("prefs_key_system_control_center_5g_new_tile"); mRoundedRect = findPreference("prefs_key_system_ui_control_center_rounded_rect"); mRoundedRectRadius = findPreference("prefs_key_system_ui_control_center_rounded_rect_radius"); mTaplus = findPreference("prefs_key_security_center_taplus"); mThemeBlur = findPreference("prefs_key_system_ui_control_center_unlock_blur_supported"); mMusicCtrlPanelMix = findPreference("prefs_key_system_ui_control_center_media_control_panel_background_mix"); mNotifrowmenu = findPreference("prefs_key_system_ui_control_center_notifrowmenu"); handler = new Handler(); mExpandNotification.setOnPreferenceClickListener( preference -> { Intent intent = new Intent(getActivity(), SubPickerActivity.class); intent.putExtra("mode", AppPicker.LAUNCHER_MODE); intent.putExtra("key", preference.getKey()); startActivity(intent); return true; } ); mTaplus.setOnPreferenceChangeListener( (preference, o) -> { killTaplus(); return true; } ); mNewCCGrid.setVisible(!isHyperOSVersion(1f)); mNewCCGridColumns.setVisible(!isHyperOSVersion(1f)); mNewCCGridLabel.setVisible(!isHyperOSVersion(1f)); mNotice.setVisible(!isMoreHyperOSVersion(1f)); mNoticex.setVisible(isMoreAndroidVersion(33)); mBluetoothSytle.setVisible(!isHyperOSVersion(1f)); mFiveG.setVisible(TelephonyManager.getDefault().isFiveGCapable()); mThemeBlur.setVisible(isMoreHyperOSVersion(1f)); mRoundedRectRadius.setVisible(PrefsUtils.getSharedBoolPrefs(getContext(), "prefs_key_system_ui_control_center_rounded_rect", false) && isMoreHyperOSVersion(1f)); mMusicCtrlPanelMix.setVisible(isMoreHyperOSVersion(1f)); mNotifrowmenu.setVisible(!isMoreHyperOSVersion(1f)); mRoundedRect.setOnPreferenceChangeListener(this); ((SeekBarPreferenceEx) findPreference("prefs_key_system_control_center_old_qs_grid_columns")).setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { if (!fromUser) return; if (progress < 3) progress = 5; try { Settings.Secure.putInt(requireActivity().getContentResolver(), "sysui_qqs_count", progress); } catch (Throwable t) { AndroidLogUtils.logD("SeekBarPreferenceEx", "onProgressChanged -> system_control_center_old_qs_grid_columns", t); } } @Override public void onStartTrackingTouch(SeekBar seekBar) { } @Override public void onStopTrackingTouch(SeekBar seekBar) { } }); Bundle args1 = new Bundle(); mRecommend = new RecommendPreference(getContext()); getPreferenceScreen().addPreference(mRecommend); if(isMoreHyperOSVersion(1f)) args1.putString(":settings:fragment_args_key", "prefs_key_new_clock_status"); else args1.putString(":settings:fragment_args_key", "prefs_key_old_clock_status"); mRecommend.addRecommendView(getString(R.string.system_ui_statusbar_clock_title), null, StatusBarSettings.class, args1, R.string.system_ui_statusbar_title ); } public void killTaplus() { ThreadPoolManager.getInstance().submit(() -> handler.post(() -> KillApp.killApps("com.miui.contentextension"))); } @Override public boolean onPreferenceChange(Preference preference, Object o) { if (preference == mRoundedRect) { setCanBeVisible((Boolean) o); } return true; } private void setCanBeVisible(boolean mode) { mRoundedRectRadius.setVisible(mode && isMoreHyperOSVersion(1f)); } }
[ "com.sevtinge.hyperceiler.utils.devicesdk.TelephonyManager.getDefault().isFiveGCapable", "com.sevtinge.hyperceiler.utils.ThreadPoolManager.getInstance().submit" ]
[((5322, 5368), 'com.sevtinge.hyperceiler.utils.devicesdk.TelephonyManager.getDefault().isFiveGCapable'), ((6197, 6288), 'android.provider.Settings.Secure.putInt'), ((7347, 7470), 'com.sevtinge.hyperceiler.utils.ThreadPoolManager.getInstance().submit')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.aiasst; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; import java.lang.reflect.Method; public class DisableWatermark extends BaseHook { @Override public void init() throws NoSuchMethodException { MethodData methodData = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .usingStrings("userId", "add watermark") ) ).singleOrThrow(() -> new IllegalStateException("DisableChatWatermark: Cannot found MethodData")); Method method = methodData.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "addWatermarkIfNeed() method is " + method); hookMethod(method, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { param.setResult(null); } }); } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(\"userId\", \"add watermark\")\n )\n ).singleOrThrow", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod" ]
[((1237, 1522), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings("userId", "add watermark")\n )\n ).singleOrThrow'), ((1237, 1426), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1237, 1270), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1282, 1416), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1323, 1402), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.systemui; import static de.robv.android.xposed.XposedHelpers.findClassIfExists; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.module.base.BaseXposedInit; import com.sevtinge.hyperceiler.module.base.tool.HookTool; import de.robv.android.xposed.XposedHelpers; public class NotificationVolumeSeparateSlider { public static void initHideDeviceControlEntry(ClassLoader pluginLoader) { int notifVolumeOnResId; int notifVolumeOffResId; Class<?> mMiuiVolumeDialogImpl = findClassIfExists("com.android.systemui.miui.volume.MiuiVolumeDialogImpl", pluginLoader); notifVolumeOnResId = R.drawable.ic_miui_volume_notification; notifVolumeOffResId = R.drawable.ic_miui_volume_notification_mute; BaseXposedInit.mResHook.setResReplacement("miui.systemui.plugin", "dimen", "miui_volume_content_width_expanded", R.dimen.miui_volume_content_width_expanded); BaseXposedInit.mResHook.setResReplacement("miui.systemui.plugin", "dimen", "miui_volume_ringer_layout_width_expanded", R.dimen.miui_volume_ringer_layout_width_expanded); BaseXposedInit.mResHook.setResReplacement("miui.systemui.plugin", "dimen", "miui_volume_column_width_expanded", R.dimen.miui_volume_column_width_expanded); BaseXposedInit.mResHook.setResReplacement("miui.systemui.plugin", "dimen", "miui_volume_column_margin_horizontal_expanded", R.dimen.miui_volume_column_margin_horizontal_expanded); HookTool.hookAllMethods(mMiuiVolumeDialogImpl, "addColumn", new HookTool.MethodHook() { @Override protected void before(MethodHookParam param) { if (param.args.length != 4) return; int streamType = (int) param.args[0]; if (streamType == 4) { XposedHelpers.callMethod(param.thisObject, "addColumn", 5, notifVolumeOnResId, notifVolumeOffResId, true, false); } } }); } }
[ "com.sevtinge.hyperceiler.module.base.BaseXposedInit.mResHook.setResReplacement" ]
[((1539, 1695), 'com.sevtinge.hyperceiler.module.base.BaseXposedInit.mResHook.setResReplacement'), ((1705, 1873), 'com.sevtinge.hyperceiler.module.base.BaseXposedInit.mResHook.setResReplacement'), ((1883, 2037), 'com.sevtinge.hyperceiler.module.base.BaseXposedInit.mResHook.setResReplacement'), ((2047, 2225), 'com.sevtinge.hyperceiler.module.base.BaseXposedInit.mResHook.setResReplacement')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.ui.fragment.home; import static com.sevtinge.hyperceiler.utils.api.VoyagerApisKt.isPad; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion; import android.view.View; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.ui.base.BaseSettingsActivity; import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils; import moralnorm.preference.DropDownPreference; import moralnorm.preference.Preference; import moralnorm.preference.SeekBarPreferenceEx; import moralnorm.preference.SwitchPreference; public class HomeFolderSettings extends SettingsPreferenceFragment { DropDownPreference mFolderShade; SeekBarPreferenceEx mFolderShadeLevel; SeekBarPreferenceEx mFolderColumns; SwitchPreference mFolderWidth; SwitchPreference mFolderSpace; SwitchPreference mUnlockFolderBlurSupport; Preference mSmallFolderIconBackgroundCustom1; Preference mSmallFolderIconBackgroundCustom2; Preference mSmallFolderIconBackgroundCustom3; @Override public int getContentResId() { return R.xml.home_folder; } @Override public View.OnClickListener addRestartListener() { return view -> ((BaseSettingsActivity)getActivity()).showRestartDialog( getResources().getString(R.string.mihome), "com.miui.home" ); } @Override public void initPrefs() { mFolderShade = findPreference("prefs_key_home_folder_shade"); mFolderShadeLevel = findPreference("prefs_key_home_folder_shade_level"); mUnlockFolderBlurSupport = findPreference("prefs_key_home_folder_unlock_blur_supported"); mUnlockFolderBlurSupport.setVisible(isMoreHyperOSVersion(1f)); mFolderColumns = findPreference("prefs_key_home_folder_columns"); mFolderWidth = findPreference("prefs_key_home_folder_width"); mFolderSpace = findPreference("prefs_key_home_folder_space"); setBigFolderTextForPad(); setFolderShadeLevelEnable(Integer.parseInt(PrefsUtils.mSharedPreferences.getString("prefs_key_home_folder_shade", "0"))); setFolderWidthEnable(PrefsUtils.mSharedPreferences.getInt(mFolderColumns.getKey(), 3)); setFolderSpaceEnable(PrefsUtils.mSharedPreferences.getInt(mFolderColumns.getKey(), 3)); mFolderShade.setOnPreferenceChangeListener((preference, o) -> { setFolderShadeLevelEnable(Integer.parseInt((String) o)); return true; }); mFolderColumns.setOnPreferenceChangeListener(((preference, o) -> { setFolderWidthEnable((Integer) o); setFolderSpaceEnable((Integer) o); return true; })); } private void setBigFolderTextForPad(){ if (isPad()){ mSmallFolderIconBackgroundCustom1.setTitle(R.string.home_big_folder_icon_bg_2x1_n); mSmallFolderIconBackgroundCustom2.setTitle(R.string.home_big_folder_icon_bg_1x2_n); mSmallFolderIconBackgroundCustom3.setTitle(R.string.home_big_folder_icon_bg_n); } } private void setFolderShadeLevelEnable(int i) { boolean isEnable = i != 0; mFolderShadeLevel.setVisible(isEnable); mFolderShadeLevel.setEnabled(isEnable); } private void setFolderWidthEnable(int columns) { boolean isEnable = columns > 1; mFolderWidth.setVisible(isEnable); mFolderWidth.setEnabled(isEnable); } private void setFolderSpaceEnable(int columns) { boolean isEnable = columns > 3; mFolderSpace.setVisible(isEnable); mFolderSpace.setEnabled(isEnable); } }
[ "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getString", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getInt" ]
[((2853, 2928), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getString'), ((2961, 3025), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getInt'), ((3057, 3121), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getInt')]