Skip to content

Commit 90d53f2

Browse files
author
Fastace
committed
refactor: 重命名应用名为 DataBackup Revived
## 核心变更 ### 应用标识修改 - 将 applicationId 从 `com.xayah.databackup` 改为 `com.xayah.databackup.revived` - 保持 namespace 为 `com.xayah.databackup` 以兼容现有代码结构 - 更新应用名称为 "DataBackup Revived" - 版本号从 3.0.0 开始,使用 gradle/libs.versions.toml 管理 ### ContentProvider 冲突修复 - 修改所有 flavor 模块的 AndroidManifest.xml,将 ContentProvider authority 从硬编码改为 `${applicationId}` 占位符 - 更新 CrashProvider 和 FileSharingProvider 的 authority 配置 - 修改 LogUtil.kt 中的 FileSharingProvider authority 引用,使用 `context.packageName` 动态获取 ### AndroidManifest 类名修复 - 将相对类名(如 `.DataBackupApplication`)改为完整类名(`com.xayah.databackup.DataBackupApplication`) - 修复因 namespace 与代码包名不一致导致的 ClassNotFoundException ### Firebase 配置更新 - 替换为新的 Firebase 项目配置(android-databackup-s3-9d3ea) - 为所有 flavor 变体(alpha, foss, premium)添加新包名配置 - 移除 feature module 的 Google Services 插件依赖 ### 更新检查功能调整 - 更新 GitHub 仓库链接指向新的 fork 仓库 - 修改 APK 下载链接以匹配新的包名格式 ### 向后兼容性 - 新旧版本可在同一设备上共存(不同的 applicationId) - ContentProvider authority 使用动态包名,避免冲突 Breaking Changes: 由于 applicationId 变更,这是一个全新的应用,用户无法从旧版本直接升级,需要安装新版本。 --- refactor: Rename application package to DataBackup Revived ## Core Changes ### Application Identity Modifications - Changed applicationId from `com.xayah.databackup` to `com.xayah.databackup.revived` - Kept namespace as `com.xayah.databackup` to maintain compatibility with existing code structure - Updated application display name to "DataBackup Revived" - Reset version to 3.0.0, managed via gradle/libs.versions.toml ### ContentProvider Authority Conflict Resolution - Modified AndroidManifest.xml in all flavor modules to use `${applicationId}` placeholder instead of hardcoded authorities - Updated CrashProvider and FileSharingProvider authorities configuration - Modified FileSharingProvider authority reference in LogUtil.kt to use `context.packageName` for dynamic retrieval ### AndroidManifest Class Path Fixes - Changed relative class names (e.g., `.DataBackupApplication`) to fully qualified names (`com.xayah.databackup.DataBackupApplication`) - Fixed ClassNotFoundException caused by namespace and actual package name mismatch - Updated Application, SplashActivity, and MainActivity class declarations in manifests ### Firebase Project Migration - Created new Firebase project `android-databackup-s3-9d3ea` - Registered three application variants in Firebase Console: - `com.xayah.databackup.revived.alpha` - `com.xayah.databackup.revived.foss` - `com.xayah.databackup.revived.premium` - Replaced google-services.json with new project configuration - Removed unnecessary Firebase plugin dependencies from feature modules ### Update Check Configuration Updates - Updated GitHub repository URL to point to the new forked repository - Modified APK download URLs to match new package naming format - Updated relevant constants in ConstantUtil ### Backward Compatibility - Old and new versions can coexist on the same device (different applicationIds) - ContentProvider authorities use dynamic package names to avoid conflicts **Breaking Changes**: Due to the applicationId change, this is considered a completely new application. Users cannot upgrade directly from the old version and must install the new version separately.
1 parent 7e7a364 commit 90d53f2

16 files changed

Lines changed: 67 additions & 118 deletions

File tree

source/app/build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ plugins {
99
}
1010

