Skip to content

Commit d468bef

Browse files
committed
proguard
1 parent 03fc12e commit d468bef

File tree

5 files changed

+197
-5
lines changed

5 files changed

+197
-5
lines changed

README.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ Min Version Requirements
7272
Installing the SDK
7373
------------------
7474

75-
### Install Android Libraries
7675

7776
In your app's `build.gradle`, copy the quickpose dependencies
7877

@@ -102,6 +101,8 @@ dependencies {
102101
```
103102

104103

104+
105+
105106
Getting Started
106107
------------------
107108

@@ -129,6 +130,41 @@ quickPose.start(
129130
)
130131
```
131132

133+
Proguard
134+
------------------
135+
136+
To enable proguard/r8 minifying, add these to your proguard rules:
137+
138+
```
139+
-keep public interface com.google.mediapipe.framework.* {
140+
public *;
141+
}
142+
143+
-keep public class com.google.mediapipe.framework.Packet {
144+
public static *** create(***);
145+
public long getNativeHandle();
146+
public void release();
147+
}
148+
149+
-keep public class com.google.mediapipe.framework.PacketCreator {
150+
*** releaseWithSyncToken(...);
151+
}
152+
153+
154+
-keep public class com.google.mediapipe.framework.MediaPipeException {
155+
<init>(int, byte[]);
156+
}
157+
158+
-keep class com.google.mediapipe.framework.ProtoUtil$SerializedMessage { *; }
159+
160+
-keep public class * extends com.google.protobuf.GeneratedMessageLite { *; }
161+
162+
-keepclassmembers class com.google.common.flogger.** { *; }
163+
-keep class ai.onnxruntime.** { *; }
164+
-keep class ai.quickpose.core.Status$* { *; }
165+
166+
```
167+
132168

133169
Documentation
134170
------------------

SampleApps/Compose/BasicDemoActivity/app/proguard-rules.pro

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,43 @@
1818

1919
# If you keep the line number information, uncomment this to
2020
# hide the original source file name.
21-
#-renamesourcefileattribute SourceFile
21+
#-renamesourcefileattribute SourceFile
22+
23+
24+
# Additional flags to pass to Proguard when processing a binary that uses
25+
# MediaPipe.
26+
27+
## Keep public members of our public interfaces. This also prevents the
28+
## obfuscation of the corresponding methods in classes implementing them,
29+
## such as implementations of PacketCallback#process.
30+
-keep public interface com.google.mediapipe.framework.* {
31+
public *;
32+
}
33+
34+
# This method is invoked by native code.
35+
-keep public class com.google.mediapipe.framework.Packet {
36+
public static *** create(***);
37+
public long getNativeHandle();
38+
public void release();
39+
}
40+
41+
# This method is invoked by native code.
42+
-keep public class com.google.mediapipe.framework.PacketCreator {
43+
*** releaseWithSyncToken(...);
44+
}
45+
46+
47+
# This method is invoked by native code.
48+
-keep public class com.google.mediapipe.framework.MediaPipeException {
49+
<init>(int, byte[]);
50+
}
51+
52+
# Required to use PacketCreator#createProto
53+
-keep class com.google.mediapipe.framework.ProtoUtil$SerializedMessage { *; }
54+
55+
-keep public class * extends com.google.protobuf.GeneratedMessageLite { *; }
56+
57+
-keepclassmembers class com.google.common.flogger.** { *; }
58+
-keep class ai.onnxruntime.** { *; }
59+
60+
-keep class ai.quickpose.core.Status$* { *; }

SampleApps/Compose/BasicDemoFunction/app/proguard-rules.pro

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,43 @@
1818

1919
# If you keep the line number information, uncomment this to
2020
# hide the original source file name.
21-
#-renamesourcefileattribute SourceFile
21+
#-renamesourcefileattribute SourceFile
22+
23+
24+
# Additional flags to pass to Proguard when processing a binary that uses
25+
# MediaPipe.
26+
27+
## Keep public members of our public interfaces. This also prevents the
28+
## obfuscation of the corresponding methods in classes implementing them,
29+
## such as implementations of PacketCallback#process.
30+
-keep public interface com.google.mediapipe.framework.* {
31+
public *;
32+
}
33+
34+
# This method is invoked by native code.
35+
-keep public class com.google.mediapipe.framework.Packet {
36+
public static *** create(***);
37+
public long getNativeHandle();
38+
public void release();
39+
}
40+
41+
# This method is invoked by native code.
42+
-keep public class com.google.mediapipe.framework.PacketCreator {
43+
*** releaseWithSyncToken(...);
44+
}
45+
46+
47+
# This method is invoked by native code.
48+
-keep public class com.google.mediapipe.framework.MediaPipeException {
49+
<init>(int, byte[]);
50+
}
51+
52+
# Required to use PacketCreator#createProto
53+
-keep class com.google.mediapipe.framework.ProtoUtil$SerializedMessage { *; }
54+
55+
-keep public class * extends com.google.protobuf.GeneratedMessageLite { *; }
56+
57+
-keepclassmembers class com.google.common.flogger.** { *; }
58+
-keep class ai.onnxruntime.** { *; }
59+
60+
-keep class ai.quickpose.core.Status$* { *; }

SampleApps/LegacyXML/BasicDemo/app/proguard-rules.pro

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,43 @@
1818

1919
# If you keep the line number information, uncomment this to
2020
# hide the original source file name.
21-
#-renamesourcefileattribute SourceFile
21+
#-renamesourcefileattribute SourceFile
22+
23+
24+
# Additional flags to pass to Proguard when processing a binary that uses
25+
# MediaPipe.
26+
27+
## Keep public members of our public interfaces. This also prevents the
28+
## obfuscation of the corresponding methods in classes implementing them,
29+
## such as implementations of PacketCallback#process.
30+
-keep public interface com.google.mediapipe.framework.* {
31+
public *;
32+
}
33+
34+
# This method is invoked by native code.
35+
-keep public class com.google.mediapipe.framework.Packet {
36+
public static *** create(***);
37+
public long getNativeHandle();
38+
public void release();
39+
}
40+
41+
# This method is invoked by native code.
42+
-keep public class com.google.mediapipe.framework.PacketCreator {
43+
*** releaseWithSyncToken(...);
44+
}
45+
46+
47+
# This method is invoked by native code.
48+
-keep public class com.google.mediapipe.framework.MediaPipeException {
49+
<init>(int, byte[]);
50+
}
51+
52+
# Required to use PacketCreator#createProto
53+
-keep class com.google.mediapipe.framework.ProtoUtil$SerializedMessage { *; }
54+
55+
-keep public class * extends com.google.protobuf.GeneratedMessageLite { *; }
56+
57+
-keepclassmembers class com.google.common.flogger.** { *; }
58+
-keep class ai.onnxruntime.** { *; }
59+
60+
-keep class ai.quickpose.core.Status$* { *; }

SampleApps/LegacyXML/PickerDemo/app/proguard-rules.pro

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,43 @@
1818

1919
# If you keep the line number information, uncomment this to
2020
# hide the original source file name.
21-
#-renamesourcefileattribute SourceFile
21+
#-renamesourcefileattribute SourceFile
22+
23+
24+
# Additional flags to pass to Proguard when processing a binary that uses
25+
# MediaPipe.
26+
27+
## Keep public members of our public interfaces. This also prevents the
28+
## obfuscation of the corresponding methods in classes implementing them,
29+
## such as implementations of PacketCallback#process.
30+
-keep public interface com.google.mediapipe.framework.* {
31+
public *;
32+
}
33+
34+
# This method is invoked by native code.
35+
-keep public class com.google.mediapipe.framework.Packet {
36+
public static *** create(***);
37+
public long getNativeHandle();
38+
public void release();
39+
}
40+
41+
# This method is invoked by native code.
42+
-keep public class com.google.mediapipe.framework.PacketCreator {
43+
*** releaseWithSyncToken(...);
44+
}
45+
46+
47+
# This method is invoked by native code.
48+
-keep public class com.google.mediapipe.framework.MediaPipeException {
49+
<init>(int, byte[]);
50+
}
51+
52+
# Required to use PacketCreator#createProto
53+
-keep class com.google.mediapipe.framework.ProtoUtil$SerializedMessage { *; }
54+
55+
-keep public class * extends com.google.protobuf.GeneratedMessageLite { *; }
56+
57+
-keepclassmembers class com.google.common.flogger.** { *; }
58+
-keep class ai.onnxruntime.** { *; }
59+
60+
-keep class ai.quickpose.core.Status$* { *; }

0 commit comments

Comments
 (0)