react-native-proguard-auto 1.0.0 → 1.0.2

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/readme.md +128 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-proguard-auto",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Automatically generate ProGuard rules for React Native native modules",
5
5
  "type": "module",
6
6
  "bin": {
@@ -14,4 +14,4 @@
14
14
  "javascript-obfuscator": "^5.3.0"
15
15
  },
16
16
  "license": "MIT"
17
- }
17
+ }
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
+ ![Without Proguard Rules](./images/before-proguard.png)
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
+ ![After Using react-native-proguard-auto](./images/after-proguard.png)
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
+ ---