-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
432 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package com.alphi.qhmk.module; | ||
|
||
import androidx.annotation.NonNull; | ||
import cc.ioctl.util.HookUtils; | ||
import io.github.qauxv.base.annotation.FunctionHookEntry; | ||
import io.github.qauxv.base.annotation.UiItemAgentEntry; | ||
import io.github.qauxv.dsl.FunctionEntryRouter; | ||
import io.github.qauxv.hook.CommonSwitchFunctionHook; | ||
import io.github.qauxv.util.Initiator; | ||
import io.github.qauxv.util.Log; | ||
import io.github.qauxv.util.SyncUtils; | ||
import java.lang.reflect.Field; | ||
import java.lang.reflect.Method; | ||
import kotlin.collections.ArraysKt; | ||
|
||
@UiItemAgentEntry | ||
@FunctionHookEntry | ||
public class DisableX5 extends CommonSwitchFunctionHook { | ||
|
||
public static final DisableX5 INSTANCE = new DisableX5(); | ||
|
||
private DisableX5() { | ||
super(SyncUtils.PROC_MAIN | SyncUtils.PROC_TOOL); | ||
} | ||
|
||
@Override | ||
protected boolean initOnce() throws Exception { | ||
// | ||
Class<?> tbsClass = Initiator.loadClass("com.tencent.smtt.sdk.WebView"); | ||
Class<?> TbsClassConfig = null; | ||
for (Field field : tbsClass.getDeclaredFields()) { | ||
Class<?> type = field.getType(); | ||
if (type.getName().contains("com.tencent.smtt.utils.")) { | ||
TbsClassConfig = type; | ||
} | ||
} | ||
if (TbsClassConfig == null) { | ||
throw new IllegalStateException("X5Settings init fail!!!"); | ||
} | ||
Method method = ArraysKt.single(TbsClassConfig.getDeclaredMethods(), m -> m.getReturnType() == void.class); | ||
HookUtils.hookAfterIfEnabled(this, method, param -> { | ||
boolean result = false; | ||
Log.d("hook:" + param.thisObject.getClass()); | ||
for (Field field : param.thisObject.getClass().getFields()) { | ||
if (field.getType() == boolean.class) { | ||
try { | ||
field.set(param.thisObject, true); | ||
result = true; | ||
} catch (IllegalAccessException e) { | ||
traceError(e); | ||
} | ||
} | ||
} | ||
if (result) { | ||
Log.d("ForceUseSystemWebView success!"); | ||
} else { | ||
Log.e("ForceUseSystemWebView fail!!!"); | ||
} | ||
}); | ||
return true; | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public String getName() { | ||
return "禁用浏览器X5内核"; | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public String[] getUiItemLocation() { | ||
return FunctionEntryRouter.Locations.Auxiliary.MISC_CATEGORY; | ||
} | ||
|
||
} |
66 changes: 66 additions & 0 deletions
66
app/src/main/java/com/alphi/qhmk/module/HiddenApolloView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package com.alphi.qhmk.module; | ||
|
||
import android.view.View; | ||
import androidx.annotation.NonNull; | ||
import androidx.annotation.Nullable; | ||
import cc.ioctl.util.HookUtils; | ||
import cc.ioctl.util.HostInfo; | ||
import io.github.qauxv.base.annotation.FunctionHookEntry; | ||
import io.github.qauxv.base.annotation.UiItemAgentEntry; | ||
import io.github.qauxv.dsl.FunctionEntryRouter; | ||
import io.github.qauxv.hook.CommonSwitchFunctionHook; | ||
import io.github.qauxv.util.Initiator; | ||
import io.github.qauxv.util.QQVersion; | ||
import java.lang.reflect.Field; | ||
import java.lang.reflect.Method; | ||
import kotlin.collections.ArraysKt; | ||
|
||
/** | ||
* IDEA 2022/02/21 隐藏侧滑厘米秀 | ||
*/ | ||
@UiItemAgentEntry | ||
@FunctionHookEntry | ||
public class HiddenApolloView extends CommonSwitchFunctionHook { | ||
|
||
private HiddenApolloView() { | ||
} | ||
|
||
public static final HiddenApolloView INSTANCE = new HiddenApolloView(); | ||
|
||
@Override | ||
protected boolean initOnce() throws Exception { | ||
Class<?> aClass = Initiator.loadClass("com/tencent/mobileqq/apollo/SettingMeApolloViewController"); | ||
Field field = ArraysKt.single(aClass.getDeclaredFields(), f -> f.getType().getSimpleName().contains("View")); | ||
field.setAccessible(true); | ||
Method method = ArraysKt.single(aClass.getDeclaredMethods(), m -> m.getReturnType() == void.class); | ||
HookUtils.hookAfterIfEnabled(this, method, param -> { | ||
View view = (View) field.get(param.thisObject); | ||
view.setVisibility(View.GONE); | ||
}); | ||
return true; | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public String getName() { | ||
return "隐藏侧滑厘米秀"; | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public CharSequence getDescription() { | ||
return "最高支持 8.4.10"; | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public String[] getUiItemLocation() { | ||
return FunctionEntryRouter.Locations.Simplify.SLIDING_UI; | ||
} | ||
|
||
@Override | ||
public boolean isAvailable() { | ||
return HostInfo.isQQ() && HostInfo.getVersionCode() <= QQVersion.QQ_8_4_10; | ||
} | ||
|
||
} |
46 changes: 46 additions & 0 deletions
46
app/src/main/java/com/alphi/qhmk/module/HiddenVipIconForSe.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.alphi.qhmk.module; | ||
|
||
import android.view.View; | ||
import androidx.annotation.NonNull; | ||
import cc.ioctl.util.HookUtils; | ||
import io.github.qauxv.base.annotation.FunctionHookEntry; | ||
import io.github.qauxv.base.annotation.UiItemAgentEntry; | ||
import io.github.qauxv.dsl.FunctionEntryRouter; | ||
import io.github.qauxv.hook.CommonSwitchFunctionHook; | ||
import io.github.qauxv.util.Initiator; | ||
import java.lang.reflect.Method; | ||
|
||
@UiItemAgentEntry | ||
@FunctionHookEntry | ||
public class HiddenVipIconForSe extends CommonSwitchFunctionHook { | ||
|
||
private HiddenVipIconForSe() { | ||
} | ||
|
||
public static final HiddenVipIconForSe INSTANCE = new HiddenVipIconForSe(); | ||
|
||
@Override | ||
protected boolean initOnce() throws Exception { | ||
Class<?> qsmClass = Initiator.loadClass("Lcom/tencent/mobileqq/widget/QVipMedalView;"); | ||
Method onLayout = qsmClass.getDeclaredMethod("onLayout", boolean.class, int.class, int.class, int.class, int.class); | ||
HookUtils.hookBeforeIfEnabled(this, onLayout, param -> { | ||
View obj = (View) param.thisObject; | ||
obj.setClickable(false); | ||
param.setResult(null); | ||
}); | ||
return true; | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public String getName() { | ||
return "隐藏侧滑面板的VIP图标"; | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public String[] getUiItemLocation() { | ||
return FunctionEntryRouter.Locations.Simplify.SLIDING_UI; | ||
} | ||
|
||
} |
Oops, something went wrong.