From b1d25e050339856674ff1260f9068b78f87c8aa8 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Mon, 4 Nov 2019 15:42:40 -0500 Subject: [PATCH] Reuse ALPHANUM --- app/src/main/java/com/topjohnwu/magisk/utils/Keygen.kt | 2 +- app/src/main/java/com/topjohnwu/magisk/utils/PatchAPK.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/utils/Keygen.kt b/app/src/main/java/com/topjohnwu/magisk/utils/Keygen.kt index 5f937459d..d1ffcf04a 100644 --- a/app/src/main/java/com/topjohnwu/magisk/utils/Keygen.kt +++ b/app/src/main/java/com/topjohnwu/magisk/utils/Keygen.kt @@ -5,6 +5,7 @@ import android.util.Base64 import android.util.Base64OutputStream import com.topjohnwu.magisk.Config import com.topjohnwu.magisk.di.koinModules +import com.topjohnwu.magisk.utils.PatchAPK.ALPHANUM import com.topjohnwu.signing.CryptoUtils.readCertificate import com.topjohnwu.signing.CryptoUtils.readPrivateKey import com.topjohnwu.superuser.internal.InternalUtils @@ -38,7 +39,6 @@ class Keygen: CertKeyProvider { private const val ALIAS = "magisk" private val PASSWORD get() = "magisk".toCharArray() private const val TESTKEY_CERT = "61ed377e85d386a8dfee6b864bd85b0bfaa5af81" - private const val ALPHANUM = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" private const val BASE64_FLAG = Base64.NO_PADDING or Base64.NO_WRAP } diff --git a/app/src/main/java/com/topjohnwu/magisk/utils/PatchAPK.kt b/app/src/main/java/com/topjohnwu/magisk/utils/PatchAPK.kt index 511409a7d..b1d4c00d3 100644 --- a/app/src/main/java/com/topjohnwu/magisk/utils/PatchAPK.kt +++ b/app/src/main/java/com/topjohnwu/magisk/utils/PatchAPK.kt @@ -27,7 +27,7 @@ object PatchAPK { private val UPPERALPHA = LOWERALPHA.toUpperCase() private val ALPHA = LOWERALPHA + UPPERALPHA private const val DIGITS = "0123456789" - private val ALPHANUM = ALPHA + DIGITS + val ALPHANUM = ALPHA + DIGITS private val ALPHANUMDOTS = "$ALPHANUM............" private fun genPackageName(prefix: String, length: Int): String {