๐Ÿ”— Redirect Bluesky links to your preferred client
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

Even more cleanup

+12 -14
+1
lemmyredirect/src/main/java/dev/zwander/lemmyredirect/MainApp.kt
··· 9 9 launchStrategyUtils = LaunchStrategyUtils, 10 10 fetchActivity = FetchInstancesActivity::class.java, 11 11 defaultLaunchStrategy = Jerboa.JerboaStable, 12 + appNameRes = R.string.app_name, 12 13 )
+1
mastodonredirect/src/main/java/dev/zwander/mastodonredirect/MainApp.kt
··· 9 9 launchStrategyUtils = LaunchStrategyUtils, 10 10 fetchActivity = FetchInstancesActivity::class.java, 11 11 defaultLaunchStrategy = Megalodon.MegalodonStable, 12 + appNameRes = R.string.app_name, 12 13 )
+4
shared/build.gradle.kts
··· 27 27 debug { 28 28 isMinifyEnabled = false 29 29 } 30 + all { 31 + buildConfigField("int", "VERSION_CODE", rootProject.extra["version.code"].toString()) 32 + buildConfigField("String", "VERSION_NAME", "\"${rootProject.extra["version.name"]}\"") 33 + } 30 34 } 31 35 val javaVersion = JavaVersion.toVersion(rootProject.extra["java.version"].toString().toInt()) 32 36 compileOptions {
+4 -10
shared/src/main/java/dev/zwander/shared/App.kt
··· 7 7 import android.content.pm.PackageManager 8 8 import android.os.Build 9 9 import android.os.IBinder 10 + import androidx.annotation.StringRes 10 11 import com.bugsnag.android.Bugsnag 11 12 import dev.zwander.shared.model.AppModel 12 13 import dev.zwander.shared.shizuku.ShizukuService ··· 29 30 override val launchStrategyUtils: BaseLaunchStrategyUtils, 30 31 override val fetchActivity: Class<*>, 31 32 override val defaultLaunchStrategy: LaunchStrategy, 33 + @StringRes private val appNameRes: Int, 32 34 ) : Application(), AppModel, CoroutineScope by MainScope() { 33 - private val pInfo by lazy { 34 - packageManager.getPackageInfo(packageName, 0) 35 - } 36 - 37 - override val versionName by lazy { 38 - pInfo.versionName.toString() 39 - } 40 35 override val appName by lazy { 41 - pInfo.applicationInfo.loadLabel(packageManager).toString() 36 + resources.getString(appNameRes) 42 37 } 43 38 override val prefs: Prefs 44 39 get() = Prefs.getInstance(this) ··· 68 63 } 69 64 } 70 65 71 - @Suppress("DEPRECATION") 72 66 private val serviceArgs by lazy { 73 67 Shizuku.UserServiceArgs(ComponentName(packageName, ShizukuService::class.java.canonicalName!!)) 74 - .version(pInfo.versionCode + (if (BuildConfig.DEBUG) 10003 else 0)) 68 + .version(BuildConfig.VERSION_CODE + (if (BuildConfig.DEBUG) 10003 else 0)) 75 69 .processNameSuffix("redirect") 76 70 .debuggable(BuildConfig.DEBUG) 77 71 .daemon(false)
-2
shared/src/main/java/dev/zwander/shared/components/LinkVerifyLayout.kt
··· 82 82 get() = error("Not implemented") 83 83 override val fetchActivity: Class<*> 84 84 get() = error("Not implemented") 85 - override val versionName: String 86 - get() = error("Not implemented") 87 85 override val appName: String 88 86 get() = "Test Redirect" 89 87 override val prefs: Prefs
+2 -1
shared/src/main/java/dev/zwander/shared/components/MainContent.kt
··· 25 25 import androidx.compose.ui.platform.LocalContext 26 26 import androidx.compose.ui.text.style.TextAlign 27 27 import androidx.compose.ui.unit.dp 28 + import dev.zwander.shared.BuildConfig 28 29 import dev.zwander.shared.model.LocalAppModel 29 30 import dev.zwander.shared.util.LinkVerificationModel 30 31 import dev.zwander.shared.util.LinkVerifyUtils ··· 68 69 } 69 70 70 71 Text( 71 - text = appModel.versionName, 72 + text = BuildConfig.VERSION_NAME, 72 73 style = MaterialTheme.typography.bodyMedium, 73 74 modifier = Modifier.fillMaxWidth() 74 75 .clickable(
-1
shared/src/main/java/dev/zwander/shared/model/AppModel.kt
··· 15 15 val defaultLaunchStrategy: LaunchStrategy 16 16 val fetchActivity: Class<*> 17 17 18 - val versionName: String 19 18 val appName: String 20 19 21 20 val prefs: Prefs