forked from ReVanced/revanced-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: store patched apps (ReVanced#79)
* feat: store patched apps * fix: missing string * feat: save patch selection * feat: things * fix: fix broken query * fix: remove redundant `withContext` * fix: fix
- Loading branch information
1 parent
ac4c7e0
commit a0b9255
Showing
33 changed files
with
842 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...d/manager/data/room/apps/DownloadedApp.kt → ...ata/room/apps/downloaded/DownloadedApp.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
app/src/main/java/app/revanced/manager/data/room/apps/installed/AppliedPatch.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package app.revanced.manager.data.room.apps.installed | ||
|
||
import android.os.Parcelable | ||
import androidx.room.ColumnInfo | ||
import androidx.room.Entity | ||
import androidx.room.ForeignKey | ||
import androidx.room.Index | ||
import app.revanced.manager.data.room.bundles.PatchBundleEntity | ||
import kotlinx.parcelize.Parcelize | ||
|
||
@Parcelize | ||
@Entity( | ||
tableName = "applied_patch", | ||
primaryKeys = ["package_name", "bundle", "patch_name"], | ||
foreignKeys = [ | ||
ForeignKey( | ||
InstalledApp::class, | ||
parentColumns = ["current_package_name"], | ||
childColumns = ["package_name"], | ||
onDelete = ForeignKey.CASCADE | ||
), | ||
ForeignKey( | ||
PatchBundleEntity::class, | ||
parentColumns = ["uid"], | ||
childColumns = ["bundle"] | ||
) | ||
], | ||
indices = [Index(value = ["bundle"], unique = false)] | ||
) | ||
data class AppliedPatch( | ||
@ColumnInfo(name = "package_name") val packageName: String, | ||
@ColumnInfo(name = "bundle") val bundle: Int, | ||
@ColumnInfo(name = "patch_name") val patchName: String | ||
) : Parcelable |
23 changes: 23 additions & 0 deletions
23
app/src/main/java/app/revanced/manager/data/room/apps/installed/InstalledApp.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package app.revanced.manager.data.room.apps.installed | ||
|
||
import android.os.Parcelable | ||
import androidx.room.ColumnInfo | ||
import androidx.room.Entity | ||
import androidx.room.PrimaryKey | ||
import app.revanced.manager.R | ||
import kotlinx.parcelize.Parcelize | ||
|
||
enum class InstallType(val stringResource: Int) { | ||
DEFAULT(R.string.default_install), | ||
ROOT(R.string.root_install) | ||
} | ||
|
||
@Parcelize | ||
@Entity(tableName = "installed_app") | ||
data class InstalledApp( | ||
@PrimaryKey | ||
@ColumnInfo(name = "current_package_name") val currentPackageName: String, | ||
@ColumnInfo(name = "original_package_name") val originalPackageName: String, | ||
@ColumnInfo(name = "version") val version: String, | ||
@ColumnInfo(name = "install_type") val installType: InstallType | ||
) : Parcelable |
Oops, something went wrong.