react-native-proguard-auto 1.0.0 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/images/after-proguard.png +0 -0
- package/images/before-proguard.png +0 -0
- package/package.json +4 -3
- package/readme.md +128 -0
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-proguard-auto",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Automatically generate ProGuard rules for React Native native modules",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"bin",
|
|
11
|
-
"dist"
|
|
11
|
+
"dist",
|
|
12
|
+
"images"
|
|
12
13
|
],
|
|
13
14
|
"devDependencies": {
|
|
14
15
|
"javascript-obfuscator": "^5.3.0"
|
|
15
16
|
},
|
|
16
17
|
"license": "MIT"
|
|
17
|
-
}
|
|
18
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# react-native-proguard-auto
|
|
2
|
+
|
|
3
|
+
Automatically generate **ProGuard / R8 rules for React Native projects**.
|
|
4
|
+
|
|
5
|
+
`react-native-proguard-auto` scans your installed dependencies and generates recommended **ProGuard keep rules** to help prevent **release build crashes caused by code shrinking and obfuscation**.
|
|
6
|
+
|
|
7
|
+
It simplifies the process of handling ProGuard rules when working with **React Native native modules**.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 🚀 Features
|
|
12
|
+
|
|
13
|
+
- Automatically scans installed dependencies
|
|
14
|
+
- Generates ProGuard / R8 keep rules
|
|
15
|
+
- Helps prevent release build crashes
|
|
16
|
+
- Works with modern React Native versions
|
|
17
|
+
- Simple CLI usage
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 📦 Installation
|
|
22
|
+
|
|
23
|
+
Install the package inside your React Native project.
|
|
24
|
+
|
|
25
|
+
### Using npm
|
|
26
|
+
|
|
27
|
+
npm install --save-dev react-native-proguard-auto
|
|
28
|
+
|
|
29
|
+
### Using yarn
|
|
30
|
+
|
|
31
|
+
yarn add --dev react-native-proguard-auto
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## ⚙️ Usage
|
|
36
|
+
|
|
37
|
+
After installing the package, run the CLI using **npx**.
|
|
38
|
+
|
|
39
|
+
npx react-native-proguard-auto
|
|
40
|
+
|
|
41
|
+
Run this command from the **root of your React Native project**.
|
|
42
|
+
|
|
43
|
+
The tool will analyze your project dependencies and generate **recommended ProGuard rules**.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
### 📸 Without Proguard Rules
|
|
48
|
+
|
|
49
|
+
Without proper ProGuard rules, release builds may fail or crash due to missing classes during code shrinking.
|
|
50
|
+
|
|
51
|
+

|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
### 📸 After Using react-native-proguard-auto
|
|
56
|
+
|
|
57
|
+
The tool automatically generates the required ProGuard rules to help ensure stable release builds.
|
|
58
|
+
|
|
59
|
+

|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## 📄 Example Output
|
|
65
|
+
|
|
66
|
+
Example generated rules:
|
|
67
|
+
|
|
68
|
+
-keep class com.reactnativecommunity.** { *; }
|
|
69
|
+
-keep class com.google.firebase.** { *; }
|
|
70
|
+
-keep class com.google.android.gms.** { *; }
|
|
71
|
+
|
|
72
|
+
You can copy these rules into your Android ProGuard configuration file.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## 📂 Where to Add the Rules
|
|
77
|
+
|
|
78
|
+
Add the generated rules to:
|
|
79
|
+
|
|
80
|
+
android/app/proguard-rules.pro
|
|
81
|
+
|
|
82
|
+
Example project structure:
|
|
83
|
+
|
|
84
|
+
YourProject
|
|
85
|
+
├── android
|
|
86
|
+
│ └── app
|
|
87
|
+
│ └── proguard-rules.pro
|
|
88
|
+
├── node_modules
|
|
89
|
+
├── package.json
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 🏗 Build Release APK / AAB
|
|
94
|
+
|
|
95
|
+
After adding the rules, build your release version.
|
|
96
|
+
|
|
97
|
+
cd android
|
|
98
|
+
gradlew assembleRelease
|
|
99
|
+
|
|
100
|
+
or
|
|
101
|
+
|
|
102
|
+
npx react-native run-android --variant=release
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## 🧑💻 Compatibility
|
|
107
|
+
|
|
108
|
+
Works with:
|
|
109
|
+
|
|
110
|
+
- React Native 0.60+
|
|
111
|
+
- Android R8
|
|
112
|
+
- Android ProGuard
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## 🤝 Contributing
|
|
117
|
+
|
|
118
|
+
Contributions are welcome.
|
|
119
|
+
|
|
120
|
+
If you find a bug or want to improve the tool, feel free to open an issue or submit a pull request.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## 📜 License
|
|
125
|
+
|
|
126
|
+
MIT License
|
|
127
|
+
|
|
128
|
+
---
|