Skip to content

Commit 964a45c

Browse files
committed
移除一些多余的内容
1 parent f68b035 commit 964a45c

10 files changed

Lines changed: 23 additions & 83 deletions

File tree

app/src/main/java/com/sevtinge/hyperceiler/home/safemode/CrashActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import com.sevtinge.hyperceiler.core.R;
3535
import com.sevtinge.hyperceiler.libhook.safecrash.CrashScope;
3636
import com.sevtinge.hyperceiler.utils.DialogHelper;
37+
import com.sevtinge.hyperceiler.utils.LanguageHelper;
3738

3839
import fan.appcompat.app.AppCompatActivity;
3940

@@ -48,7 +49,7 @@ public class CrashActivity extends AppCompatActivity {
4849

4950
@Override
5051
protected void attachBaseContext(Context newBase) {
51-
super.attachBaseContext(com.sevtinge.hyperceiler.utils.LanguageHelper.wrapContext(newBase));
52+
super.attachBaseContext(LanguageHelper.wrapContext(newBase));
5253
}
5354

5455
@SuppressLint({"SetTextI18n", "StringFormatInvalid"})

app/src/main/java/com/sevtinge/hyperceiler/home/safemode/ExceptionCrashActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import com.sevtinge.hyperceiler.BuildConfig;
3434
import com.sevtinge.hyperceiler.R;
3535
import com.sevtinge.hyperceiler.common.log.AndroidLog;
36+
import com.sevtinge.hyperceiler.utils.LanguageHelper;
3637

3738
import java.io.PrintWriter;
3839
import java.io.StringWriter;
@@ -47,7 +48,7 @@ public class ExceptionCrashActivity extends AppCompatActivity implements View.On
4748

4849
@Override
4950
protected void attachBaseContext(Context newBase) {
50-
super.attachBaseContext(com.sevtinge.hyperceiler.utils.LanguageHelper.wrapContext(newBase));
51+
super.attachBaseContext(LanguageHelper.wrapContext(newBase));
5152
}
5253

5354
@Override

library/core/src/main/java/com/sevtinge/hyperceiler/hooker/VariousFragment.java

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ public class VariousFragment extends DashboardFragment {
4848
private static final String PREF_IME_SHOW_ALL = "prefs_key_various_unlock_ime_show_all";
4949
private static final String PREF_AOSP_IME_NAV_BAR_LAYOUT_START = "prefs_key_various_aosp_ime_nav_bar_layout_start";
5050
private static final String PREF_AOSP_IME_NAV_BAR_LAYOUT_END = "prefs_key_various_aosp_ime_nav_bar_layout_end";
51-
private static final String PREF_LEGACY_MIUI_ENABLE = "prefs_key_various_unlock_ime";
52-
private static final String PREF_LEGACY_AOSP_ENABLE = "prefs_key_various_aosp_ime";
53-
private static final String PREF_LEGACY_AOSP_TARGET_APPS = "prefs_key_various_aosp_ime_apps";
54-
5551
private static final int IME_STYLE_OFF = 0;
5652
private static final int IME_STYLE_MIUI = 1;
5753
private static final int IME_STYLE_AOSP = 2;
@@ -71,7 +67,6 @@ public int getPreferenceScreenResId() {
7167

7268
@Override
7369
public void initPrefs() {
74-
migrateLegacyInputMethodPrefs();
7570
mClipboard = findPreference("prefs_key_sogou_xiaomi_clipboard");
7671
mClipboardClear = findPreference("prefs_key_add_clipboard_clear");
7772
mImeStyle = findPreference(PREF_IME_STYLE);
@@ -162,7 +157,7 @@ private void updateInputMethodSummary() {
162157
}
163158

164159
Set<String> packages = getInputMethodTargets();
165-
if (packages == null || packages.isEmpty()) {
160+
if (packages.isEmpty()) {
166161
mImeTargetApps.setSummary(R.string.various_unlock_ime_apps_desc);
167162
return;
168163
}
@@ -228,43 +223,6 @@ private void updateDropDownSummary(DropDownPreference preference, String value)
228223
}
229224
}
230225

231-
private void migrateLegacyInputMethodPrefs() {
232-
SharedPreferences preferences = getSharedPreferences();
233-
if (preferences == null || preferences.contains(PREF_IME_STYLE)) {
234-
return;
235-
}
236-
237-
boolean legacyMiuiEnabled = preferences.getBoolean(PREF_LEGACY_MIUI_ENABLE, false);
238-
boolean legacyAospEnabled = preferences.getBoolean(PREF_LEGACY_AOSP_ENABLE, false);
239-
LinkedHashSet<String> inputMethodTargets = new LinkedHashSet<>(
240-
preferences.getStringSet(PREF_IME_TARGET_APPS, Collections.emptySet()));
241-
LinkedHashSet<String> legacyAospTargets = new LinkedHashSet<>(
242-
preferences.getStringSet(PREF_LEGACY_AOSP_TARGET_APPS, Collections.emptySet()));
243-
244-
int migratedStyle = IME_STYLE_OFF;
245-
if (legacyMiuiEnabled) {
246-
migratedStyle = IME_STYLE_MIUI;
247-
} else if (legacyAospEnabled) {
248-
migratedStyle = IME_STYLE_AOSP;
249-
if (inputMethodTargets.isEmpty() && !legacyAospTargets.isEmpty()) {
250-
inputMethodTargets.addAll(legacyAospTargets);
251-
}
252-
}
253-
254-
SharedPreferences.Editor editor = preferences.edit();
255-
editor.putString(PREF_IME_STYLE, String.valueOf(migratedStyle));
256-
if (legacyMiuiEnabled) {
257-
editor.putBoolean(PREF_IME_SHOW_ALL, true);
258-
}
259-
if (!inputMethodTargets.isEmpty()) {
260-
editor.putStringSet(PREF_IME_TARGET_APPS, inputMethodTargets);
261-
}
262-
editor.remove(PREF_LEGACY_MIUI_ENABLE);
263-
editor.remove(PREF_LEGACY_AOSP_ENABLE);
264-
editor.remove(PREF_LEGACY_AOSP_TARGET_APPS);
265-
editor.apply();
266-
}
267-
268226
private int getImeStyle() {
269227
SharedPreferences preferences = getSharedPreferences();
270228
if (preferences == null) {

library/core/src/main/java/com/sevtinge/hyperceiler/sub/SubPickerActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
import com.sevtinge.hyperceiler.model.adapter.AppDataAdapter;
5252
import com.sevtinge.hyperceiler.model.data.AppData;
5353
import com.sevtinge.hyperceiler.model.data.AppDataManager;
54+
import com.sevtinge.hyperceiler.utils.LanguageHelper;
5455
import com.sevtinge.hyperceiler.utils.ScopeManager;
5556
import com.sevtinge.hyperceiler.utils.ThreadUtils;
5657

@@ -104,7 +105,7 @@ public class SubPickerActivity extends AppCompatActivity
104105

105106
@Override
106107
protected void attachBaseContext(Context newBase) {
107-
super.attachBaseContext(com.sevtinge.hyperceiler.utils.LanguageHelper.wrapContext(newBase));
108+
super.attachBaseContext(LanguageHelper.wrapContext(newBase));
108109
}
109110

110111
@Override

library/core/src/main/java/com/sevtinge/hyperceiler/utils/AppIconCache.java

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import androidx.collection.LruCache;
3535

3636
import java.util.Map;
37-
import java.util.Objects;
3837
import java.util.concurrent.ConcurrentHashMap;
3938

4039
import me.zhanghai.android.appiconloader.AppIconLoader;
@@ -198,25 +197,18 @@ public interface IconCallback {
198197
void onIconLoaded(@Nullable Drawable icon);
199198
}
200199

201-
private static final class CacheKey {
202-
private final String packageName;
203-
private final int sizePx;
204-
205-
private CacheKey(@NonNull String packageName, int sizePx) {
206-
this.packageName = packageName;
207-
this.sizePx = sizePx;
208-
}
200+
private record CacheKey(String packageName, int sizePx) {
201+
private CacheKey(@NonNull String packageName, int sizePx) {
202+
this.packageName = packageName;
203+
this.sizePx = sizePx;
204+
}
209205

210-
@Override
211-
public boolean equals(Object obj) {
212-
if (this == obj) return true;
213-
if (!(obj instanceof CacheKey other)) return false;
214-
return sizePx == other.sizePx && packageName.equals(other.packageName);
215-
}
206+
@Override
207+
public boolean equals(Object obj) {
208+
if (this == obj) return true;
209+
if (!(obj instanceof CacheKey other)) return false;
210+
return sizePx == other.sizePx && packageName.equals(other.packageName);
211+
}
216212

217-
@Override
218-
public int hashCode() {
219-
return Objects.hash(packageName, sizePx);
220-
}
221213
}
222214
}

library/core/src/main/res/values-zh-rCN/strings_app.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,7 +1607,7 @@
16071607
<string name="various_phrase_clipboardlist">解除常用语剪贴板条数和时间限制</string>
16081608
<string name="various_phrase_clipboardlist_more">开启后请在 Xposed 管理器中勾选对应输入法作用域</string>
16091609
<string name="various_unlock_ime">解锁输入法全面屏优化</string>
1610-
<string name="various_unlock_ime_desc">对所选输入法启用所选样式的全面屏优化\n原生风格需要额外勾选系统框架作用域\n选择原生风格后只对非小米定制版生效,小米定制版勾选将加入键盘可切换列表</string>
1610+
<string name="various_unlock_ime_desc">对目标输入法启用所选样式的全面屏优化\n原生风格需要额外勾选系统框架作用域\n选择原生风格后只对非小米定制版生效,小米定制版勾选将加入键盘可切换列表</string>
16111611
<string name="various_unlock_ime_apps">目标输入法</string>
16121612
<string name="various_unlock_ime_apps_desc">若所选输入法未加入作用域,将同时申请作用域</string>
16131613
<string name="various_unlock_ime_show_all">显示全部输入法列表</string>
@@ -1618,9 +1618,6 @@
16181618
<string name="various_aosp_ime_nav_bar_layout_end">右侧功能键</string>
16191619
<string name="various_aosp_ime_nav_bar_layout_hide_ime">收起输入法</string>
16201620
<string name="various_aosp_ime_nav_bar_layout_ime_switcher">切换输入法</string>
1621-
<string name="various_aosp_ime">Mi_AOSP_IME</string>
1622-
<string name="various_aosp_ime_desc">对所选输入法启用 AOSP 风格导航栏/底栏。需要勾选对应输入法作用域和 Android/System Framework 作用域</string>
1623-
<string name="various_aosp_ime_apps">Mi_AOSP_IME 目标输入法</string>
16241621
<string name="various_input_method_apps_count">已选择 %1$d 个输入法</string>
16251622
<string name="various_collapse_miui_title">系统标题样式</string>
16261623
<string name="various_collapse_miui_title_desc">调整系统应用中的顶栏标题</string>

library/core/src/main/res/values-zh-rHK/strings_app.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,7 +1530,7 @@
15301530
<string name="various_phrase_clipboardlist">解除常用語剪貼簿條數和時間限制</string>
15311531
<string name="various_phrase_clipboardlist_more">開啟後勾選輸入法作用域並重新啟動</string>
15321532
<string name="various_unlock_ime">解鎖輸入法全面屏優化</string>
1533-
<string name="various_unlock_ime_desc">對所選輸入法啟用所選樣式的全面屏優化\n原生風格需要額外勾選系統框架作用域\n選擇原生風格後只對非小米定製版生效,小米定製版勾選後將加入鍵盤可切換列表</string>
1533+
<string name="various_unlock_ime_desc">對目標輸入法啟用所選樣式的全面屏優化\n原生風格需要額外勾選系統框架作用域\n選擇原生風格後只對非小米定製版生效,小米定製版勾選後將加入鍵盤可切換列表</string>
15341534
<string name="various_unlock_ime_apps">目標輸入法</string>
15351535
<string name="various_unlock_ime_apps_desc">若所選輸入法未加入作用域,將同時申請作用域</string>
15361536
<string name="various_unlock_ime_show_all">顯示全部輸入法列表</string>
@@ -1541,9 +1541,6 @@
15411541
<string name="various_aosp_ime_nav_bar_layout_end">右側功能鍵</string>
15421542
<string name="various_aosp_ime_nav_bar_layout_hide_ime">收起輸入法</string>
15431543
<string name="various_aosp_ime_nav_bar_layout_ime_switcher">切換輸入法</string>
1544-
<string name="various_aosp_ime">Mi_AOSP_IME</string>
1545-
<string name="various_aosp_ime_desc">對所選輸入法啟用 AOSP 風格導覽列/底欄。需要勾選對應輸入法作用域與 Android/System Framework 作用域</string>
1546-
<string name="various_aosp_ime_apps">Mi_AOSP_IME 目標輸入法</string>
15471544
<string name="various_input_method_apps_count">已選擇 %1$d 個輸入法</string>
15481545
<string name="various_collapse_miui_title">系統標題樣式</string>
15491546
<string name="various_collapse_miui_title_desc">調整系統應用程式中的頂欄標題</string>

library/core/src/main/res/values-zh-rTW/strings_app.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,7 +1508,7 @@
15081508
<string name="various_phrase_clipboardlist">解除常用語剪貼簿數量和時間限制</string>
15091509
<string name="various_phrase_clipboardlist_more">開啟後勾選輸入法作用域並重啟</string>
15101510
<string name="various_unlock_ime">解鎖輸入法全螢幕最佳化</string>
1511-
<string name="various_unlock_ime_desc">對所選輸入法啟用所選樣式的全螢幕最佳化\n原生風格需要額外勾選系統框架作用域\n選擇原生風格後只對非小米定製版生效,小米定製版勾選後將加入鍵盤可切換列表</string>
1511+
<string name="various_unlock_ime_desc">對目標輸入法啟用所選樣式的全螢幕最佳化\n原生風格需要額外勾選系統框架作用域\n選擇原生風格後只對非小米定製版生效,小米定製版勾選後將加入鍵盤可切換列表</string>
15121512
<string name="various_unlock_ime_apps">目標輸入法</string>
15131513
<string name="various_unlock_ime_apps_desc">若所選輸入法未加入作用域,將同時申請作用域</string>
15141514
<string name="various_unlock_ime_show_all">顯示全部輸入法列表</string>
@@ -1519,9 +1519,6 @@
15191519
<string name="various_aosp_ime_nav_bar_layout_end">右側功能鍵</string>
15201520
<string name="various_aosp_ime_nav_bar_layout_hide_ime">收起輸入法</string>
15211521
<string name="various_aosp_ime_nav_bar_layout_ime_switcher">切換輸入法</string>
1522-
<string name="various_aosp_ime">Mi_AOSP_IME</string>
1523-
<string name="various_aosp_ime_desc">對所選輸入法啟用 AOSP 風格導覽列/底欄。需要勾選對應輸入法作用域與 Android/System Framework 作用域</string>
1524-
<string name="various_aosp_ime_apps">Mi_AOSP_IME 目標輸入法</string>
15251522
<string name="various_input_method_apps_count">已選擇 %1$d 個輸入法</string>
15261523
<string name="various_collapse_miui_title">系統標題樣式</string>
15271524
<string name="various_collapse_miui_title_desc">調整系統應用程式中的頂欄標題</string>

library/core/src/main/res/values/strings_app.xml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1649,7 +1649,7 @@
16491649
<string name="various_phrase_clipboardlist">Remove the clipboard and time limits for phrases</string>
16501650
<string name="various_phrase_clipboardlist_more">After it\'s enabled, select the input method scope and restart it.</string>
16511651
<string name="various_unlock_ime">Unlock IME fullscreen optimization</string>
1652-
<string name="various_unlock_ime_desc">Apply the selected fullscreen optimization style to the selected input methods.\nAOSP style also requires System Framework scope.\nWith AOSP style selected, only non-Xiaomi-customized IMEs take effect. Selected Xiaomi-customized IMEs will only be added to the keyboard switcher list.</string>
1652+
<string name="various_unlock_ime_desc">Enable full-screen optimization for the selected style on the target input method\nThe "Native" style requires an additional check of the "System Framework" scope\nSelecting the "Native" style only applies to non-Xiaomi custom versions; checking it for Xiaomi custom versions will add the keyboard to the switchable list</string>
16531653
<string name="various_unlock_ime_apps">Target input methods</string>
16541654
<string name="various_unlock_ime_apps_desc">If a selected input method is not in scope, its scope will be requested as well.</string>
16551655
<string name="various_unlock_ime_show_all">Show all input methods</string>
@@ -1660,9 +1660,6 @@
16601660
<string name="various_aosp_ime_nav_bar_layout_end">Right function key</string>
16611661
<string name="various_aosp_ime_nav_bar_layout_hide_ime">Hide input method</string>
16621662
<string name="various_aosp_ime_nav_bar_layout_ime_switcher">Switch input method</string>
1663-
<string name="various_aosp_ime">Mi AOSP IME</string>
1664-
<string name="various_aosp_ime_desc">Apply AOSP-style IME navigation to the selected input methods. Requires the IME scope and Android/System Framework scope.</string>
1665-
<string name="various_aosp_ime_apps">Mi AOSP IME targets</string>
16661663
<string name="various_input_method_apps_count">%1$d input methods selected</string>
16671664
<string name="various_collapse_miui_title">System title style</string>
16681665
<string name="various_collapse_miui_title_desc">Adjust top bar title in system apps</string>

library/libhook/src/main/java/com/sevtinge/hyperceiler/libhook/rules/gallery/ChangeBackupServer.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import com.sevtinge.hyperceiler.libhook.callback.IMethodHook;
2424

2525
import io.github.kyuubiran.ezxhelper.xposed.common.HookParam;
26-
import io.github.libxposed.api.XposedInterface;
2726

2827

2928
public class ChangeBackupServer extends BaseHook {
@@ -70,7 +69,7 @@ public void before(HookParam param) {
7069
if (isXiaomi) {
7170
findAndChainMethod("com.miui.gallery.ui.GallerySettingsFragment",
7271
"initGlobalBackupPreference",
73-
(XposedInterface.Hooker) chain -> {
72+
chain -> {
7473
sOverrideIsInternational.set(false);
7574
try {
7675
return chain.proceed();

0 commit comments

Comments
 (0)