Skip to content

Commit 651148e

Browse files
committed
fix: replace usages of Unsafe with UnsafeImpl
Signed-off-by: Akash Yadav <akashyadav@appdevforall.org>
1 parent 43286a6 commit 651148e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

app/build.gradle.kts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,18 @@ desugaring {
205205
EnvUtil::logbackVersion.javaMethod!!,
206206
DesugarEnvUtil::logbackVersion.javaMethod!!,
207207
)
208+
209+
// Replace usages of Unsafe class (from com.intellij.util.containers)
210+
// with our own implementation
211+
// The original implementation uses MethodHandle instances to access APIs
212+
// from sun.misc.Unsafe which are not directly accessible on Android
213+
// As a result, we have our implementatio of that class which makes use
214+
// of HiddenApiBypass to access the same methods, and provides a drop-in
215+
// replacement of the original class
216+
replaceClass(
217+
"org.jetbrains.kotlin.com.intellij.util.containers.Unsafe",
218+
"org.jetbrains.kotlin.com.intellij.util.containers.UnsafeImpl",
219+
)
208220
}
209221
}
210222

0 commit comments

Comments
 (0)