Skip to content

Commit

Permalink
新增 浏览器-禁用网址黑名单(实验性功能,异常请及时反馈)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sevtinge committed Nov 18, 2023
1 parent b77393c commit 97536eb
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.sevtinge.hyperceiler.module.base.CloseHostDir;
import com.sevtinge.hyperceiler.module.base.LoadHostDir;
import com.sevtinge.hyperceiler.module.hook.browser.DebugMode;
import com.sevtinge.hyperceiler.module.hook.browser.DisableReadFiles;
import com.sevtinge.hyperceiler.module.hook.various.UnlockSuperClipboard;

public class Browser extends BaseModule {
Expand All @@ -13,6 +14,7 @@ public void handleLoadPackage() {
initHook(DebugMode.INSTANCE, mPrefsMap.getBoolean("browser_debug_mode"));
// dexKit load
initHook(LoadHostDir.INSTANCE);
initHook(new DisableReadFiles(), mPrefsMap.getBoolean("browser_disable_blacklist"));
initHook(UnlockSuperClipboard.INSTANCE, mPrefsMap.getStringAsInt("various_super_clipboard_e", 0) != 0);
// dexKit finish
initHook(CloseHostDir.INSTANCE);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.sevtinge.hyperceiler.module.hook.browser;

import android.net.Uri;

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

public class DisableReadFiles extends BaseHook {
@Override
public void init() {
findAndHookMethod("com.android.browser.provider.AdBlockRuleProvider", "openFile", Uri.class, String.class, new MethodHook(){
@Override
protected void before(MethodHookParam param) throws Throwable {
param.setResult(null);
}
});
}
}
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 @@ -361,6 +361,7 @@
<string name="browser">浏览器</string>
<string name="browser_debug_mode">解锁开发者选项</string>
<string name="browser_debug_mode_desc">17.5.xxxxx 及以上版本没有入口</string>
<string name="browser_disable_blacklist">禁用网址黑名单</string>
<!--相机-->
<string name="camera">相机</string>
<string name="camera_features_unlock_aiwatermark">解锁 AI 水印</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 @@ -1344,6 +1344,7 @@
<string name="close_source">Close Source Projects</string>
<string name="exit">Exit</string>
<string name="ignore">Ignore</string>
<string name="browser_disable_blacklist">Disable URL Blacklist</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/browser.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
android:key="prefs_key_browser_debug_mode"
android:defaultValue="false" />

<SwitchPreference
android:title="@string/browser_disable_blacklist"
android:key="prefs_key_browser_disable_blacklist"
android:defaultValue="false" />

</PreferenceCategory>
<Preference android:enabled="false" />

Expand Down

0 comments on commit 97536eb

Please sign in to comment.