Skip to content

Commit 61d1a6b

Browse files
committed
Add a consumer-rules.pro file in bytehook module, for keeping all native methods in com.bytedance.android.bytehook.ByteHook. If we don’t do this, the app needs to keep these methods manually.
1 parent 0dfe9a1 commit 61d1a6b

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

bytehook/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ android {
99
defaultConfig {
1010
minSdkVersion rootProject.ext.minSdkVersion
1111
targetSdkVersion rootProject.ext.targetSdkVersion
12+
consumerProguardFiles "consumer-rules.pro"
1213
externalNativeBuild {
1314
cmake {
1415
abiFilters rootProject.ext.abiFilters.split(",")

bytehook/consumer-rules.pro

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-keep class com.bytedance.android.bytehook.ByteHook {
2+
native <methods>;
3+
}

bytehook_sample/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ android {
3939
minifyEnabled false
4040
}
4141
release {
42-
minifyEnabled false
42+
minifyEnabled true
4343
}
4444
}
4545
if (!rootProject.ext.dependencyOnLocalLibrary) {

0 commit comments

Comments
 (0)