Skip to content

Commit 3d35159

Browse files
committed
feat: html viewer - disable cloud ctrl
1 parent 9dbb1aa commit 3d35159

12 files changed

Lines changed: 162 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* This file is part of HyperCeiler.
3+
4+
* HyperCeiler is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU Affero General Public License as
6+
* published by the Free Software Foundation, either version 3 of the
7+
* License.
8+
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU Affero General Public License for more details.
13+
14+
* You should have received a copy of the GNU Affero General Public License
15+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
17+
* Copyright (C) 2023-2024 HyperCeiler Contributions
18+
*/
19+
package com.sevtinge.hyperceiler.module.app;
20+
21+
import com.sevtinge.hyperceiler.module.base.BaseModule;
22+
import com.sevtinge.hyperceiler.module.base.HookExpand;
23+
import com.sevtinge.hyperceiler.module.hook.htmlviewer.DisableUpdateCloudAllData;
24+
25+
@HookExpand(pkg = "com.android.htmlviewer", isPad = false, tarAndroid = 33)
26+
public class HtmlViewer extends BaseModule {
27+
@Override
28+
public void handleLoadPackage() {
29+
initHook(new DisableUpdateCloudAllData(), mPrefsMap.getBoolean("html_viewer_disable_cloud_control"));
30+
}
31+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* This file is part of HyperCeiler.
3+
4+
* HyperCeiler is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU Affero General Public License as
6+
* published by the Free Software Foundation, either version 3 of the
7+
* License.
8+
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU Affero General Public License for more details.
13+
14+
* You should have received a copy of the GNU Affero General Public License
15+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
17+
* Copyright (C) 2023-2024 HyperCeiler Contributions
18+
*/
19+
package com.sevtinge.hyperceiler.module.hook.htmlviewer;
20+
21+
import com.sevtinge.hyperceiler.module.base.BaseHook;
22+
23+
public class DisableUpdateCloudAllData extends BaseHook {
24+
@Override
25+
public void init() throws NoSuchMethodException {
26+
findAndHookMethod("com.android.settings.cloud.JobTask", "updateCloudAllData", new MethodHook(){
27+
@Override
28+
protected void before(MethodHookParam param) throws Throwable {
29+
param.setResult(null);
30+
}
31+
});
32+
}
33+
}

app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/StickyFloatingWindowsForSystemUI.kt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* This file is part of HyperCeiler.
3+
4+
* HyperCeiler is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU Affero General Public License as
6+
* published by the Free Software Foundation, either version 3 of the
7+
* License.
8+
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU Affero General Public License for more details.
13+
14+
* You should have received a copy of the GNU Affero General Public License
15+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
17+
* Copyright (C) 2023-2024 HyperCeiler Contributions
18+
*/
119
package com.sevtinge.hyperceiler.module.hook.systemui
220

321
import android.annotation.*
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* This file is part of HyperCeiler.
3+
4+
* HyperCeiler is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU Affero General Public License as
6+
* published by the Free Software Foundation, either version 3 of the
7+
* License.
8+
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU Affero General Public License for more details.
13+
14+
* You should have received a copy of the GNU Affero General Public License
15+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
17+
* Copyright (C) 2023-2024 HyperCeiler Contributions
18+
*/
19+
package com.sevtinge.hyperceiler.ui.fragment;
20+
21+
import android.view.View;
22+
23+
import com.sevtinge.hyperceiler.R;
24+
import com.sevtinge.hyperceiler.ui.base.BaseSettingsActivity;
25+
import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment;
26+
27+
public class HtmlViewerFragment extends SettingsPreferenceFragment {
28+
@Override
29+
public int getContentResId() {
30+
return R.xml.html_viewer;
31+
}
32+
33+
@Override
34+
public View.OnClickListener addRestartListener() {
35+
return view -> ((BaseSettingsActivity) getActivity()).showRestartDialog(
36+
getResources().getString(R.string.html_viewer),
37+
"com.android.htmlviewer"
38+
);
39+
}
40+
}

app/src/main/java/com/sevtinge/hyperceiler/utils/search/SearchHelper.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,9 @@ public static void getAllMods(Context context, boolean force) {
337337
parsePrefXml(context, R.xml.tsmclient,
338338
"com.sevtinge.hyperceiler.ui.fragment.TsmClientFragment");
339339

340+
parsePrefXml(context, R.xml.html_viewer,
341+
"com.sevtinge.hyperceiler.ui.fragment.HtmlViewerFragment");
342+
340343
parsePrefXml(context, R.xml.weather,
341344
"com.sevtinge.hyperceiler.ui.fragment.WeatherFragment");
342345

2.57 KB
Loading

app/src/main/res/values-zh-rCN/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,6 +1386,9 @@
13861386
<string name="nfc">NFC 服务</string>
13871387
<string name="nfc_disable_sound">禁用 NFC 提示音</string>
13881388
<string name="nfc_allow_information_screen">允许息屏时识别</string>
1389+
<!--HTML Viewer-->
1390+
<string name="html_viewer">HTML 查看器</string>
1391+
<string name="html_viewer_disable_cloud_control">禁用云控</string>
13891392
<!--智能助理-->
13901393
<string name="personal_assistant">智能助理</string>
13911394
<string name="personal_assistant_fold_widget_enable">Pad/Fold 小部件</string>

app/src/main/res/values/arrays.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<item>com.android.camera</item> <!--相机-->
99
<item>com.android.externalstorage</item> <!--外部储存设备-->
1010
<item>com.android.fileexplorer</item> <!--文件管理-->
11+
<item>com.android.htmlviewer</item> <!--HTML 查看器-->
1112
<item>com.android.incallui</item> <!--电话-->
1213
<item>com.android.mms</item> <!--短信-->
1314
<item>com.android.nfc</item> <!--NFC-->

app/src/main/res/values/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,6 +1356,9 @@
13561356
<string name="nfc">NFC Service</string>
13571357
<string name="nfc_disable_sound">Disable NFC notification sound</string>
13581358
<string name="nfc_allow_information_screen">Allow recognition when screen is off</string>
1359+
<!--HTML Viewer-->
1360+
<string name="html_viewer">HTML Viewer</string>
1361+
<string name="html_viewer_disable_cloud_control">Disable Cloud control</string>
13591362
<!--App vault-->
13601363
<string name="personal_assistant">App vault</string>
13611364
<string name="personal_assistant_fold_widget_enable">Pad/Fold weight</string>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
app:myLocation="@string/html_viewer">
5+
6+
<PreferenceCategory>
7+
8+
<SwitchPreference
9+
android:title="@string/html_viewer_disable_cloud_control"
10+
android:key="prefs_key_html_viewer_disable_cloud_control"
11+
android:defaultValue="false" />
12+
13+
</PreferenceCategory>
14+
15+
</PreferenceScreen>

0 commit comments

Comments
 (0)