Skip to content

Commit

Permalink
新增 互联互通服务-解锁HyperMind(待优化)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sevtinge committed Nov 21, 2023
1 parent 1922570 commit 454c274
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
package com.sevtinge.hyperceiler.module.app;

import com.sevtinge.hyperceiler.module.base.BaseModule;
import com.sevtinge.hyperceiler.module.base.CloseHostDir;
import com.sevtinge.hyperceiler.module.base.LoadHostDir;
import com.sevtinge.hyperceiler.module.hook.milink.UnlockHMind;
import com.sevtinge.hyperceiler.module.hook.milink.UnlockMiShare;

public class MiLink extends BaseModule {

@Override
public void handleLoadPackage() {
initHook(LoadHostDir.INSTANCE);
initHook(new UnlockMiShare(), mPrefsMap.getBoolean("milink_unlock_mishare"));
initHook(new UnlockHMind(), mPrefsMap.getBoolean("milink_unlock_hmind"));
initHook(CloseHostDir.INSTANCE);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
public class CustomWatermark extends BaseHook {
@Override
public void init() throws NoSuchMethodException {
logD("0");
MethodDataList methodDataList = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()
.matcher(MethodMatcher.create()
.returnType(SparseArray.class)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.sevtinge.hyperceiler.module.hook.milink;

import com.sevtinge.hyperceiler.module.base.BaseHook;
import com.sevtinge.hyperceiler.utils.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 {
findAndHookMethod("com.milink.hmindlib.j", "C", new MethodHook() {
@Override
protected void after(MethodHookParam param) throws Throwable {
param.setResult(true);
}
});
}
}
1 change: 1 addition & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,7 @@
<string name="milink">投屏</string>
<string name="milink_hyperos">互联互通服务</string>
<string name="milink_unlock_mishare">解锁小米妙享</string>
<string name="milink_unlock_hmind">解锁 HyperMind</string>
<!--万象息屏-->
<string name="aod">万象息屏</string>
<string name="aod_hyperos">息屏与锁屏编辑</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1355,6 +1355,7 @@
<string name="camera_custom_watermark">Custom device watermark</string>
<string name="camera_custom_watermark_manufacturer">Manufacturer Information</string>
<string name="camera_custom_watermark_device">Device Information</string>
<string name="milink_unlock_hmind">Unlock HyperMind</string>
<!--Tip-->
<string name="tip_0">Tip: Here\'s a tip!</string>
<string name="tip_1">Tip: You can support us by donating in \"About - Support\".</string>
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/xml/milink.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
android:key="prefs_key_milink_unlock_mishare"
android:defaultValue="false" />

<SwitchPreference
android:title="@string/milink_unlock_hmind"
android:key="prefs_key_milink_unlock_hmind"
android:defaultValue="false" />

<Preference android:enabled="false" />

</PreferenceScreen>

0 comments on commit 454c274

Please sign in to comment.