Skip to content

Commit

Permalink
Revoking unused permissions
Browse files Browse the repository at this point in the history
Removing Beta flavor, as we don't publish separate beta build, but instead publish internal build to internal track and then propagate it to beta track in Play Console
Renaming app name of internal flavor to Zotero Beta
Upping versionCode to 35.
  • Loading branch information
Dima-Android committed Dec 25, 2023
1 parent 81cf1a1 commit 74b9c43
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 29 deletions.
5 changes: 1 addition & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,8 @@ android {
applicationIdSuffix = ".debug"
}
internal {
resValue("string", "app_name", """"Zotero Internal""")
buildConfigField("String", "PSPDFKIT_KEY", readPspdfkitKey())
}
beta {
resValue("string", "app_name", """"Zotero Beta""")
buildConfigField("String", "PSPDFKIT_KEY", readPspdfkitKey())
}
}

Expand Down
26 changes: 23 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,39 @@
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
tools:node="remove" />

<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
tools:node="remove" />

<uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE"
tools:node="remove" />

<uses-permission
android:name="android.permission.WAKE_LOCK"
tools:node="remove" />

<uses-permission
android:name="android.permission.RECEIVE_BOOT_COMPLETED"
tools:node="remove" />


<application
android:name=".ZoteroApplication"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:networkSecurityConfig="@xml/network_security_config"
android:requestLegacyExternalStorage="false"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="false"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning"
android:largeHeap="true"
tools:replace="android:requestLegacyExternalStorage"
tools:targetApi="n">
<!-- <meta-data-->
<!-- android:name="pspdfkit_automatic_initialize"-->
Expand Down
12 changes: 1 addition & 11 deletions app/src/main/java/org/zotero/android/ZoteroApplication.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package org.zotero.android

import android.app.Application
import androidx.hilt.work.HiltWorkerFactory
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.ProcessLifecycleOwner
import androidx.work.Configuration
import com.google.gson.Gson
import com.pspdfkit.PSPDFKit
import dagger.hilt.android.HiltAndroidApp
Expand All @@ -21,10 +19,7 @@ import timber.log.Timber
import javax.inject.Inject

@HiltAndroidApp
open class ZoteroApplication : Configuration.Provider, Application(), DefaultLifecycleObserver {

@Inject
lateinit var workerFactory: HiltWorkerFactory
open class ZoteroApplication: Application(), DefaultLifecycleObserver {

@Inject
lateinit var controllers: Controllers
Expand Down Expand Up @@ -70,11 +65,6 @@ open class ZoteroApplication : Configuration.Provider, Application(), DefaultLif
}
}

override val workManagerConfiguration: Configuration
get() = Configuration.Builder()
.setWorkerFactory(workerFactory)
.build()

override fun onStart(owner: LifecycleOwner) {
controllers.willEnterForeground()
}
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/BuildConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ object BuildConfig {
const val compileSdkVersion = 34
const val targetSdk = 33

val versionCode = 34 // Must be updated on every build
val versionCode = 35 // Must be updated on every build
val version = Version(
major = 1,
minor = 0,
Expand Down
3 changes: 0 additions & 3 deletions buildSrc/src/main/kotlin/ProductFlavors.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ object ProductFlavors {
),
INTERNAL(
url = "",
),
BETA(
url = "",
);

companion object {
Expand Down
7 changes: 0 additions & 7 deletions buildSrc/src/main/kotlin/ProductFlavorsHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ fun com.android.build.gradle.TestedExtension.setDefaultProductFlavors() {
dimension = ProductFlavors.Environment.dimension
}
}
create(ProductFlavors.Environment.BETA.envName()) {
dimension = ProductFlavors.Environment.dimension
}
}
}

Expand All @@ -25,10 +22,6 @@ fun <T> NamedDomainObjectContainer<T>.internal(block: T.() -> Unit) {
getByName(ProductFlavors.Environment.INTERNAL.envName()).block()
}

fun <T> NamedDomainObjectContainer<T>.beta(block: T.() -> Unit) {
getByName(ProductFlavors.Environment.BETA.envName()).block()
}

private val ignoreSet = setOf("devRelease", "internalDebug", "betaDebug")

fun VariantBuilder.ignoreUnusedVariants() {
Expand Down

0 comments on commit 74b9c43

Please sign in to comment.