diff --git a/app/src/main/aidl/com/android/vending/billing/IInAppBillingService.aidl b/app/src/main/aidl/com/android/vending/billing/IInAppBillingService.aidl deleted file mode 100644 index 2a492f7..0000000 --- a/app/src/main/aidl/com/android/vending/billing/IInAppBillingService.aidl +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (C) 2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.vending.billing; - -import android.os.Bundle; - -/** - * InAppBillingService is the service that provides in-app billing version 3 and beyond. - * This service provides the following features: - * 1. Provides a new API to get details of in-app items published for the app including - * price, type, title and description. - * 2. The purchase flow is synchronous and purchase information is available immediately - * after it completes. - * 3. Purchase information of in-app purchases is maintained within the Google Play system - * till the purchase is consumed. - * 4. An API to consume a purchase of an inapp item. All purchases of one-time - * in-app items are consumable and thereafter can be purchased again. - * 5. An API to get current purchases of the user immediately. This will not contain any - * consumed purchases. - * - * All calls will give a response code with the following possible values - * RESULT_OK = 0 - success - * RESULT_USER_CANCELED = 1 - user pressed back or canceled a dialog - * RESULT_BILLING_UNAVAILABLE = 3 - this billing API version is not supported for the type requested - * RESULT_ITEM_UNAVAILABLE = 4 - requested SKU is not available for purchase - * RESULT_DEVELOPER_ERROR = 5 - invalid arguments provided to the API - * RESULT_ERROR = 6 - Fatal error during the API action - * RESULT_ITEM_ALREADY_OWNED = 7 - Failure to purchase since item is already owned - * RESULT_ITEM_NOT_OWNED = 8 - Failure to consume since item is not owned - */ -interface IInAppBillingService { - /** - * Checks support for the requested billing API version, package and in-app type. - * Minimum API version supported by this interface is 3. - * @param apiVersion the billing version which the app is using - * @param packageName the package name of the calling app - * @param type type of the in-app item being purchased "inapp" for one-time purchases - * and "subs" for subscription. - * @return RESULT_OK(0) on success, corresponding result code on failures - */ - int isBillingSupported(int apiVersion, String packageName, String type); - - /** - * Provides details of a list of SKUs - * Given a list of SKUs of a valid type in the skusBundle, this returns a bundle - * with a list JSON strings containing the productId, price, title and description. - * This API can be called with a maximum of 20 SKUs. - * @param apiVersion billing API version that the Third-party is using - * @param packageName the package name of the calling app - * @param skusBundle bundle containing a StringArrayList of SKUs with key "ITEM_ID_LIST" - * @return Bundle containing the following key-value pairs - * "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on - * failure as listed above. - * "DETAILS_LIST" with a StringArrayList containing purchase information - * in JSON format similar to: - * '{ "productId" : "exampleSku", "type" : "inapp", "price" : "$5.00", - * "title : "Example Title", "description" : "This is an example description" }' - */ - Bundle getSkuDetails(int apiVersion, String packageName, String type, in Bundle skusBundle); - - /** - * Returns a pending intent to launch the purchase flow for an in-app item by providing a SKU, - * the type, a unique purchase token and an optional developer payload. - * @param apiVersion billing API version that the app is using - * @param packageName package name of the calling app - * @param sku the SKU of the in-app item as published in the developer console - * @param type the type of the in-app item ("inapp" for one-time purchases - * and "subs" for subscription). - * @param developerPayload optional argument to be sent back with the purchase information - * @return Bundle containing the following key-value pairs - * "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on - * failure as listed above. - * "BUY_INTENT" - PendingIntent to start the purchase flow - * - * The Pending intent should be launched with startIntentSenderForResult. When purchase flow - * has completed, the onActivityResult() will give a resultCode of OK or CANCELED. - * If the purchase is successful, the result data will contain the following key-value pairs - * "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on - * failure as listed above. - * "INAPP_PURCHASE_DATA" - String in JSON format similar to - * '{"orderId":"12999763169054705758.1371079406387615", - * "packageName":"com.example.app", - * "productId":"exampleSku", - * "purchaseTime":1345678900000, - * "purchaseToken" : "122333444455555", - * "developerPayload":"example developer payload" }' - * "INAPP_DATA_SIGNATURE" - String containing the signature of the purchase data that - * was signed with the private key of the developer - * TODO: change this to app-specific keys. - */ - Bundle getBuyIntent(int apiVersion, String packageName, String sku, String type, - String developerPayload); - - /** - * Returns the current SKUs owned by the user of the type and package name specified along with - * purchase information and a signature of the data to be validated. - * This will return all SKUs that have been purchased in V3 and managed items purchased using - * V1 and V2 that have not been consumed. - * @param apiVersion billing API version that the app is using - * @param packageName package name of the calling app - * @param type the type of the in-app items being requested - * ("inapp" for one-time purchases and "subs" for subscription). - * @param continuationToken to be set as null for the first call, if the number of owned - * skus are too many, a continuationToken is returned in the response bundle. - * This method can be called again with the continuation token to get the next set of - * owned skus. - * @return Bundle containing the following key-value pairs - * "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on - * failure as listed above. - * "INAPP_PURCHASE_ITEM_LIST" - StringArrayList containing the list of SKUs - * "INAPP_PURCHASE_DATA_LIST" - StringArrayList containing the purchase information - * "INAPP_DATA_SIGNATURE_LIST"- StringArrayList containing the signatures - * of the purchase information - * "INAPP_CONTINUATION_TOKEN" - String containing a continuation token for the - * next set of in-app purchases. Only set if the - * user has more owned skus than the current list. - */ - Bundle getPurchases(int apiVersion, String packageName, String type, String continuationToken); - - /** - * Consume the last purchase of the given SKU. This will result in this item being removed - * from all subsequent responses to getPurchases() and allow re-purchase of this item. - * @param apiVersion billing API version that the app is using - * @param packageName package name of the calling app - * @param purchaseToken token in the purchase information JSON that identifies the purchase - * to be consumed - * @return 0 if consumption succeeded. Appropriate error values for failures. - */ - int consumePurchase(int apiVersion, String packageName, String purchaseToken); -} diff --git a/app/src/main/java/com/wardellbagby/sensordisabler/bundle/PluginBundleManager.java b/app/src/main/java/com/wardellbagby/sensordisabler/bundle/PluginBundleManager.java deleted file mode 100644 index e302b95..0000000 --- a/app/src/main/java/com/wardellbagby/sensordisabler/bundle/PluginBundleManager.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright 2013 two forty four a.m. LLC - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in - * compliance with the License. You may obtain a copy of the License at - * - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is - * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and limitations under the License. - */ - -package com.wardellbagby.sensordisabler.bundle; - -import android.content.Context; -import android.os.Bundle; -import android.util.Log; -import com.wardellbagby.sensordisabler.util.Constants; - -/** - * Class for managing the {@link com.twofortyfouram.locale.Intent#EXTRA_BUNDLE} for this plug-in. - */ -public final class PluginBundleManager { - - public static final String BUNDLE_EXTRA_SENSOR_STATUS_KEY = - "com.wardellbagby.sensordisabler.extra.SENSOR_STATUS_KEY"; - public static final String BUNDLE_EXTRA_SENSOR_STATUS_VALUE = - "com.wardellbagby.sensordisabler.extra.SENSOR_STATUS_VALUE"; - public static final String BUNDLE_EXTRA_SENSOR_MOCK_VALUES_KEY = - "com.wardellbagby.sensordisabler.extra.SENSOR_VALUE_KEY"; - public static final String BUNDLE_EXTRA_SENSOR_MOCK_VALUES_VALUES = - "com.wardellbagby.sensordisabler.extra.SENSOR_VALUE_VALUE"; - - /* - * This extra is not strictly required, however it makes backward and forward compatibility significantly - * easier. For example, suppose a bug is found in how some version of the plug-in stored its Bundle. By - * having the version, the plug-in can better detect when such bugs occur. - */ - public static final String BUNDLE_EXTRA_INT_VERSION_CODE = - "com.wardellbagby.sensordisabler.extra.INT_VERSION_CODE"; - - /** - * Private constructor prevents instantiation - * - * @throws UnsupportedOperationException because this class cannot be instantiated. - */ - private PluginBundleManager() { - throw new UnsupportedOperationException("This class is non-instantiable"); //$NON-NLS-1$ - } - - public static boolean isBundleValid(final Bundle bundle) { - if (null == bundle) { - return false; - } - - /* - * Make sure the expected extras exist - */ - if (!bundle.containsKey(BUNDLE_EXTRA_SENSOR_STATUS_KEY)) { - if (Constants.IS_LOGGABLE) { - Log.e(Constants.LOG_TAG, - String.format("bundle must contain extra %s", - BUNDLE_EXTRA_SENSOR_STATUS_KEY)); //$NON-NLS-1$ - } - return false; - } - if (!bundle.containsKey(BUNDLE_EXTRA_SENSOR_STATUS_VALUE)) { - if (Constants.IS_LOGGABLE) { - Log.e(Constants.LOG_TAG, - String.format("bundle must contain extra %s", - BUNDLE_EXTRA_SENSOR_STATUS_VALUE)); //$NON-NLS-1$ - } - return false; - } - if (!bundle.containsKey(BUNDLE_EXTRA_SENSOR_MOCK_VALUES_KEY)) { - if (Constants.IS_LOGGABLE) { - Log.e(Constants.LOG_TAG, - String.format("bundle must contain extra %s", - BUNDLE_EXTRA_SENSOR_MOCK_VALUES_KEY)); //$NON-NLS-1$ - } - return false; - } - if (!bundle.containsKey(BUNDLE_EXTRA_SENSOR_MOCK_VALUES_VALUES)) { - if (Constants.IS_LOGGABLE) { - Log.e(Constants.LOG_TAG, - String.format("bundle must contain extra %s", - BUNDLE_EXTRA_SENSOR_MOCK_VALUES_VALUES)); //$NON-NLS-1$ - } - return false; - } - if (!bundle.containsKey(BUNDLE_EXTRA_INT_VERSION_CODE)) { - if (Constants.IS_LOGGABLE) { - Log.e(Constants.LOG_TAG, - String.format("bundle must contain extra %s", - BUNDLE_EXTRA_INT_VERSION_CODE)); //$NON-NLS-1$ - } - return false; - } - - /* - * Make sure the correct number of extras exist. Run this test after checking for specific Bundle - * extras above so that the error message is more useful. (E.g. the caller will see what extras are - * missing, rather than just a message that there is the wrong number). - */ - if (5 != bundle.keySet().size()) { - if (Constants.IS_LOGGABLE) { - Log.e(Constants.LOG_TAG, - String.format("bundle must contain 5 keys, but currently contains %d keys: %s", - bundle.keySet().size(), bundle.keySet())); //$NON-NLS-1$ - } - return false; - } - - //If version checking is ever implemented, this could be useful. - // if (bundle.getInt(BUNDLE_EXTRA_INT_VERSION_CODE, 0) != bundle.getInt(BUNDLE_EXTRA_INT_VERSION_CODE, 1)) { - // if (Constants.IS_LOGGABLE) { - // Log.e(Constants.LOG_TAG, - // String.format("bundle extra %s appears to be the wrong type. It must be an int", BUNDLE_EXTRA_INT_VERSION_CODE)); //$NON-NLS-1$ - // } - // - // return false; - // } - - return true; - } - - public static Bundle generateBundle(final Context context, String sensorKey, int sensorValue, - String sensorValueKey, float[] sensorMockValues) { - final Bundle result = new Bundle(); - result.putInt(BUNDLE_EXTRA_INT_VERSION_CODE, Constants.getVersionCode(context)); - result.putString(BUNDLE_EXTRA_SENSOR_STATUS_KEY, sensorKey); - result.putInt(BUNDLE_EXTRA_SENSOR_STATUS_VALUE, sensorValue); - result.putString(BUNDLE_EXTRA_SENSOR_MOCK_VALUES_KEY, sensorValueKey); - result.putFloatArray(BUNDLE_EXTRA_SENSOR_MOCK_VALUES_VALUES, sensorMockValues); - return result; - } -} \ No newline at end of file diff --git a/app/src/main/java/com/wardellbagby/sensordisabler/toolbar/ToolbarWorkflow.kt b/app/src/main/java/com/wardellbagby/sensordisabler/toolbar/ToolbarWorkflow.kt index 8ba14c5..341e39d 100644 --- a/app/src/main/java/com/wardellbagby/sensordisabler/toolbar/ToolbarWorkflow.kt +++ b/app/src/main/java/com/wardellbagby/sensordisabler/toolbar/ToolbarWorkflow.kt @@ -28,10 +28,6 @@ data class ToolbarProps( val overflowMenu: List = listOf() ) -sealed class ToolbarOutput { - object NavigationIconClicked : ToolbarOutput() -} - data class ToolbarAction( @DrawableRes val drawable: Int = 0, val title: CharSequence, diff --git a/app/src/main/java/com/wardellbagby/sensordisabler/util/Constants.java b/app/src/main/java/com/wardellbagby/sensordisabler/util/Constants.java index 92bbb48..c69f52c 100644 --- a/app/src/main/java/com/wardellbagby/sensordisabler/util/Constants.java +++ b/app/src/main/java/com/wardellbagby/sensordisabler/util/Constants.java @@ -13,15 +13,9 @@ package com.wardellbagby.sensordisabler.util; import android.content.Context; -import com.wardellbagby.sensordisabler.BuildConfig; public final class Constants { - //TODO If this file ends up being unwieldy, refactor into different files. - - public static final String LOG_TAG = "Disable Prox Sensor"; //$NON-NLS-1$ - public static final boolean IS_LOGGABLE = BuildConfig.DEBUG; - public static final String SKU_TASKER = "tasker_purchase"; public static final String SKU_DONATION_1 = "donation_1"; public static final String SKU_DONATION_5 = "donation_5"; @@ -31,39 +25,12 @@ public final class Constants { public static final String PREFS_KEY_TASKER = "prefs_key_tasker"; public static final String PREFS_KEY_FREELOAD = "prefs_key_freeload"; public static final String PREFS_KEY_BLOCKLIST = "enabled_blocking_list"; - public static final String PREFS_KEY_NEVER_SHOW_XPOSED_INSTALLED = "never_show_xposed_installed"; public static final int SENSOR_STATUS_DO_NOTHING = 0; public static final int SENSOR_STATUS_REMOVE_SENSOR = 1; public static final int SENSOR_STATUS_MOCK_VALUES = 2; - public static final String INTENT_APP_PACKAGE = "appPackage"; - public static final String INTENT_APP_LABEL = "appLabel"; - - public static final String BLACKLIST = "blacklist"; - public static final String WHITELIST = "whitelist"; - private Constants() { throw new UnsupportedOperationException("This class is non-instantiable"); //$NON-NLS-1$ } - - /** - * Determines the "versionCode" in the {@code AndroidManifest}. - * - * @param context to read the versionCode. - * @return versionCode of the app. - */ - public static int getVersionCode(final Context context) { - try { - return context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionCode; - } catch (final UnsupportedOperationException e) { - /* - * This exception is thrown by test contexts - */ - - return 1; - } catch (final Exception e) { - throw new RuntimeException(e); - } - } } \ No newline at end of file diff --git a/app/src/main/res/drawable-hdpi/ic_check_white_24dp.png b/app/src/main/res/drawable-hdpi/ic_check_white_24dp.png deleted file mode 100644 index 729f290..0000000 Binary files a/app/src/main/res/drawable-hdpi/ic_check_white_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/ic_save_white_24dp.png b/app/src/main/res/drawable-hdpi/ic_save_white_24dp.png deleted file mode 100644 index dd3f106..0000000 Binary files a/app/src/main/res/drawable-hdpi/ic_save_white_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/ic_check_white_24dp.png b/app/src/main/res/drawable-mdpi/ic_check_white_24dp.png deleted file mode 100644 index dfcb55d..0000000 Binary files a/app/src/main/res/drawable-mdpi/ic_check_white_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-mdpi/ic_save_white_24dp.png b/app/src/main/res/drawable-mdpi/ic_save_white_24dp.png deleted file mode 100644 index 015062e..0000000 Binary files a/app/src/main/res/drawable-mdpi/ic_save_white_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/ic_check_white_24dp.png b/app/src/main/res/drawable-xhdpi/ic_check_white_24dp.png deleted file mode 100644 index 3b2b65d..0000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_check_white_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-xhdpi/ic_save_white_24dp.png b/app/src/main/res/drawable-xhdpi/ic_save_white_24dp.png deleted file mode 100644 index adda095..0000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_save_white_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_check_white_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_check_white_24dp.png deleted file mode 100644 index 2c2ad77..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_check_white_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_save_white_24dp.png b/app/src/main/res/drawable-xxhdpi/ic_save_white_24dp.png deleted file mode 100644 index 3e0ce1a..0000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_save_white_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_check_white_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_check_white_24dp.png deleted file mode 100644 index d670618..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/ic_check_white_24dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_save_white_24dp.png b/app/src/main/res/drawable-xxxhdpi/ic_save_white_24dp.png deleted file mode 100644 index bd80bf1..0000000 Binary files a/app/src/main/res/drawable-xxxhdpi/ic_save_white_24dp.png and /dev/null differ diff --git a/app/src/main/res/layout/main_layout.xml b/app/src/main/res/layout/main_layout.xml deleted file mode 100644 index 200fddb..0000000 --- a/app/src/main/res/layout/main_layout.xml +++ /dev/null @@ -1,6 +0,0 @@ - - diff --git a/app/src/main/res/layout/single_sensor_value_setting_header.xml b/app/src/main/res/layout/single_sensor_value_setting_header.xml deleted file mode 100644 index dd98594..0000000 --- a/app/src/main/res/layout/single_sensor_value_setting_header.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/values-w820dp/dimens.xml b/app/src/main/res/values-w820dp/dimens.xml deleted file mode 100644 index 53a9e63..0000000 --- a/app/src/main/res/values-w820dp/dimens.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - 64dp - - diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 1608b45..93d5547 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -5,7 +5,6 @@ #007c91 #ef5e91 #ff91c1 - #b92864 #000000 #000000 diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 4b4d91d..721d3af 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -1,9 +1,3 @@ - - - 16dp - 16dp - 16dp -