diff --git a/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/IntroScreen.kt b/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/IntroScreen.kt index 0a1a896..eb6df3b 100644 --- a/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/IntroScreen.kt +++ b/gearslip/src/main/java/app/seb3thehacker/gearslip/ui/IntroScreen.kt @@ -68,6 +68,8 @@ import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.TextUnit import androidx.compose.ui.unit.dp import app.seb3thehacker.gearslip.BuildConfig +import app.seb3thehacker.gearslip.CertProvider +import app.seb3thehacker.gearslip.AppSettings import androidx.compose.runtime.collectAsState import androidx.compose.ui.draw.clipToBounds import androidx.compose.ui.draw.drawWithContent @@ -110,13 +112,16 @@ object Intro { val release: String = BuildConfig.VERSION_NAME.split('.').take(2).joinToString(".") /** - * True once per release for people who updated. A new install gets the setup guide instead: - * there's nothing "new" yet, so this release counts as seen and the next one shows. + * True once per release for people who used Gearslip before. A new install, or one with its + * data cleared, gets the setup guide instead: there's nothing "new" yet, so this release + * counts as seen and the next one shows. Install dates can't tell those apart, since + * clearing data keeps them, so this goes by what setup left behind; 0.2 saved the same. */ fun due(context: Context): Boolean { if (context.getSharedPreferences(PREFS, Context.MODE_PRIVATE).getString(KEY_SEEN, null) == release) return false - val info = runCatching { context.packageManager.getPackageInfo(context.packageName, 0) }.getOrNull() - if (info != null && info.firstInstallTime == info.lastUpdateTime) { + val usedBefore = AppSettings.hasSeenPermissionsSetup(context) || + AppSettings.hasSkippedCertSetup(context) || CertProvider.hasAnyCert(context) + if (!usedBefore) { markSeen(context) return false }