Skip to content

Commit

Permalink
feat: AI Translate - Unlock multi-language online captions(by PedroZ)
Browse files Browse the repository at this point in the history
  • Loading branch information
lingqiqi5211 committed May 19, 2024
1 parent 9037559 commit 1371c3a
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.sevtinge.hyperceiler.module.base.HookExpand;
import com.sevtinge.hyperceiler.module.hook.aiasst.AiCaptions;
import com.sevtinge.hyperceiler.module.hook.aiasst.DisableWatermark;
import com.sevtinge.hyperceiler.module.hook.aiasst.UnlockAllCaptions;

@HookExpand(pkg = "com.xiaomi.aiasst.vision", isPad = false, tarAndroid = 33)
public class AiAsst extends BaseModule {
Expand All @@ -30,5 +31,6 @@ public class AiAsst extends BaseModule {
public void handleLoadPackage() {
initHook(new AiCaptions(), mPrefsMap.getBoolean("aiasst_ai_captions"));
initHook(new DisableWatermark(), mPrefsMap.getBoolean("aiasst_disable_watermark"));
initHook(UnlockAllCaptions.INSTANCE, mPrefsMap.getBoolean("aiasst_all_captions"));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.sevtinge.hyperceiler.module.hook.aiasst

import com.github.kyuubiran.ezxhelper.ClassUtils.loadClass
import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook
import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder
import com.sevtinge.hyperceiler.module.base.*

object UnlockAllCaptions : BaseHook() {
override fun init() {
// by PedroZ
loadClass("com.xiaomi.aiasst.vision.common.BuildConfigUtils").methodFinder()
.filterByName("isSupplierOnline")
.single().createHook {
returnConstant(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 @@ -1516,6 +1516,7 @@
<!--小爱翻译-->
<string name="aiasst">小爱翻译</string>
<string name="aiasst_ai_captions">强制启用实时字幕</string>
<string name="aiasst_all_captions">解锁多语言在线字幕</string>
<string name="aiasst_disable_watermark">禁用水印</string>
<!--弹幕通知-->
<string name="barrage">弹幕通知</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 @@ -1488,6 +1488,7 @@
<!--AI Translate-->
<string name="aiasst">AI Translate</string>
<string name="aiasst_ai_captions">Force enabled AI captions</string>
<string name="aiasst_all_captions">Unlock multi-language online captions</string>
<string name="aiasst_disable_watermark">Disable watermark</string>
<!--Barrage-->
<string name="barrage">Barrage</string>
Expand Down
15 changes: 10 additions & 5 deletions app/src/main/res/xml/aiasst.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,21 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
app:myLocation="@string/aiasst">
<PreferenceCategory>

<SwitchPreference
android:title="@string/aiasst_ai_captions"
android:defaultValue="false"
android:key="prefs_key_aiasst_ai_captions"
android:defaultValue="false" />
android:title="@string/aiasst_ai_captions" />

<SwitchPreference
android:defaultValue="false"
android:key="prefs_key_aiasst_all_captions"
android:summary="@string/only_new_version_can_do"
android:title="@string/aiasst_all_captions" />

<SwitchPreference
android:title="@string/aiasst_disable_watermark"
android:defaultValue="false"
android:key="prefs_key_aiasst_disable_watermark"
android:defaultValue="false" />
android:title="@string/aiasst_disable_watermark" />

</PreferenceCategory>

Expand Down

0 comments on commit 1371c3a

Please sign in to comment.