diff --git a/app/build.gradle b/app/build.gradle index 59f9614e9..90b2621fc 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -67,6 +67,9 @@ android { premium { buildConfigField "boolean", "IS_DROPBOX_ENABLED", "true" + // Remove Git feature because of Play restrictions on external storage permissions + buildConfigField "boolean", "IS_GIT_REMOVED", "true" + buildConfigField "String", "VERSION_NAME_SUFFIX", '""' dimension "store" @@ -79,6 +82,8 @@ android { */ buildConfigField "boolean", "IS_DROPBOX_ENABLED", "false" + buildConfigField "boolean", "IS_GIT_REMOVED", "false" + buildConfigField "String", "VERSION_NAME_SUFFIX", '" (fdroid)"' dimension "store" diff --git a/app/src/androidTest/java/com/orgzly/android/espresso/SshKeyCreationTest.kt b/app/src/androidTest/java/com/orgzly/android/espresso/SshKeyCreationTest.kt index 2dd91e48d..62cda5c23 100644 --- a/app/src/androidTest/java/com/orgzly/android/espresso/SshKeyCreationTest.kt +++ b/app/src/androidTest/java/com/orgzly/android/espresso/SshKeyCreationTest.kt @@ -10,12 +10,14 @@ import androidx.test.espresso.matcher.ViewMatchers.isDisplayed import androidx.test.espresso.matcher.ViewMatchers.withText import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation import com.orgzly.R +import com.orgzly.BuildConfig import com.orgzly.android.OrgzlyTest import com.orgzly.android.espresso.util.EspressoUtils import com.orgzly.android.ui.main.MainActivity import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.Parameterized +import org.junit.Assume @RunWith(value = Parameterized::class) @@ -35,6 +37,7 @@ class SshKeyCreationTest(private val param: Parameter) : OrgzlyTest() { @Test fun testCreateUnprotectedKey() { + Assume.assumeFalse(BuildConfig.IS_GIT_REMOVED); ActivityScenario.launch(MainActivity::class.java).use { EspressoUtils.onActionItemClick(R.id.activity_action_settings, R.string.settings) EspressoUtils.clickSetting(null, R.string.app) @@ -51,4 +54,4 @@ class SshKeyCreationTest(private val param: Parameter) : OrgzlyTest() { .check(matches(isDisplayed())) } } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/orgzly/android/ui/settings/SettingsFragment.kt b/app/src/main/java/com/orgzly/android/ui/settings/SettingsFragment.kt index 00a5b61bc..57a1333ea 100644 --- a/app/src/main/java/com/orgzly/android/ui/settings/SettingsFragment.kt +++ b/app/src/main/java/com/orgzly/android/ui/settings/SettingsFragment.kt @@ -99,8 +99,8 @@ class SettingsFragment : PreferenceFragmentCompat(), SharedPreferences.OnSharedP } } - // Disable Git repos completely on API < 23 - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { + // Disable Git repos completely on API < 23 and in the Play Store build + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N || BuildConfig.IS_GIT_REMOVED) { preference(R.string.pref_key_git_is_enabled)?.let { preferenceScreen.removePreference(it) }