-
-
Notifications
You must be signed in to change notification settings - Fork 776
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add downloader plugin system (#2041)
- Loading branch information
Showing
84 changed files
with
2,983 additions
and
1,104 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
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
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
11 changes: 11 additions & 0 deletions
11
app/src/main/java/app/revanced/manager/data/room/plugins/TrustedDownloaderPlugin.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,11 @@ | ||
package app.revanced.manager.data.room.plugins | ||
|
||
import androidx.room.ColumnInfo | ||
import androidx.room.Entity | ||
import androidx.room.PrimaryKey | ||
|
||
@Entity(tableName = "trusted_downloader_plugins") | ||
class TrustedDownloaderPlugin( | ||
@PrimaryKey @ColumnInfo(name = "package_name") val packageName: String, | ||
@ColumnInfo(name = "signature") val signature: ByteArray | ||
) |
22 changes: 22 additions & 0 deletions
22
app/src/main/java/app/revanced/manager/data/room/plugins/TrustedDownloaderPluginDao.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,22 @@ | ||
package app.revanced.manager.data.room.plugins | ||
|
||
import androidx.room.Dao | ||
import androidx.room.Query | ||
import androidx.room.Transaction | ||
import androidx.room.Upsert | ||
|
||
@Dao | ||
interface TrustedDownloaderPluginDao { | ||
@Query("SELECT signature FROM trusted_downloader_plugins WHERE package_name = :packageName") | ||
suspend fun getTrustedSignature(packageName: String): ByteArray? | ||
|
||
@Upsert | ||
suspend fun upsertTrust(plugin: TrustedDownloaderPlugin) | ||
|
||
@Query("DELETE FROM trusted_downloader_plugins WHERE package_name = :packageName") | ||
suspend fun remove(packageName: String) | ||
|
||
@Transaction | ||
@Query("DELETE FROM trusted_downloader_plugins WHERE package_name IN (:packageNames)") | ||
suspend fun removeAll(packageNames: Set<String>) | ||
} |
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
Oops, something went wrong.