Skip to content

Commit

Permalink
更新V1.3.7
Browse files Browse the repository at this point in the history
修复激活bug
  • Loading branch information
mingzhixian committed Jan 22, 2024
1 parent f6671d5 commit 0777006
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions easycontrol/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "top.saymzx.easycontrol.app"
minSdk 21
targetSdk 34
versionCode 10306
versionName "1.3.6"
versionCode 10307
versionName "1.3.7"
ndk {
abiFilters "arm64-v8a", "armeabi-v7a", "x86", "x86_64"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ protected void onCreate(Bundle savedInstanceState) {
PublicTools.setLocale(this);
activeActivity = ActivityActiveBinding.inflate(this.getLayoutInflater());
setContentView(activeActivity.getRoot());
AppData.setting.setIsActive(false);
setButtonListener();
// 绘制UI
drawUi();
Expand All @@ -39,6 +40,7 @@ private void setButtonListener() {
AppData.uiHandler.post(() -> {
if (isOk) {
finish();
AppData.setting.setIsActive(true);
Toast.makeText(this, getString(R.string.active_button_success), Toast.LENGTH_SHORT).show();
PublicTools.startUrl(this, "https://gitee.com/mingzhixianweb/easycontrol/blob/master/HOW_TO_USE.md");
} else Toast.makeText(this, getString(R.string.active_button_error), Toast.LENGTH_SHORT).show();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ protected void onDestroy() {

// 检测激活
private void checkActive() {
if (AppData.setting.getActiveKey().equals("")) startActivity(new Intent(this, ActiveActivity.class));
if (!AppData.setting.getIsActive()) startActivity(new Intent(this, ActiveActivity.class));
}

// 检查权限
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ public final class Setting {

private final SharedPreferences.Editor editor;

public boolean getIsActive() {
return sharedPreferences.getBoolean("isActive", false);
}

public void setIsActive(boolean value) {
editor.putBoolean("isActive", value);
editor.apply();
}

public String getActiveKey() {
return sharedPreferences.getString("activeKey", "");
}
Expand Down

0 comments on commit 0777006

Please sign in to comment.