Skip to content

Commit

Permalink
修复部分bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Fan095 committed May 24, 2024
1 parent 155cae2 commit 5e62e84
Show file tree
Hide file tree
Showing 84 changed files with 366 additions and 209 deletions.
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="miui.permission.READ_LOGS" />
<uses-permission android:name="miui.permission.DUMP_CACHED_LOG" />
<uses-permission android:name="com.miui.securitycenter.permission.PERM_USE_INFO" />
<uses-permission android:name="com.miui.securitycenter.permission.SYSTEM_PERMISSION_DECLARE" />
<uses-permission android:name="com.miui.securitycenter.permission.ACCESS_SECURITY_CENTER_PROVIDER" />
<uses-permission
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.sevtinge.hyperceiler.controller;

import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreAndroidVersion;

import android.content.Context;

import com.sevtinge.hyperceiler.ui.settings.core.BasePreferenceController;
import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils;

public class DisableLowApiCheckController extends BasePreferenceController {

public DisableLowApiCheckController(Context context, String preferenceKey) {
super(context, preferenceKey);
}

@Override
public int getAvailabilityStatus() {
return isMoreAndroidVersion(34) ? AVAILABLE :
UNSUPPORTED_ON_DEVICE;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@ public void startWithFragment(String str, Bundle bundle, androidx.fragment.app.F

@Override
public boolean onPreferenceStartFragment(@NonNull PreferenceFragmentCompat preferenceFragmentCompat, @NonNull Preference preference) {
return false;
new SubSettingLauncher(this)
.setDestination(preference.getFragment())
.setArguments(preference.getExtras())
.setSourceMetricsCategory(0)
.setTitleText(preference.getTitle())
.launch();
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import com.sevtinge.hyperceiler.crash.CrashData;
import com.sevtinge.hyperceiler.utils.AppCrashHelper;
import com.sevtinge.hyperceiler.utils.BackupUtils;
import com.sevtinge.hyperceiler.utils.CtaUtils;
import com.sevtinge.hyperceiler.utils.DialogHelper;
import com.sevtinge.hyperceiler.utils.Helpers;
import com.sevtinge.hyperceiler.utils.LanguageHelper;
import com.sevtinge.hyperceiler.utils.PropUtils;
Expand Down Expand Up @@ -55,6 +57,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
AppCrashHelper.showCrashReportDialog(this, appCrash.toString());
}
}, 600);
DialogHelper.showCanaryTipsDialog(this, "当前版本是UI线路,可能包含各种不稳定因素");
}

@Override
Expand All @@ -64,9 +67,9 @@ protected void onNewIntent(Intent intent) {
}

private void requestCta() {
/*if (!CtaUtils.isCtaEnabled(this)) {
CtaUtils.showCtaDialog(this, REQUEST_CODE);
}*/
if (!CtaUtils.isCtaEnabled(this)) {
CtaUtils.showCtaDialog(this, 1);
}
}

private boolean haveCrashReport() {
Expand Down Expand Up @@ -94,7 +97,7 @@ public void test() {
public void onDestroy() {
ShellInit.destroy();
ThreadPoolManager.shutdown();
com.sevtinge.hyperceiler.prefs.PreferenceHeader.mUninstallApp.clear();
PreferenceHeader.mUninstallApp.clear();
PreferenceHeader.mDisableOrHiddenApp.clear();
super.onDestroy();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
// Give all controllers a chance to handle click.
//preference.getExtras().putInt(CATEGORY, getMetricsCategory());
});
initPrefs();
}

