Skip to content

Commit

Permalink
Reverting accidental style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nkitsaini committed Nov 1, 2022
1 parent f96d2e2 commit 1e8c2cd
Showing 1 changed file with 15 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,8 @@ class MainActivity : FlutterActivity() {
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
val mainChannel = MethodChannel(flutterEngine.dartExecutor.binaryMessenger, PATCHER_CHANNEL)
installerChannel =
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, INSTALLER_CHANNEL)
exporterChannel =
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, EXPORTER_CHANNEL)

installerChannel = MethodChannel(flutterEngine.dartExecutor.binaryMessenger, INSTALLER_CHANNEL)
exporterChannel = MethodChannel(flutterEngine.dartExecutor.binaryMessenger, EXPORTER_CHANNEL)
mainChannel.setMethodCallHandler { call, result ->
when (call.method) {
"runPatcher" -> {
Expand Down Expand Up @@ -183,8 +180,7 @@ class MainActivity : FlutterActivity() {

Thread {
try {
val patches =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) {
val patches = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CUPCAKE) {
PatchBundle.Dex(
patchBundleFilePath,
DexClassLoader(
Expand All @@ -193,11 +189,7 @@ class MainActivity : FlutterActivity() {
null,
javaClass.classLoader
)
)
.loadPatches()
.filter { patch ->
selectedPatches.any { it == patch.patchName }
}
).loadPatches().filter { patch -> selectedPatches.any { it == patch.patchName } }
} else {
TODO("VERSION.SDK_INT < CUPCAKE")
}
Expand Down Expand Up @@ -273,7 +265,11 @@ class MainActivity : FlutterActivity() {
handler.post {
installerChannel.invokeMethod(
"update",
mapOf("progress" to 0.5, "header" to "", "log" to msg)
mapOf(
"progress" to 0.5,
"header" to "",
"log" to msg
)
)
}
return@forEach
Expand Down Expand Up @@ -327,14 +323,12 @@ class MainActivity : FlutterActivity() {
)
}

// Signer("ReVanced", "s3cur3p@ssw0rd").signApk(patchedFile, outFile,
// keyStoreFile)
// Signer("ReVanced", "s3cur3p@ssw0rd").signApk(patchedFile, outFile, keyStoreFile)

try {
Signer("ReVanced", "s3cur3p@ssw0rd")
.signApk(patchedFile, outFile, keyStoreFile)
Signer("ReVanced", "s3cur3p@ssw0rd").signApk(patchedFile, outFile, keyStoreFile)
} catch (e: Exception) {
// log to console
//log to console
print("Error signing apk: ${e.message}")
e.printStackTrace()
}
Expand Down Expand Up @@ -363,14 +357,14 @@ class MainActivity : FlutterActivity() {
}
}
handler.post { result.success(null) }
}
.start()
}.start()
}

inner class ManagerLogger : Logger {
override fun error(msg: String) {
handler.post {
installerChannel.invokeMethod(
installerChannel
.invokeMethod(
"update",
mapOf("progress" to -1.0, "header" to "", "log" to msg)
)
Expand Down

0 comments on commit 1e8c2cd

Please sign in to comment.