Skip to content

Commit

Permalink
Merge tag '15-5.0' of https://github.com/seedvault-app/seedvault into…
Browse files Browse the repository at this point in the history
… HEAD

SeedVault 15-5.0

* First Android 15 release
* New backup format using compression and deduplication
* Can still restore old backups, but old Seedvault can't restore backups from this version
* Faster and more reliable backups making snapshots that can individually be restored
* Auto-cleaning of old backups
* All backups now mimic device-to-device (allowing backup for all apps)
* All backups now use a high per-app app quota
* App backup (for APKs) moved to expert settings
* Show more information for backups available to restore
* Fix "Waiting to back up..." showing for apps

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEE8LiYseXDVwsHMtSKo5wwJqfeYAEFAmcO31EACgkQo5wwJqfe
# YAEVOQ//YVTMljM+7Vp3WJo2JLAxAXo0B1RbUmr9ALt1xPc7rubHDfLDIyWTGZQV
# hB0oFXnRfIyNZ/F4ywt26xLEIIVpD0WDDScz74xOZVPk0rVxgYAEhSTekYNxEY8z
# /h8OEfmiHYqMG/55L/7jz2C6kOTC0RRK6l+QQoN4vNuBvyYxOlLqHENU9vE24iPF
# eh56wTgq8y9qJNnn4r3/y+I6tDb54T73/bBkJnHZVzDLUfFQxSodcq3JVyQhjuYn
# Ol16cy9l66soqZJS2E1ATfdpIUhCvGlz+9PFRLGA2i/HqxgLoUBzcsGoBXnIS/5I
# CLQmQynr+tX/HrtVHGNa0HlaLbq/NxTx2B3FISpCAwp7Kwv+lETn/6fSSMEgGrdm
# jVi6YuuBZHqQNL1aT7IZrHnblNN7c/Oosqom0tWyLdVCakn3aQuEcC+biLT772M9
# ulvWXTy9hqnSafBg5j2YqLSV3XIHX6212Ar+XHSQHKRWHvHb6zmqKzOxjY4S0V7F
# hCdZHpSFTrYm9W41De1oJkZm1Jt1Ch90RdA8KrOGf7QkILfcJfLiqWKL6bHezvOH
# egLQOx6AAj3+xd2LzjDXIa+VVNfHQ7W3pDWaY0emvZp/Nn+xw2IxP0CnHPj6ykVR
# Zo1qMcasZR4w6aNG1Nt89Q1QYCqzw3PZ7k0qeRH8LMj4hhYS6d0=
# =7SOB
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 16 Oct 2024 03:02:01 AM IST
# gpg:                using RSA key F0B898B1E5C3570B0732D48AA39C3026A7DE6001
# gpg: Good signature from "Chirayu Desai <[email protected]>" [ultimate]
# gpg:                 aka "Chirayu Desai <[email protected]>" [ultimate]
# gpg:                 aka "Chirayu Desai <[email protected]>" [ultimate]

* tag '15-5.0' of https://github.com/seedvault-app/seedvault: (86 commits)
  Release version 15-5.0
  Update About with NGI0 Entrust Fund
  Update README
  UsbIntentReceiver: Specify parcel's type in method as well
  don't crash in BackupMonitor when there is no packageName
  remove corrupted snapshots when pruning
  when cached snapshot is corrupted fall back to loading from backend
  Check that exceptions from file loading get caught
  Encode icons in PNG, because JPEG doesn't support transparency
  Try to recover data for force stopped apps from latest snapshot
  Use BackupManagerMonitor to handle K/V with no data changed
  Minor improvements for app restore
  Reset latest snapshot to avoid it getting stale
  Improve RestoreSet display
  Split up success and error notification
  Fix recovery code keyboard input for Android 15
  Show when launchable system apps do not allow backup
  improve local metadata handling
  do scheduling migration before strict mode
  Update UI state for some system apps if they have NO_DATA
  ...

Change-Id: I79ad0ca2abf0006c95d5a26f98f6bd42c1bc6610
  • Loading branch information
chirayudesai committed Oct 19, 2024
2 parents c906fd7 + f5c2f0b commit 5b91e78
Show file tree
Hide file tree
Showing 296 changed files with 12,632 additions and 7,173 deletions.
4 changes: 1 addition & 3 deletions .github/scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ echo "Installing Seedvault app..."
./gradlew --stacktrace :app:installDebugAndroidTest
sleep 60

