feat: add option to import/export keystore (#776)

* feat: add option to import/export keystore

* change the order of import/export keystore buttons

* feat: add option to change the keystore password
This commit is contained in:
Sebok Andras
2023-04-18 11:38:10 +02:00
committed by GitHub
parent 3b677f8ae3
commit dca2d4fe12
8 changed files with 193 additions and 6 deletions

View File

@@ -44,6 +44,8 @@ class MainActivity : FlutterActivity() {
val selectedPatches = call.argument<List<String>>("selectedPatches")
val cacheDirPath = call.argument<String>("cacheDirPath")
val keyStoreFilePath = call.argument<String>("keyStoreFilePath")
val keystorePassword = call.argument<String>("keystorePassword")
if (patchBundleFilePath != null &&
originalFilePath != null &&
inputFilePath != null &&
@@ -52,7 +54,8 @@ class MainActivity : FlutterActivity() {
integrationsPath != null &&
selectedPatches != null &&
cacheDirPath != null &&
keyStoreFilePath != null
keyStoreFilePath != null &&
keystorePassword != null
) {
runPatcher(
result,
@@ -64,7 +67,8 @@ class MainActivity : FlutterActivity() {
integrationsPath,
selectedPatches,
cacheDirPath,
keyStoreFilePath
keyStoreFilePath,
keystorePassword
)
} else {
result.notImplemented()
@@ -85,7 +89,8 @@ class MainActivity : FlutterActivity() {
integrationsPath: String,
selectedPatches: List<String>,
cacheDirPath: String,
keyStoreFilePath: String
keyStoreFilePath: String,
keystorePassword: String
) {
val originalFile = File(originalFilePath)
val inputFile = File(inputFilePath)
@@ -242,7 +247,7 @@ class MainActivity : FlutterActivity() {
// Signer("ReVanced", "s3cur3p@ssw0rd").signApk(patchedFile, outFile, keyStoreFile)
try {
Signer("ReVanced", "s3cur3p@ssw0rd").signApk(patchedFile, outFile, keyStoreFile)
Signer("ReVanced", keystorePassword).signApk(patchedFile, outFile, keyStoreFile)
} catch (e: Exception) {
//log to console
print("Error signing apk: ${e.message}")