fix(export-settings): export patches as json object

This commit is contained in:
Benjamin Halko 2023-10-04 11:33:13 -07:00
parent 4de274bf62
commit f7c11d07a8
No known key found for this signature in database
GPG Key ID: 790C70040EB331A0

View File

@ -40,8 +40,7 @@ class ExportSettingsActivity : Activity() {
val keystoreFile = File(getExternalFilesDir(null), "/revanced-manager.keystore")
if (keystoreFile.exists()) {
val keystoreBytes = keystoreFile.readBytes()
val keystoreBase64 =
Base64.encodeToString(keystoreBytes, Base64.DEFAULT).replace("\n", "")
val keystoreBase64 = Base64.encodeToString(keystoreBytes, Base64.DEFAULT)
json.put("keystore", keystoreBase64)
}
@ -50,7 +49,7 @@ class ExportSettingsActivity : Activity() {
if (storedPatchesFile.exists()) {
val patchesBytes = storedPatchesFile.readBytes()
val patches = String(patchesBytes, Charsets.UTF_8)
json.put("patches", patches)
json.put("patches", JSONObject(patches))
}
// Send data back