D2D_BACKUP_TEST=$1

large_test_exit_code=0
./gradlew --stacktrace -Pinstrumented_test_size=large -Pd2d_backup_test="$D2D_BACKUP_TEST" :app:connectedAndroidTest || large_test_exit_code=$?
./gradlew --stacktrace -Pinstrumented_test_size=large :app:connectedAndroidTest || large_test_exit_code=$?

adb pull /sdcard/seedvault_test_results

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
matrix:
android_target: [ 34 ]
emulator_type: [ aosp_atd ]
d2d_backup_test: [ true, false ]
steps:
- name: Checkout Code
uses: actions/checkout@v3
Expand Down Expand Up @@ -53,7 +52,7 @@ jobs:
disable-animations: true
script: |
./app/development/scripts/provision_emulator.sh "test" "system-images;android-${{ matrix.android_target }};${{ matrix.emulator_type }};x86_64"
./.github/scripts/run_tests.sh ${{ matrix.d2d_backup_test }}
./.github/scripts/run_tests.sh
- name: Upload test results
if: always()
Expand Down
7 changes: 1 addition & 6 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 21 additions & 5 deletions Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,23 @@ android_app {
srcs: [
"app/src/main/java/**/*.kt",
"app/src/main/java/**/*.java",
"app/src/main/proto/*.proto",
// as of Android 15, there is no way to pass --kotlin_out to aprotoc compiler
"app/build/generated/source/proto/debug/kotlin/com/stevesoltys/seedvault/proto/*.kt",
],
resource_dirs: [
"app/src/main/res",
],
asset_dirs: [
"app/src/main/assets"
],
proto: {
type: "lite",
local_include_dirs: ["app/src/main/proto"],
},
static_libs: [
"kotlin-stdlib-jdk8",
"libprotobuf-java-lite",
"androidx.core_core-ktx",
"androidx.fragment_fragment-ktx",
"androidx.activity_activity-ktx",
Expand All @@ -26,18 +37,23 @@ android_app {
"com.google.android.material_material",
"kotlinx-coroutines-android",
"kotlinx-coroutines-core",
// storage backup lib
"seedvault-lib-kotlin-logging-jvm",
// app backup related libs
"seedvault-lib-protobuf-kotlin-lite",
"seedvault-logback-android",
"seedvault-lib-chunker",
"seedvault-lib-zstd-jni",
"okio-lib",
// our own gradle module libs
"seedvault-lib-core",
"seedvault-lib-storage",
// koin
"seedvault-lib-koin-core-jvm", // did not manage to add this as transitive dependency
"seedvault-lib-koin-android",
// bip39
"seedvault-lib-kotlin-bip39",
// WebDAV
"seedvault-lib-dav4jvm",
"seedvault-lib-okhttp",
"seedvault-lib-okio",
],
use_embedded_native_libs: true,
manifest: "app/src/main/AndroidManifest.xml",

platform_apis: true,
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## [15-5.0] - 2024-10-15
* First Android 15 release
* New backup format using compression and deduplication
* Can still restore old backups, but old Seedvault can't restore backups from this version
* Faster and more reliable backups making snapshots that can individually be restored
* Auto-cleaning of old backups
* All backups now mimic device-to-device (allowing backup for all apps)
* All backups now use a high per-app app quota
* App backup (for APKs) moved to expert settings
* Show more information for backups available to restore
* Fix "Waiting to back up..." showing for apps

## [14-4.1] - 2024-08-23
* It is now possible to restore after setting up a profile
* It is now possible to select what to restore (e.g. apps, files...)
Expand Down
53 changes: 37 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@
[![Build](https://github.com/seedvault-app/seedvault/actions/workflows/build.yml/badge.svg)](https://github.com/seedvault-app/seedvault/actions/workflows/build.yml)

A backup application for the [Android Open Source Project](https://source.android.com/).
Needs to be [integrated](https://github.com/seedvault-app/seedvault/wiki/ROM-Integration)
in your Android ROM and **can not** be installed as a regular app.

If you are having an issue/question, please look at our [FAQ](https://github.com/seedvault-app/seedvault/wiki/FAQ).
If you are having an issue/question,
please look at our [FAQ](https://github.com/seedvault-app/seedvault/wiki/FAQ)
or [ask a new question](https://github.com/seedvault-app/seedvault/discussions).

## Components

* [Local Contacts Backup](contactsbackup) - an app that backs up local on-device contacts
* [Storage library](storage) - a library handling efficient backup of files
* [File backup library](storage) - a library handling efficient backup of files
([documentation](storage/doc/design.md))
* [Seedvault app](app) - the main app where all functionality comes together
([documentation](doc/README.md))

## Features
- Backup application data to a flash drive.
Expand All @@ -19,24 +25,27 @@ If you are having an issue/question, please look at our [FAQ](https://github.com

## Requirements

SeedVault is developed along with AOSP releases
SeedVault is developed along with AOSP releases.

We update it every time Google releases a new Android version, make any changes required for basic functionality, and any improvements possible through API changes in the OS.
We update it every time Google releases a new Android version,
make any changes required for basic functionality,
and any improvements possible through API changes in the OS.

This means that for ROMs using SeedVault it's recommended to use the same branch as your android version
This means that for ROMs using SeedVault it's recommended
to use the same branch as your android version

- This current branch `android14` is meant for usage with Android 14
- This is indicated by the version name starting with `14`, and the version code starting with `34` - the Android 14 API version
- This current branch `android15` is meant for usage with Android 15
- This is indicated by the version name starting with `15`,
and the version code starting with `35` - the Android 15 API version

For older versions of Android, check out [the branches](https://github.com/seedvault-app/seedvault/branches).
For older versions of Android,
check out [the branches](https://github.com/seedvault-app/seedvault/branches).

Trying to use an older branch on a newer version may lead to issues and is not something we can support.

## Getting Started
- Check out [the wiki](https://github.com/seedvault-app/seedvault/wiki) for information on building the application with
AOSP.
Trying to use an older branch on a newer version may lead to issues
and is not something we can support.

## What makes this different?

This application is compiled with the operating system and does not require a rooted device for use.
It uses the same internal APIs as `adb backup` which is deprecated and thus needs a replacement.

Expand All @@ -60,9 +69,11 @@ It uses the same internal APIs as `adb backup` which is deprecated and thus need
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/seedvault-app/seedvault.

See [DEVELOPMENT.md](app/development/DEVELOPMENT.md) for information on developing Seedvault locally.
See [DEVELOPMENT.md](app/development/DEVELOPMENT.md) for information
on developing Seedvault locally.

This project aims to adhere to the [official Kotlin coding style](https://developer.android.com/kotlin/style-guide).
This project aims to adhere to the
[official Kotlin coding style](https://developer.android.com/kotlin/style-guide).

## Third-party tools

Expand All @@ -78,7 +89,8 @@ allows you to decrypt and inspect your backups from newer versions of Seedvault
It is currently work-in-progress.

## License
This application is available as open source under the terms of the [Apache-2.0 License](https://opensource.org/licenses/Apache-2.0).
This application is available as open source under the terms
of the [Apache-2.0 License](https://opensource.org/licenses/Apache-2.0).

## Funding

Expand All @@ -94,3 +106,12 @@ a fund established by [NLnet](https://nlnet.nl)
with financial support from the European Commission's Next Generation Internet programme,
under the aegis of DG Communications Networks, Content and Technology
under grant agreement No 825310.

### NGI0 Entrust Fund

This project was funded through the
[NGI0 Entrust Fund](https://nlnet.nl/project/SeedVault-Integrity/),
a fund established by [NLnet](https://nlnet.nl)
with financial support from the European Commission's Next Generation Internet programme,
under the aegis of DG Communications Networks, Content and Technology
under grant agreement No 101069594.
62 changes: 42 additions & 20 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
// SPDX-License-Identifier: Apache-2.0
//

import com.google.protobuf.gradle.id
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import java.io.ByteArrayOutputStream

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin.android)
alias(libs.plugins.google.protobuf)
}

val gitDescribe = {
Expand Down Expand Up @@ -37,9 +39,6 @@ android {

testInstrumentationRunnerArguments["size"] = testSize
}

val d2dBackupTest = project.findProperty("d2d_backup_test")?.toString() ?: "true"
testInstrumentationRunnerArguments["d2d_backup_test"] = d2dBackupTest
}

signingConfigs {
Expand Down Expand Up @@ -93,6 +92,30 @@ android {
}
}

protobuf {
protoc {
artifact = if ("aarch64" == System.getProperty("os.arch")) {
// mac m1
"com.google.protobuf:protoc:${libs.versions.protobuf.get()}:osx-x86_64"
} else {
// other
"com.google.protobuf:protoc:${libs.versions.protobuf.get()}"
}
}
generateProtoTasks {
all().forEach { task ->
task.plugins {
id("java") {
option("lite")
}
id("kotlin") {
option("lite")
}
}
}
}
}

lint {
abortOnError = true

Expand All @@ -106,19 +129,7 @@ android {
}

dependencies {

val aospLibs = fileTree("$projectDir/libs") {
// For more information about this module:
// https://android.googlesource.com/platform/frameworks/base/+/refs/tags/android-11.0.0_r3/Android.bp#507
// framework_intermediates/classes-header.jar works for gradle build as well,
// but not unit tests, so we use the actual classes (without updatable modules).
//
// out/target/common/obj/JAVA_LIBRARIES/framework-minus-apex_intermediates/classes.jar
include("android.jar")
// out/target/common/obj/JAVA_LIBRARIES/core-libart.com.android.art_intermediates/classes.jar
include("libcore.jar")
}

val aospLibs: FileTree by rootProject.extra
compileOnly(aospLibs)

/**
Expand All @@ -144,11 +155,15 @@ dependencies {
implementation(libs.androidx.work.runtime.ktx)
implementation(libs.google.material)

implementation(libs.google.protobuf.javalite)
implementation(libs.google.tink.android)
implementation(libs.kotlin.logging)
implementation(libs.squareup.okio)

/**
* Storage Dependencies
*/
implementation(project(":core"))
implementation(project(":storage:lib"))

/**
Expand All @@ -162,9 +177,13 @@ dependencies {
implementation(fileTree("${rootProject.rootDir}/libs/koin-android").include("*.jar"))
implementation(fileTree("${rootProject.rootDir}/libs/koin-android").include("*.aar"))

implementation(fileTree("${rootProject.rootDir}/libs").include("kotlin-bip39-jvm-1.0.6.jar"))

implementation(fileTree("${rootProject.rootDir}/libs/dav4jvm").include("*.jar"))
implementation(
fileTree("${rootProject.rootDir}/libs").include("protobuf-kotlin-lite-3.21.12.jar")
)
implementation(fileTree("${rootProject.rootDir}/libs").include("seedvault-chunker-0.1.jar"))
implementation(fileTree("${rootProject.rootDir}/libs").include("zstd-jni-1.5.6-5.aar"))
implementation(fileTree("${rootProject.rootDir}/libs").include("kotlin-bip39-jvm-1.0.8.jar"))
implementation(fileTree("${rootProject.rootDir}/libs").include("logback-android-3.0.0.aar"))

/**
* Test Dependencies (do not concern the AOSP build)
Expand All @@ -174,6 +193,7 @@ dependencies {
// anything less than 'implementation' fails tests run with gradlew
testImplementation(aospLibs)
testImplementation("androidx.test.ext:junit:1.1.5")
testImplementation("org.slf4j:slf4j-simple:2.0.3")
testImplementation("org.robolectric:robolectric:4.12.2")
testImplementation("org.hamcrest:hamcrest:2.2")
testImplementation("org.junit.jupiter:junit-jupiter-api:${libs.versions.junit5.get()}")
Expand All @@ -184,10 +204,12 @@ dependencies {
)
testImplementation("app.cash.turbine:turbine:1.0.0")
testImplementation("org.bitcoinj:bitcoinj-core:0.16.2")
testImplementation("com.github.luben:zstd-jni:1.5.6-5")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${libs.versions.junit5.get()}")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:${libs.versions.junit5.get()}")

androidTestImplementation(aospLibs)
androidTestImplementation(kotlin("test"))
androidTestImplementation("androidx.test:runner:1.4.0")
androidTestImplementation("androidx.test:rules:1.4.0")
androidTestImplementation("androidx.test.ext:junit:1.1.3")
Expand All @@ -197,7 +219,7 @@ dependencies {

gradle.projectsEvaluated {
tasks.withType(JavaCompile::class) {
options.compilerArgs.add("-Xbootclasspath/p:app/libs/android.jar:app/libs/libcore.jar")
options.compilerArgs.add("-Xbootclasspath/p:libs/aosp/android.jar:libs/aosp/libcore.jar")
}
}

Expand Down
Loading

0 comments on commit 5b91e78

Please sign in to comment.