From c8a2d1830958ac538e48c7ca70ba7f161f339ba4 Mon Sep 17 00:00:00 2001
From: Xav <1234@email1234.com>
Date: Wed, 28 Aug 2024 18:31:49 -0400
Subject: [PATCH] Remove twofortyfouram
---
app/build.gradle | 1 -
app/src/main/AndroidManifest.xml | 23 ----
.../ppareit/swiftp/locale/EditActivity.java | 114 ------------------
.../ppareit/swiftp/locale/FireReceiver.java | 54 ---------
.../swiftp/locale/SettingsBundleHelper.java | 64 ----------
5 files changed, 256 deletions(-)
delete mode 100644 app/src/main/java/be/ppareit/swiftp/locale/EditActivity.java
delete mode 100644 app/src/main/java/be/ppareit/swiftp/locale/FireReceiver.java
delete mode 100644 app/src/main/java/be/ppareit/swiftp/locale/SettingsBundleHelper.java
diff --git a/app/build.gradle b/app/build.gradle
index 989306fc..ec10f912 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -48,7 +48,6 @@ dependencies {
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.documentfile:documentfile:1.0.1'
implementation 'com.google.android.material:material:1.12.0'
- implementation 'com.twofortyfouram:android-plugin-client-sdk-for-locale:4.0.3'
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'org.jetbrains:annotations:23.0.0'
implementation 'androidx.work:work-runtime:2.9.0'
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 72fffc41..920a31c4 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -107,29 +107,6 @@ along with SwiFTP. If not, see .
android:name="be.ppareit.swiftp.gui.FsWidgetProvider$UpdateService"
android:foregroundServiceType="connectedDevice" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
.
- */
-package be.ppareit.swiftp.locale;
-
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.os.Bundle;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import android.view.MenuItem;
-import android.widget.RadioButton;
-import android.widget.RadioGroup;
-
-import com.twofortyfouram.locale.sdk.client.ui.activity.AbstractAppCompatPluginActivity;
-
-import net.vrallev.android.cat.Cat;
-
-import be.ppareit.swiftp.FsSettings;
-import be.ppareit.swiftp.R;
-
-import static be.ppareit.swiftp.locale.SettingsBundleHelper.BUNDLE_BOOLEAN_RUNNING;
-import static be.ppareit.swiftp.locale.SettingsBundleHelper.generateBundle;
-import static be.ppareit.swiftp.locale.SettingsBundleHelper.getBundleRunningState;
-
-/**
- * Created by ppareit on 29/04/16.
- */
-public class EditActivity extends AbstractAppCompatPluginActivity {
-
- @Override
- protected void onCreate(@Nullable Bundle savedInstanceState) {
- setTheme(FsSettings.getTheme());
- super.onCreate(savedInstanceState);
-
- setContentView(R.layout.locale_edit_layout);
-
- CharSequence callingApplicationLabel = null;
- try {
- PackageManager pm = getPackageManager();
- ApplicationInfo ai = pm.getApplicationInfo(getCallingPackage(), 0);
- callingApplicationLabel = pm.getApplicationLabel(ai);
- } catch (final PackageManager.NameNotFoundException e) {
- Cat.e("Calling package couldn't be found%s", e); //$NON-NLS-1$
- }
- if (null != callingApplicationLabel) {
- setTitle(callingApplicationLabel);
- }
- if (getSupportActionBar() != null) {
- getSupportActionBar().setSubtitle(R.string.swiftp_name);
- getSupportActionBar().setDisplayHomeAsUpEnabled(true);
- }
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- if (item.getItemId() == android.R.id.home) {
- finish();
- }
-
- return super.onOptionsItemSelected(item);
- }
-
- @Override
- public boolean isBundleValid(@NonNull Bundle bundle) {
- return SettingsBundleHelper.isBundleValid(bundle);
- }
-
- @Override
- public void onPostCreateWithPreviousResult(@NonNull Bundle previousBundle,
- @NonNull String previousBlurb) {
- if (!isBundleValid(previousBundle)) {
- Cat.e("Invalid bundle received, repairing to default");
- previousBundle = generateBundle(this, false);
- }
- boolean running = previousBundle.getBoolean(BUNDLE_BOOLEAN_RUNNING);
- RadioButton radioButton =
- (RadioButton) findViewById(running ? R.id.radio_server_running :
- R.id.radio_server_stopped);
- radioButton.setChecked(true);
- }
-
- @Nullable
- @Override
- public Bundle getResultBundle() {
- RadioGroup radioGroup = (RadioGroup) findViewById(R.id.radio_server_state_group);
- int checkedId = radioGroup.getCheckedRadioButtonId();
- boolean running = (checkedId == R.id.radio_server_running);
-
- return generateBundle(this, running);
- }
-
- @NonNull
- @Override
- public String getResultBlurb(@NonNull Bundle bundle) {
- boolean running = getBundleRunningState(bundle);
- return running ? "Running" : "Stopped";
- }
-}
diff --git a/app/src/main/java/be/ppareit/swiftp/locale/FireReceiver.java b/app/src/main/java/be/ppareit/swiftp/locale/FireReceiver.java
deleted file mode 100644
index b7022dd5..00000000
--- a/app/src/main/java/be/ppareit/swiftp/locale/FireReceiver.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-Copyright 2016-2017 Pieter Pareit
-
-This file is part of SwiFTP.
-
-SwiFTP is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-SwiFTP is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with SwiFTP. If not, see .
- */
-package be.ppareit.swiftp.locale;
-
-import android.content.Context;
-import android.os.Bundle;
-import androidx.annotation.NonNull;
-
-import com.twofortyfouram.locale.sdk.client.receiver.AbstractPluginSettingReceiver;
-
-import be.ppareit.swiftp.FsService;
-
-import static be.ppareit.swiftp.locale.SettingsBundleHelper.getBundleRunningState;
-
-/**
- * Created by ppareit on 29/04/16.
- */
-public class FireReceiver extends AbstractPluginSettingReceiver {
- @Override
- protected boolean isBundleValid(@NonNull Bundle bundle) {
- return SettingsBundleHelper.isBundleValid(bundle);
- }
-
- @Override
- protected boolean isAsync() {
- return false;
- }
-
- @Override
- protected void firePluginSetting(@NonNull Context context, @NonNull Bundle bundle) {
- boolean running = getBundleRunningState(bundle);
- if (running && !FsService.isRunning()) {
- FsService.start();
- } else if (!running && FsService.isRunning()) {
- FsService.stop();
- }
- }
-}
diff --git a/app/src/main/java/be/ppareit/swiftp/locale/SettingsBundleHelper.java b/app/src/main/java/be/ppareit/swiftp/locale/SettingsBundleHelper.java
deleted file mode 100644
index ef5e63d6..00000000
--- a/app/src/main/java/be/ppareit/swiftp/locale/SettingsBundleHelper.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-Copyright 2016-2017 Pieter Pareit
-
-This file is part of SwiFTP.
-
-SwiFTP is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-SwiFTP is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with SwiFTP. If not, see .
- */
-package be.ppareit.swiftp.locale;
-
-import android.content.Context;
-import android.os.Bundle;
-import androidx.annotation.NonNull;
-
-import com.twofortyfouram.assertion.BundleAssertions;
-import com.twofortyfouram.spackle.AppBuildInfo;
-
-import net.vrallev.android.cat.Cat;
-
-public final class SettingsBundleHelper {
-
- public static final String BUNDLE_BOOLEAN_RUNNING = "be.ppareit.swiftp.BOOLEAN_RUNNING";
- public static final String BUNDLE_VERSION_CODE = "be.ppareit.swiftp.VERSION_CODE";
-
-
- static public boolean isBundleValid(Bundle bundle) {
- if (bundle == null) {
- return false;
- }
- try {
- BundleAssertions.assertHasBoolean(bundle, BUNDLE_BOOLEAN_RUNNING);
- BundleAssertions.assertHasInt(bundle, BUNDLE_VERSION_CODE);
- } catch (AssertionError e) {
- Cat.e("Bundle failed verification");
- return false;
- }
- return true;
- }
-
- static public Bundle generateBundle(Context context, boolean running) {
- Bundle bundle = new Bundle();
- bundle.putBoolean(BUNDLE_BOOLEAN_RUNNING, running);
- bundle.putInt(BUNDLE_VERSION_CODE, AppBuildInfo.getVersionCode(context));
- return bundle;
- }
-
- static public boolean getBundleRunningState(@NonNull Bundle bundle) {
- return bundle.getBoolean(BUNDLE_BOOLEAN_RUNNING, false);
- }
-
- private SettingsBundleHelper() {
- }
-
-}