Skip to content

Commit

Permalink
remove crashlogs and old updates
Browse files Browse the repository at this point in the history
  • Loading branch information
newhinton committed Apr 16, 2024
1 parent 7d59418 commit 57f5950
Show file tree
Hide file tree
Showing 11 changed files with 1 addition and 393 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,4 @@ private void openOldMaintainerGithubLink() {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.github_maintainer_url)));
tryStartActivity(this, browserIntent);
}

private void openReleaseLink() {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.app_latest_release_url)));
tryStartActivity(this, browserIntent);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -146,22 +146,6 @@ protected void onCreate(Bundle savedInstanceState) {

findViewById(R.id.locked_config_btn).setOnClickListener(v -> askForConfigPassword());

boolean appUpdates = sharedPreferences.getBoolean(getString(R.string.pref_key_app_updates), true);
if (appUpdates) {
// Google Play and F-Droid have their own update mechanisms
// => do not check for updates
PackageManager packageManager = getPackageManager();
if ("com.android.vending".equals(packageManager.getInstallerPackageName(getPackageName()))
|| BuildConfig.DEBUG) {
FLog.d(TAG, "Installed via Google Play, not checking for updates");
} else if ("oss".equals(BuildConfig.FLAVOR)){
FLog.d(TAG, "OSS flavor, not checking for updates");
} else {
PackageUpdate packageUpdate = new PackageUpdate(this);
packageUpdate.checkForUpdate(false);
}
}

Intent intent = getIntent();
Bundle bundle = intent.getExtras();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,9 @@ public static String export(Context context) throws JSONException {

// Notifications
boolean appUpdates = sharedPreferences.getBoolean(context.getString(R.string.pref_key_app_updates), true);
boolean betaUpdates = sharedPreferences.getBoolean(context.getString(R.string.pref_key_app_updates_beta), false);

// Logging
boolean useLogs = sharedPreferences.getBoolean(context.getString(R.string.pref_key_logs), false);
boolean crashReports = sharedPreferences.getBoolean(context.getString(R.string.pref_key_crash_reports),
context.getResources().getBoolean(R.bool.default_crash_log_enable));


JSONObject main = new JSONObject();
Expand All @@ -66,9 +63,7 @@ public static String export(Context context) throws JSONException {
main.put("isDarkTheme", darkTheme);
main.put("isWrapFilenames", isWrapFilenames);
main.put("appUpdates", appUpdates);
main.put("betaUpdates", betaUpdates);
main.put("useLogs", useLogs);
main.put("crashReports", crashReports);

return main.toString();
}
Expand Down Expand Up @@ -116,11 +111,9 @@ public static void importJson(String json, Context context) throws JSONException

// Notifications
editor.putBoolean(context.getString(R.string.pref_key_app_updates), jsonObject.getBoolean("appUpdates"));
editor.putBoolean(context.getString(R.string.pref_key_app_updates_beta), jsonObject.getBoolean("betaUpdates"));

// Logging
editor.putBoolean(context.getString(R.string.pref_key_logs), jsonObject.getBoolean("useLogs"));
editor.putBoolean(context.getString(R.string.pref_key_crash_reports), jsonObject.getBoolean("crashReports"));

editor.apply();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ public class NotificationsSettingsFragment extends Fragment {
private View notificationsElement;
private View appUpdatesElement;
private Switch appUpdatesSwitch;
private View betaAppUpdatesElement;
private Switch betaAppUpdatesSwitch;
private Switch mNotificationReportSwitch;

/**
Expand Down Expand Up @@ -70,35 +68,16 @@ private void getViews(View view) {
notificationsElement = view.findViewById(R.id.notifications);
appUpdatesElement = view.findViewById(R.id.app_updates);
appUpdatesSwitch = view.findViewById(R.id.app_updates_switch);
betaAppUpdatesElement = view.findViewById(R.id.beta_app_updates);
betaAppUpdatesSwitch = view.findViewById(R.id.beta_app_updates_switch);
mNotificationReportSwitch = view.findViewById(R.id.app_notification_report_switch);
}

private void setDefaultStates() {
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
boolean appUpdates = sharedPreferences.getBoolean(getString(R.string.pref_key_app_updates), true);
boolean betaUpdates = sharedPreferences.getBoolean(getString(R.string.pref_key_app_updates_beta), false);
boolean notificationReports = sharedPreferences.getBoolean(getString(R.string.pref_key_app_notification_reports), true);

appUpdatesSwitch.setChecked(appUpdates);
betaAppUpdatesSwitch.setChecked(betaUpdates);
mNotificationReportSwitch.setChecked(notificationReports);

String installer = context.getPackageManager().getInstallerPackageName(context.getPackageName());
boolean isPlayStore = "com.android.vending".equals(installer);
boolean isOss = "oss".equals(BuildConfig.FLAVOR);
if (isOss || isPlayStore) {
appUpdatesElement.setVisibility(View.GONE);
betaAppUpdatesElement.setVisibility(View.GONE);
return;
}

if (appUpdates) {
betaAppUpdatesElement.setVisibility(View.VISIBLE);
} else {
betaAppUpdatesElement.setVisibility(View.GONE);
}
}

private void setClickListeners() {
Expand All @@ -112,14 +91,6 @@ private void setClickListeners() {
}
});
appUpdatesSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> onAppUpdatesClicked(isChecked));
betaAppUpdatesElement.setOnClickListener(v -> {
if (betaAppUpdatesSwitch.isChecked()) {
betaAppUpdatesSwitch.setChecked(false);
} else {
betaAppUpdatesSwitch.setChecked(true);
}
});
betaAppUpdatesSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> onBetaAppUpdatesClicked(isChecked));


mNotificationReportSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> onNotificationReportsClicked(isChecked));
Expand All @@ -144,25 +115,9 @@ private void onNotificationsClicked() {
}

private void onAppUpdatesClicked(boolean isChecked) {
if (isChecked) {
betaAppUpdatesElement.setVisibility(View.VISIBLE);
} else {
betaAppUpdatesSwitch.setChecked(false);
betaAppUpdatesElement.setVisibility(View.GONE);
}

SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putBoolean(getString(R.string.pref_key_app_updates), isChecked);
editor.putLong(getString(R.string.pref_key_update_last_check), 0L);
editor.apply();
}

private void onBetaAppUpdatesClicked(boolean isChecked) {
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putBoolean(getString(R.string.pref_key_app_updates_beta), isChecked);
editor.putLong(getString(R.string.pref_key_update_last_check), 0L);
editor.apply();
}

Expand Down
240 changes: 0 additions & 240 deletions app/src/main/java/ca/pkay/rcloneexplorer/pkg/PackageUpdate.java

This file was deleted.

Loading

0 comments on commit 57f5950

Please sign in to comment.