1111
android {
12-
namespace = "com.xayah.databackup"
12+
namespace = "com.xayah.databackup" // 修改:改回原来的包名
1313
compileSdk = libs.versions.compileSdk.get().toInt()
1414

1515
defaultConfig {
16-
applicationId = "com.xayah.databackup"
16+
applicationId = "com.xayah.databackup.revived" // 保持:新的应用包名
1717
minSdk = libs.versions.minSdk.get().toInt()
1818
targetSdk = libs.versions.targetSdk.get().toInt()
1919
versionCode = libs.versions.versionCode.get().toInt()
@@ -69,7 +69,7 @@ android {
6969
applicationVariants.all {
7070
outputs.forEach { output ->
7171
(output as BaseVariantOutputImpl).outputFileName =
72-
"DataBackup-${versionName}-${productFlavors[0].name}-${productFlavors[1].name}-${buildType.name}.apk"
72+
"DataBackup-Revived-${versionName}-${productFlavors[0].name}-${productFlavors[1].name}-${buildType.name}.apk"
7373
}
7474
}
7575

@@ -151,4 +151,4 @@ dependencies {
151151

152152
// BountyCastle
153153
implementation(libs.bountycastle)
154-
}
154+
}

source/app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xmlns:tools="http://schemas.android.com/tools">
44

55
<application
6-
android:name=".DataBackupApplication"
6+
android:name="com.xayah.databackup.DataBackupApplication"
77
android:allowBackup="true"
88
android:dataExtractionRules="@xml/data_extraction_rules"
99
android:fullBackupContent="@xml/backup_rules"
@@ -17,7 +17,7 @@
1717
tools:targetApi="31">
1818

1919
<activity
20-
android:name=".SplashActivity"
20+
android:name="com.xayah.databackup.SplashActivity"
2121
android:exported="true"
2222
android:theme="@style/Theme.DataBackup.SplashScreen">
2323
<intent-filter>
@@ -27,7 +27,7 @@
2727
</activity>
2828

2929
<activity
30-
android:name=".MainActivity"
30+
android:name="com.xayah.databackup.MainActivity"
3131
android:exported="false"
3232
android:windowSoftInputMode="adjustResize" />
3333

source/app/src/main/res/values-zh-rCN/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources xmlns:tools="http://schemas.android.com/tools">
3-
<string name="app_name">数据备份</string>
3+
<string name="app_name">数据备份 Revived</string>
44
<string name="welcome_to_use">欢迎使用DataBackup</string>
55
<string name="update_records">更新记录</string>
66
<string name="environment_detection">环境检测</string>

source/app/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources xmlns:tools="http://schemas.android.com/tools">
3-
<string name="app_name">DataBackup</string>
3+
<string name="app_name">DataBackup Revived</string>
44
<string name="welcome_to_use">Welcome to DataBackup</string>
55
<string name="update_records">Update records</string>
66
<string name="environment_detection">Environment detection</string>

source/core/datastore/src/main/kotlin/com/xayah/core/datastore/ConstantUtil.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ object ConstantUtil {
3232
)
3333

3434
const val DOC_LINK = "https://DataBackupOfficial.github.io"
35-
const val GITHUB_LINK = "https://github.com/XayahSuSuSu/Android-DataBackup"
35+
const val GITHUB_LINK = "https://github.com/543069760/Android-DataBackup-S3"
3636
const val CHAT_LINK = "https://t.me/databackupchat"
3737
const val DONATE_BMAC_LINK = "https://buymeacoffee.com/xayahsususu"
3838
const val DONATE_PAYPAL_LINK = "https://paypal.me/XayahSuSuSu"

source/core/network/src/main/kotlin/com/xayah/core/network/retrofit/GitHubRepository.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import retrofit2.http.GET
77
import javax.inject.Inject
88
import javax.inject.Singleton
99

10-
private const val BASE_URL = "https://api.github.com/repos/XayahSuSuSu/Android-DataBackup/"
10+
private const val BASE_URL = "https://api.github.com/repos/543069760/Android-DataBackup-S3/"
1111

1212
private interface Api {
1313
@GET(value = "releases")
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest />
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
<application>
4+
<provider
5+
android:name="com.xayah.core.provider.CrashProvider"
6+
android:authorities="${applicationId}.crashprovider"
7+
android:exported="false"
8+
android:enabled="true" />
9+
</application>
10+
</manifest>

source/core/ui/src/main/kotlin/com/xayah/core/ui/component/Scaffold.kt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ import androidx.compose.foundation.layout.Arrangement
55
import androidx.compose.foundation.layout.Box
66
import androidx.compose.foundation.layout.BoxScope
77
import androidx.compose.foundation.layout.Column
8-
import androidx.compose.foundation.layout.IntrinsicSize
9-
import androidx.compose.foundation.layout.Row
108
import androidx.compose.foundation.layout.RowScope
11-
import androidx.compose.foundation.layout.fillMaxHeight
12-
import androidx.compose.foundation.layout.height
139
import androidx.compose.foundation.layout.size
1410
import androidx.compose.material3.Badge
1511
import androidx.compose.material3.BadgedBox
@@ -54,16 +50,21 @@ fun MainIndexSubScaffold(
5450
topBar = {
5551
TopAppBar(
5652
title = {
57-
Row(modifier = Modifier.height(IntrinsicSize.Min), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(SizeTokens.Level8)) {
53+
Column(
54+
horizontalAlignment = Alignment.CenterHorizontally,
55+
verticalArrangement = Arrangement.spacedBy(SizeTokens.Level4)
56+
) {
57+
// 第1行: APP名称
5858
Text(text = title)
5959

60+
// 第2行: 版本信息和更新徽章
6061
BadgedBox(
6162
badge = {
6263
if (updateAvailable)
6364
Badge(modifier = Modifier.size(SizeTokens.Level6))
6465
}
6566
) {
66-
RoundChip(modifier = Modifier.fillMaxHeight(), onClick = if (updateAvailable) onVersionChipClick else null) {
67+
RoundChip(onClick = if (updateAvailable) onVersionChipClick else null) {
6768
var version by remember {
6869
mutableStateOf("${BuildConfigUtil.VERSION_NAME} ${BuildConfigUtil.FLAVOR_feature.capitalizeString()}")
6970
}
@@ -102,4 +103,4 @@ fun MainIndexSubScaffold(
102103
Box(modifier = Modifier.weight(1f), content = content)
103104
}
104105
}
105-
}
106+
}

source/core/util/src/main/kotlin/com/xayah/core/util/LogUtil.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,12 @@ object LogUtil {
7777

7878
fun shareLog(context: Context, name: String) {
7979
val sharingLog = File(cacheDir, name)
80-
val sharingUri =
81-
getUriForFile(context, "com.xayah.core.provider.FileSharingProvider.${BuildConfigUtil.FLAVOR_feature.lowercase()}", sharingLog)
80+
// 使用 context.packageName 获取运行时的应用包名
81+
val sharingUri = getUriForFile(
82+
context,
83+
"${context.packageName}.filesharingprovider",
84+
sharingLog
85+
)
8286
val sharingIntent = Intent().apply {
8387
action = Intent.ACTION_SEND
8488
type = "*/*"
@@ -96,4 +100,4 @@ fun <T> Result<T>.withLog(): Result<T> {
96100
LogUtil.log { "Exception" to stringWriter.toString() }
97101
}
98102
return this
99-
}
103+
}

source/feature/flavor/alpha/src/main/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
<!-- Workaround for CrashHandler -->
99
<provider
1010
android:name="com.xayah.core.provider.CrashProvider"
11-
android:authorities="com.xayah.core.provider.CrashProvider.alpha"
11+
android:authorities="${applicationId}.crashprovider"
1212
android:exported="false"
1313
android:initOrder="101"
1414
tools:replace="android:authorities" />
1515
<!-- End -->
1616

1717
<provider
1818
android:name="com.xayah.core.provider.FileSharingProvider"
19-
android:authorities="com.xayah.core.provider.FileSharingProvider.alpha"
19+
android:authorities="${applicationId}.filesharingprovider"
2020
android:exported="false"
2121
android:grantUriPermissions="true"
2222
tools:replace="android:authorities">

0 commit comments

Comments
 (0)