public void initPrefs() {}
Expand Down Expand Up @@ -200,6 +199,7 @@ private void displayResourceTiles() {
final PreferenceScreen screen = getPreferenceScreen();
//screen.setOnExpandButtonClickListener(this);
displayResourceTilesToScreen(screen);
initPrefs();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
Expand All @@ -16,6 +18,7 @@
import com.sevtinge.hyperceiler.utils.DialogHelper;

import fan.appcompat.app.ActionBar;
import fan.appcompat.app.AlertDialog;
import fan.appcompat.app.Fragment;
import fan.navigator.Navigator;
import fan.navigator.NavigatorFragmentListener;
Expand All @@ -27,6 +30,7 @@ public class ContentFragment extends Fragment implements NavigatorFragmentListen
public static final String ARG_PAGE = "page";
public static String mCurrTab = "HOME";
private ActionBar mActionBar;
private TextView mCanaryTips;
private DraggableViewPager mViewPager;
private FragmentPagerAdapter mViewPagerAdapter;

Expand Down Expand Up @@ -63,6 +67,9 @@ public void onNavigatorModeChanged(Navigator.Mode mode, Navigator.Mode mode2) {
public void onViewInflated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewInflated(view, savedInstanceState);
setCorrectNestedScrollMotionEventEnabled(true);
mCanaryTips = view.findViewById(R.id.canary_tips);
mCanaryTips.setAlpha(0.5f);
mCanaryTips.setOnClickListener(v -> DialogHelper.showCanaryTipsDialog(requireActivity(), "当前版本是UI线路,可能包含各种不稳定因素"));
mViewPager = view.findViewById(R.id.viewpager);
registerCoordinateScrollView(mViewPager);
Navigator.get(this).setTabSelectListener((menuItem, info) -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.sevtinge.hyperceiler.ui.settings.core.lifecycle;

import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;

import androidx.annotation.Nullable;
Expand All @@ -25,4 +26,13 @@ protected void setSharedPreferences(PreferenceManager preferenceManager) {
preferenceManager.setSharedPreferencesMode(Context.MODE_PRIVATE);
preferenceManager.setStorageDeviceProtected();
}


public SharedPreferences getSharedPreferences() {
return PrefsUtils.mSharedPreferences;
}

public boolean hasKey(String key) {
return getSharedPreferences().contains(key);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ public static boolean isScreenLayoutLarge(Context context) {
public static boolean isSplitTablet(Context context) {
return isPadDevice() || (isFoldDevice() && isScreenLayoutLarge(context));
}

public static boolean isMiuiXIISdkSupported() {
return BuildCompat.MIUI_VERSION_CODE >= 10;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@
import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion;

import com.sevtinge.hyperceiler.R;
import com.sevtinge.hyperceiler.ui.dashboard.DashboardFragment;
import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment;

import fan.preference.SwitchPreference;

public class AodFragment extends SettingsPreferenceFragment {
public class AodFragment extends DashboardFragment {
@Override
public int getContentResId() {
protected int getPreferenceScreenResId() {
return R.xml.aod;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion;

import com.sevtinge.hyperceiler.R;
import com.sevtinge.hyperceiler.ui.dashboard.DashboardFragment;
import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment;

public class CameraFragment extends SettingsPreferenceFragment {
public class CameraFragment extends DashboardFragment {

@Override
public int getContentResId() {
protected int getPreferenceScreenResId() {
return isMoreHyperOSVersion(1f) ? R.xml.camera_new : R.xml.camera;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import android.os.Bundle;

import com.sevtinge.hyperceiler.R;
import com.sevtinge.hyperceiler.ui.dashboard.DashboardFragment;
import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment;
import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils;

Expand All @@ -29,7 +30,7 @@
import fan.preference.SeekBarPreference;
import fan.preference.SwitchPreference;

public class CustomBackgroundSettings extends SettingsPreferenceFragment implements Preference.OnPreferenceChangeListener {
public class CustomBackgroundSettings extends DashboardFragment implements Preference.OnPreferenceChangeListener {

private String mKey = "";
private String mCustomBackgroundEnabledKey;
Expand All @@ -48,7 +49,7 @@ public class CustomBackgroundSettings extends SettingsPreferenceFragment impleme
private SeekBarPreference mBlurRadiusPreference;

@Override
public int getContentResId() {
protected int getPreferenceScreenResId() {
return R.xml.custom_background;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import com.sevtinge.hyperceiler.prefs.PreferenceHeader;
import com.sevtinge.hyperceiler.prefs.TipsPreference;
import com.sevtinge.hyperceiler.ui.MainActivityContextHelper;
import com.sevtinge.hyperceiler.ui.dashboard.DashboardFragment;
import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment;
import com.sevtinge.hyperceiler.ui.sub.helper.HomepageEntrance;
import com.sevtinge.hyperceiler.utils.ThreadPoolManager;
Expand All @@ -59,7 +60,7 @@

import fan.preference.Preference;

public class MainFragment extends SettingsPreferenceFragment implements HomepageEntrance.EntranceState {
public class MainFragment extends DashboardFragment implements HomepageEntrance.EntranceState {

Preference mSecurityCenter;
Preference mMiLink;
Expand Down Expand Up @@ -92,7 +93,7 @@ public void onCreate(Bundle savedInstanceState) {
}

@Override
public int getContentResId() {
protected int getPreferenceScreenResId() {
return R.xml.prefs_main;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@
import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion;

import com.sevtinge.hyperceiler.R;
import com.sevtinge.hyperceiler.ui.dashboard.DashboardFragment;
import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment;

import fan.preference.SwitchPreference;

public class MiLinkFragment extends SettingsPreferenceFragment {
public class MiLinkFragment extends DashboardFragment {

SwitchPreference mUnlockHMind;

@Override
public int getContentResId() {
protected int getPreferenceScreenResId() {
return R.xml.milink;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@
package com.sevtinge.hyperceiler.ui.sub;

import com.sevtinge.hyperceiler.R;
import com.sevtinge.hyperceiler.ui.dashboard.DashboardFragment;
import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment;

import fan.preference.SwitchPreference;

public class MiShareFragment extends SettingsPreferenceFragment {
public class MiShareFragment extends DashboardFragment {

SwitchPreference mMiShareNotAuto;

@Override
public int getContentResId() {
protected int getPreferenceScreenResId() {
return R.xml.mishare;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@

import com.sevtinge.hyperceiler.R;
import com.sevtinge.hyperceiler.ui.SubPickerActivity;
import com.sevtinge.hyperceiler.ui.dashboard.DashboardFragment;
import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment;
import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils;

import fan.preference.Preference;
import fan.preference.RadioButtonPreference;

public class MultiActionSettings extends SettingsPreferenceFragment {
public class MultiActionSettings extends DashboardFragment {

Bundle args;
String mKey = null;
Expand All @@ -54,7 +55,7 @@ public class MultiActionSettings extends SettingsPreferenceFragment {
Preference mAppSelector;

@Override
public int getContentResId() {
protected int getPreferenceScreenResId() {
return R.xml.home_multi_action;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@

import com.sevtinge.hyperceiler.R;
import com.sevtinge.hyperceiler.prefs.RecommendPreference;
import com.sevtinge.hyperceiler.ui.dashboard.DashboardFragment;
import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment;

public class NfcFragment extends SettingsPreferenceFragment {
public class NfcFragment extends DashboardFragment {

RecommendPreference mRecommend;
@Override
public int getContentResId() {
protected int getPreferenceScreenResId() {
return R.xml.nfc;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isAndroidVersion;

import com.sevtinge.hyperceiler.R;
import com.sevtinge.hyperceiler.ui.dashboard.DashboardFragment;
import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment;
import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils;

Expand All @@ -29,7 +30,7 @@
import fan.preference.Preference;
import fan.preference.SeekBarPreferenceCompat;

public class PersonalAssistantFragment extends SettingsPreferenceFragment
public class PersonalAssistantFragment extends DashboardFragment
implements Preference.OnPreferenceChangeListener {

DropDownPreference mBlurBackground;
Expand All @@ -38,7 +39,7 @@ public class PersonalAssistantFragment extends SettingsPreferenceFragment
DropDownPreference mBlurBackgroundStyle;

@Override
public int getContentResId() {
protected int getPreferenceScreenResId() {
return R.xml.personal_assistant;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@
package com.sevtinge.hyperceiler.ui.sub;

import com.sevtinge.hyperceiler.R;
import com.sevtinge.hyperceiler.ui.dashboard.DashboardFragment;
import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment;
import com.sevtinge.hyperceiler.utils.shell.ShellInit;

import fan.preference.Preference;

public class PhoneFragment extends SettingsPreferenceFragment {
public class PhoneFragment extends DashboardFragment {
Preference mPhone;

@Override
public int getContentResId() {
protected int getPreferenceScreenResId() {
return R.xml.phone;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@
package com.sevtinge.hyperceiler.ui.sub;

import com.sevtinge.hyperceiler.R;
import com.sevtinge.hyperceiler.ui.dashboard.DashboardFragment;
import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment;

public class SoGouFragment extends SettingsPreferenceFragment {
public class SoGouFragment extends DashboardFragment {
String[] all = new String[]{
"com.sohu.inputmethod.sogou.xiaomi",
"com.sohu.inputmethod.sogou"
};

@Override
public int getContentResId() {
protected int getPreferenceScreenResId() {
return R.xml.sogou_xiaomi;
}
}
Loading

0 comments on commit 5e62e84

Please sign in to comment.