Skip to content

Commit

Permalink
Reduce binary size by disabling tons of kt null check (#1202)
Browse files Browse the repository at this point in the history
  • Loading branch information
yujincheng08 authored Dec 25, 2021
1 parent edfc5e0 commit 4d5d896
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -352,3 +352,15 @@ tasks.whenTaskAdded {
this.dependsOn(tasks.getByName("checkTargetNativeLibsRelease"))
}
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().all {
if (name.contains("release", true)) {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + listOf(
"-Xno-call-assertions",
"-Xno-receiver-assertions",
"-Xno-param-assertions",
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ object MessageStyleNotification : CommonDelayAbleHookBridge(SyncUtils.PROC_ANY)
Activity::class.java,
Boolean::class.javaPrimitiveType,
object : XC_MethodReplacement() {
override fun replaceHookedMethod(param: MethodHookParam): Any {
override fun replaceHookedMethod(param: MethodHookParam): Any? {
val id = Thread.currentThread().id
val unhook = if (param.args[1] as Boolean &&
(param.args[0] as Activity).isLaunchedFromBubble
Expand Down

0 comments on commit 4d5d896

Please # to comment.