catalyst-core 0.0.3-canary.8 → 0.1.0-canary.1
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/README.md +0 -1
- package/bin/catalyst.js +28 -15
- package/changelog.md +102 -27
- package/dist/native/androidProject/app/build.gradle.kts +91 -11
- package/dist/native/androidProject/app/proguard-rules.pro +60 -14
- package/dist/native/androidProject/app/src/debug/res/xml/network_security_config.xml +8 -0
- package/dist/native/androidProject/app/src/main/AndroidManifest.xml +9 -2
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/BridgeMessageValidator.kt +560 -0
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/CatalystConstants.kt +106 -0
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/CustomWebview.kt +593 -110
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/MainActivity.kt +378 -47
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/MetricsMonitor.kt +341 -0
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/NativeBridge.kt +656 -70
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/SplashActivity.kt +111 -0
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/Utils.kt +73 -8
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/WebCacheManager.kt +69 -8
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/utils/BridgeUtils.kt +33 -11
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/utils/DeviceInfoUtils.kt +73 -0
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/utils/DownloadUtils.kt +35 -14
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/utils/FileUtils.kt +3 -2
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/utils/FrameworkServerUtils.kt +57 -8
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/utils/IntentUtils.kt +31 -6
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/utils/KeyboardUtil.kt +82 -0
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/utils/NetworkUtils.kt +105 -0
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/utils/NotificationConstants.kt +28 -0
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/utils/NotificationUtils.kt +639 -0
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/utils/SafeAreaUtils.kt +62 -0
- package/dist/native/androidProject/app/src/main/res/drawable/splashscreen_fallback.png +0 -0
- package/dist/native/androidProject/app/src/main/res/layout/activity_main.xml +1 -0
- package/dist/native/androidProject/app/src/main/res/layout/activity_splash.xml +20 -0
- package/dist/native/androidProject/app/src/main/res/values/strings.xml +1 -1
- package/dist/native/androidProject/app/src/main/res/values/themes.xml +11 -0
- package/dist/native/androidProject/app/src/main/res/values-night/themes.xml +11 -0
- package/dist/native/androidProject/app/src/main/res/xml/network_security_config.xml +12 -0
- package/dist/native/androidProject/app/src/noFcm/java/io/yourname/androidproject/utils/NotificationManager.kt +166 -0
- package/dist/native/androidProject/app/src/noFcm/java/io/yourname/androidproject/utils/PushNotificationUtils.kt +94 -0
- package/dist/native/androidProject/app/src/test/java/io/yourname/androidproject/BridgeMessageValidatorTest.kt +267 -0
- package/dist/native/androidProject/app/src/withFcm/java/io/yourname/androidproject/utils/NotificationManager.kt +224 -0
- package/dist/native/androidProject/app/src/withFcm/java/io/yourname/androidproject/utils/PushNotificationUtils.kt +399 -0
- package/dist/native/androidProject/build.gradle.kts +6 -0
- package/dist/native/androidProject/gradle/libs.versions.toml +3 -1
- package/dist/native/androidProject/settings.gradle.kts +1 -1
- package/dist/native/androidSetup.js +4 -3
- package/dist/native/assets/catalyst.png +0 -0
- package/dist/native/bridge/WebBridge.js +20 -3
- package/dist/native/bridge/constants/NativeInterfaces.js +23 -8
- package/dist/native/bridge/hooks.js +46 -16
- package/dist/native/bridge/safeArea.js +5 -0
- package/dist/native/bridge/standardizedHooks.js +23 -5
- package/dist/native/bridge/useBaseHook.js +1 -2
- package/dist/native/bridge/utils/CameraUtils.js +58 -0
- package/dist/native/bridge/utils/FileObjectConverter.js +40 -0
- package/dist/native/bridge/utils/NativeBridge.js +43 -4
- package/dist/native/buildAppAndroid.js +112 -41
- package/dist/native/buildAppIos.js +288 -26
- package/dist/native/iosnativeWebView/Configurations/Debug.xcconfig +21 -0
- package/dist/native/iosnativeWebView/Configurations/Release.xcconfig +24 -0
- package/dist/native/iosnativeWebView/Configurations/Shared.xcconfig +55 -0
- package/dist/native/iosnativeWebView/Package.resolved +158 -0
- package/dist/native/iosnativeWebView/Package.swift +26 -0
- package/dist/native/iosnativeWebView/Sources/CatalystNotifications/LocalNotificationHandler.swift +293 -0
- package/dist/native/iosnativeWebView/Sources/CatalystNotifications/NotificationManager.swift +299 -0
- package/dist/native/iosnativeWebView/Sources/CatalystNotifications/PushNotificationHandler.swift +199 -0
- package/dist/native/iosnativeWebView/Sources/Core/Constants/CatalystConstants.swift +115 -0
- package/dist/native/iosnativeWebView/Sources/Core/Constants/ConfigConstants.swift +28 -0
- package/dist/native/iosnativeWebView/Sources/Core/Notifications/NotificationModels.swift +156 -0
- package/dist/native/iosnativeWebView/Sources/Core/Protocols/NotificationHandlerProtocol.swift +35 -0
- package/dist/native/iosnativeWebView/Sources/Core/Utils/BootTimingUtility.swift +26 -0
- package/dist/native/iosnativeWebView/{iosnativeWebView → Sources/Core/Utils}/CacheManager.swift +59 -37
- package/dist/native/iosnativeWebView/Sources/Core/Utils/CameraTransportUtils.swift +363 -0
- package/dist/native/iosnativeWebView/Sources/Core/Utils/DeviceInfoUtils.swift +67 -0
- package/dist/native/iosnativeWebView/Sources/Core/Utils/FilePickerHandler.swift +1053 -0
- package/dist/native/iosnativeWebView/Sources/Core/Utils/FrameworkServerUtils.swift +901 -0
- package/dist/native/iosnativeWebView/{iosnativeWebView → Sources/Core/Utils}/ImageHandler.swift +206 -20
- package/dist/native/iosnativeWebView/Sources/Core/Utils/NetworkMonitor.swift +112 -0
- package/dist/native/iosnativeWebView/Sources/Core/Utils/NotificationHandlerProvider.swift +20 -0
- package/dist/native/iosnativeWebView/Sources/Core/Utils/NullNotificationHandler.swift +85 -0
- package/dist/native/iosnativeWebView/{iosnativeWebView → Sources/Core/Utils}/ResourceURLProtocol.swift +60 -25
- package/dist/native/iosnativeWebView/Sources/Core/Utils/SafeAreaUtils.swift +132 -0
- package/dist/native/iosnativeWebView/Sources/Core/Utils/URLWhitelistManager.swift +238 -0
- package/dist/native/iosnativeWebView/Sources/Core/Utils/WebKitConfig.swift +43 -0
- package/dist/native/iosnativeWebView/Sources/Core/WebView/BridgeCommandHandler.swift +644 -0
- package/dist/native/iosnativeWebView/Sources/Core/WebView/BridgeDelegateHandler.swift +166 -0
- package/dist/native/iosnativeWebView/Sources/Core/WebView/BridgeFileHandler.swift +340 -0
- package/dist/native/iosnativeWebView/Sources/Core/WebView/BridgeJavaScriptInterface.swift +149 -0
- package/dist/native/iosnativeWebView/Sources/Core/WebView/BridgeMessageValidator.swift +593 -0
- package/dist/native/iosnativeWebView/Sources/Core/WebView/NativeBridge.swift +326 -0
- package/dist/native/iosnativeWebView/Sources/Core/WebView/SplashView.swift +95 -0
- package/dist/native/iosnativeWebView/Sources/Core/WebView/SplashViewModel.swift +86 -0
- package/dist/native/iosnativeWebView/Sources/Core/WebView/WebView.swift +181 -0
- package/dist/native/iosnativeWebView/Sources/Core/WebView/WebViewModel.swift +182 -0
- package/dist/native/iosnativeWebView/Sources/Core/WebView/WebViewNavigationDelegate.swift +395 -0
- package/dist/native/iosnativeWebView/iosnativeWebView/AppDelegate.swift +71 -0
- package/dist/native/iosnativeWebView/iosnativeWebView/Assets.xcassets/AccentColor.colorset/Contents.json +8 -8
- package/dist/native/iosnativeWebView/iosnativeWebView/Assets.xcassets/AppIcon.appiconset/Contents.json +10 -10
- package/dist/native/iosnativeWebView/iosnativeWebView/Assets.xcassets/Contents.json +4 -4
- package/dist/native/iosnativeWebView/iosnativeWebView/ContentView.swift +65 -10
- package/dist/native/iosnativeWebView/iosnativeWebView/Info-Release.plist +21 -0
- package/dist/native/iosnativeWebView/iosnativeWebView/Info.plist +13 -0
- package/dist/native/iosnativeWebView/iosnativeWebView/Preview Content/Preview Assets.xcassets/Contents.json +4 -4
- package/dist/native/iosnativeWebView/iosnativeWebView/iosnativeWebView.entitlements +8 -0
- package/dist/native/iosnativeWebView/iosnativeWebView/iosnativeWebViewApp.swift +70 -0
- package/dist/native/iosnativeWebView/iosnativeWebView/localhost.p12 +0 -0
- package/dist/native/iosnativeWebView/iosnativeWebView.xcodeproj/project.pbxproj +57 -108
- package/dist/native/iosnativeWebView/iosnativeWebView.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +159 -0
- package/dist/native/renameAndroidProject.js +80 -70
- package/dist/native/setupEmulatorIos.js +22 -5
- package/dist/native/setupServer.js +11 -10
- package/dist/native/terminalProgress.js +10 -10
- package/dist/native/utils.js +4 -5
- package/dist/otel.js +4 -0
- package/dist/scripts/build.js +2 -2
- package/dist/scripts/devBuild.js +2 -2
- package/dist/scripts/scriptUtils.js +2 -2
- package/dist/sentry.js +4 -1
- package/dist/server/renderer/document/Body.js +4 -4
- package/dist/server/renderer/handler.js +7 -5
- package/dist/webpack/development.client.babel.js +1 -1
- package/package.json +5 -3
- package/dist/native/androidProject/.idea/.name +0 -1
- package/dist/native/androidProject/.idea/AndroidProjectSystem.xml +0 -6
- package/dist/native/androidProject/.idea/compiler.xml +0 -6
- package/dist/native/androidProject/.idea/deploymentTargetSelector.xml +0 -10
- package/dist/native/androidProject/.idea/gradle.xml +0 -19
- package/dist/native/androidProject/.idea/migrations.xml +0 -10
- package/dist/native/androidProject/.idea/misc.xml +0 -5
- package/dist/native/androidProject/.idea/runConfigurations.xml +0 -17
- package/dist/native/androidProject/.idea/vcs.xml +0 -6
- package/dist/native/iosnativeWebView/iosnativeWebView/NativeBridge.swift +0 -217
- package/dist/native/iosnativeWebView/iosnativeWebView/WebView.swift +0 -96
- package/dist/native/iosnativeWebView/iosnativeWebView/WebViewModel.swift +0 -47
- package/dist/native/iosnativeWebView/iosnativeWebView/WebViewNavigationDelegate.swift +0 -140
package/README.md
CHANGED
|
@@ -16,7 +16,6 @@ Catalyst offers a comprehensive suite of features designed for modern web develo
|
|
|
16
16
|
|
|
17
17
|
This version adds support for Universal app for both Android and iOS. Please checkout [Universal App Documentaion](https://catalyst.1mg.com/public_docs/content/Universal%20App/RunUniversalApp)
|
|
18
18
|
|
|
19
|
-
|
|
20
19
|
## Installation
|
|
21
20
|
|
|
22
21
|
**System Requirements**
|
package/bin/catalyst.js
CHANGED
|
@@ -8,9 +8,17 @@ const args = process.argv.slice(2)
|
|
|
8
8
|
|
|
9
9
|
// Array of valid commands
|
|
10
10
|
const validCommands = [
|
|
11
|
-
"build",
|
|
12
|
-
"
|
|
13
|
-
"
|
|
11
|
+
"build",
|
|
12
|
+
"start",
|
|
13
|
+
"serve",
|
|
14
|
+
"devBuild",
|
|
15
|
+
"devServe",
|
|
16
|
+
"buildApp",
|
|
17
|
+
"buildApp:ios",
|
|
18
|
+
"buildApp:android",
|
|
19
|
+
"setupEmulator",
|
|
20
|
+
"setupEmulator:ios",
|
|
21
|
+
"setupEmulator:android",
|
|
14
22
|
]
|
|
15
23
|
|
|
16
24
|
// Map of platform-specific commands to their script paths
|
|
@@ -18,17 +26,16 @@ const platformScripts = {
|
|
|
18
26
|
"setupEmulator:ios": "../dist/native/setupEmulatorIos.js",
|
|
19
27
|
"setupEmulator:android": "../dist/native/androidSetup.js",
|
|
20
28
|
"buildApp:ios": "../dist/native/buildAppIos.js",
|
|
21
|
-
"buildApp:android": "../dist/native/buildAppAndroid.js"
|
|
29
|
+
"buildApp:android": "../dist/native/buildAppAndroid.js",
|
|
22
30
|
}
|
|
23
31
|
|
|
24
32
|
// Helper to check if arg is a platform command
|
|
25
33
|
const isPlatformCommand = (arg, prefix) => {
|
|
26
34
|
if (!arg.startsWith(`${prefix}:`)) return false
|
|
27
|
-
const platform = arg.split(
|
|
28
|
-
return [
|
|
35
|
+
const platform = arg.split(":")[1]
|
|
36
|
+
return ["ios", "android"].includes(platform) || platform === undefined
|
|
29
37
|
}
|
|
30
38
|
|
|
31
|
-
|
|
32
39
|
// Helper function to run a platform command
|
|
33
40
|
const runPlatformCommand = (baseCommand, platform) => {
|
|
34
41
|
const command = `${baseCommand}:${platform}`
|
|
@@ -42,7 +49,7 @@ const runPlatformCommand = (baseCommand, platform) => {
|
|
|
42
49
|
|
|
43
50
|
// Helper function to run commands for all platforms
|
|
44
51
|
const runAllPlatforms = (baseCommand) => {
|
|
45
|
-
const platforms = [
|
|
52
|
+
const platforms = ["ios", "android"]
|
|
46
53
|
for (const platform of platforms) {
|
|
47
54
|
const result = runPlatformCommand(baseCommand, platform)
|
|
48
55
|
if (result.status !== 0) {
|
|
@@ -54,8 +61,14 @@ const runAllPlatforms = (baseCommand) => {
|
|
|
54
61
|
}
|
|
55
62
|
|
|
56
63
|
const scriptIndex = args.findIndex(
|
|
57
|
-
(x) =>
|
|
58
|
-
|
|
64
|
+
(x) =>
|
|
65
|
+
x === "build" ||
|
|
66
|
+
x === "start" ||
|
|
67
|
+
x === "serve" ||
|
|
68
|
+
x === "devBuild" ||
|
|
69
|
+
x === "devServe" ||
|
|
70
|
+
isPlatformCommand(x, "buildApp") ||
|
|
71
|
+
isPlatformCommand(x, "setupEmulator")
|
|
59
72
|
)
|
|
60
73
|
const script = scriptIndex === -1 ? args[0] : args[scriptIndex]
|
|
61
74
|
const nodeArgs = scriptIndex > 0 ? args.slice(0, scriptIndex) : []
|
|
@@ -92,17 +105,17 @@ function handleProcessResult(result) {
|
|
|
92
105
|
if (result.signal === "SIGKILL") {
|
|
93
106
|
console.log(
|
|
94
107
|
"The build failed because the process exited too early. " +
|
|
95
|
-
|
|
96
|
-
|
|
108
|
+
"This probably means the system ran out of memory or someone called " +
|
|
109
|
+
"`kill -9` on the process."
|
|
97
110
|
)
|
|
98
111
|
} else if (result.signal === "SIGTERM") {
|
|
99
112
|
console.log(
|
|
100
113
|
"The build failed because the process exited too early. " +
|
|
101
|
-
|
|
102
|
-
|
|
114
|
+
"Someone might have called `kill` or `killall`, or the system could " +
|
|
115
|
+
"be shutting down."
|
|
103
116
|
)
|
|
104
117
|
}
|
|
105
118
|
process.exit(1)
|
|
106
119
|
}
|
|
107
120
|
process.exit(result.status)
|
|
108
|
-
}
|
|
121
|
+
}
|
package/changelog.md
CHANGED
|
@@ -1,40 +1,115 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.0-canary.1] - 2026-01-12
|
|
4
|
+
|
|
5
|
+
- Universal Merge
|
|
6
|
+
|
|
7
|
+
## [0.0.3-canary.20] - 2025-12-12
|
|
8
|
+
|
|
9
|
+
- Patch: Allow localhost traffic to be served from http
|
|
10
|
+
|
|
11
|
+
## [0.0.3-canary.19] - 2025-12-09
|
|
12
|
+
|
|
13
|
+
- Offline fallback support: packages `public/offline.html` into Android/iOS bundles and shows it automatically when connectivity drops (with retry handling)
|
|
14
|
+
- Notification refactor: streamlined config toggle for local vs push, centralized permission/asset handling, and simpler routing into the web app
|
|
15
|
+
- Access control: combined access control config for ios
|
|
16
|
+
|
|
17
|
+
## [0.0.3-canary.18] - 2025-11-19
|
|
18
|
+
|
|
19
|
+
- Configuration Files
|
|
20
|
+
- Android Native WebView - MainActivity.kt
|
|
21
|
+
- Android Native WebView - CustomWebview.kt
|
|
22
|
+
|
|
23
|
+
## [0.0.3-canary.17] - 2025-11-19
|
|
24
|
+
|
|
25
|
+
- ✨ Added complete notification system (local & push)
|
|
26
|
+
- 🔔 New useNotification() React hook
|
|
27
|
+
- 📱 Firebase Cloud Messaging conditional build support
|
|
28
|
+
- 🤖 Android notification handling in MainActivity
|
|
29
|
+
- 🔧 5 new notification commands + 5 callbacks in NativeBridge
|
|
30
|
+
- 📦 Auto-processing of notification icons & sounds
|
|
31
|
+
- ⚙️ Conditional dependencies based on notification config
|
|
32
|
+
- 🧹 Updated .gitignore & .npmignore
|
|
33
|
+
- 📋 Enhanced build process with automatic permission injection
|
|
34
|
+
- 🔗 Deep link integration with notifications
|
|
35
|
+
|
|
36
|
+
## [0.0.3-canary.16] - 2025-11-19
|
|
37
|
+
|
|
38
|
+
- FeaturesGallery Support for File Picker: Enhanced file picker to open native gallery for selecting images and videos
|
|
39
|
+
- HTTPS Framework Server: Enabled HTTPS support for the framework server with self-signed SSL certificate
|
|
40
|
+
- MIME Type Handling: Fixed and improved MIME type detection and handling in the file picker
|
|
41
|
+
|
|
42
|
+
## [0.0.3-canary.15] - 2025-11-19
|
|
43
|
+
|
|
44
|
+
- Adding Android release support and appInfo key
|
|
45
|
+
|
|
46
|
+
## [0.0.3-canary.14] - 2025-09-29
|
|
47
|
+
|
|
48
|
+
- Android custom splashscreen
|
|
49
|
+
|
|
50
|
+
## [0.0.3-canary.13] - 2025-09-28
|
|
51
|
+
|
|
52
|
+
- Multi file support in useFilePicker hook
|
|
53
|
+
- Android multiple app icon support
|
|
54
|
+
- Android whitelisting toggle support
|
|
55
|
+
|
|
56
|
+
## [0.0.3-canary.12] - 2025-09-26
|
|
57
|
+
|
|
58
|
+
- Universal App Context: Added comprehensive context support for building universal mobile applications
|
|
59
|
+
- OpenTelemetry SDK Integration: Built-in support for observability and performance monitoring with Otel SDK
|
|
60
|
+
|
|
61
|
+
## [0.0.3-canary.11] - 2025-09-26
|
|
62
|
+
|
|
63
|
+
- Build organization: Store APKs and iOS builds organized by generation date and time for better tracking and management
|
|
64
|
+
- Enhanced Android native support: Add support for native keyboard and webview resizing in Android
|
|
65
|
+
- Device info API web support: Web support in device info API
|
|
66
|
+
|
|
67
|
+
## [0.0.3-canary.10] - 2025-09-11
|
|
68
|
+
|
|
69
|
+
- **Sentry import bug fix**
|
|
70
|
+
- **Open telemetry SDK**
|
|
71
|
+
|
|
72
|
+
## [0.0.3-canary.9] - 2025-09-11
|
|
73
|
+
|
|
74
|
+
- **App name configuration**
|
|
75
|
+
- **Device Info API**
|
|
76
|
+
- **Access control configuration**
|
|
77
|
+
|
|
3
78
|
## [0.0.3-canary.8] - 2025-01-06
|
|
4
79
|
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
80
|
+
- **App icon configuration**
|
|
81
|
+
- **Splash screen integration**
|
|
82
|
+
- **Url Whitelisting**
|
|
8
83
|
|
|
9
84
|
## [0.0.3-canary.7] - 2025-01-06
|
|
10
85
|
|
|
11
86
|
### 🚀 Features
|
|
12
87
|
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
88
|
+
- **Native API Integration**: Enhanced native module integration for better performance
|
|
89
|
+
- **Automated IP Resolution**: Intelligent network detection eliminates manual IP configuration
|
|
90
|
+
- **Universal Build System**: Streamlined one-command builds for both Android and iOS platforms
|
|
91
|
+
- **Enhanced CLI Interface**: Improved command-line tools for better developer experience
|
|
17
92
|
|
|
18
93
|
### 🐛 Bug Fixes
|
|
19
94
|
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
95
|
+
- Fixed IP address detection issues on development environments
|
|
96
|
+
- Resolved build configuration conflicts between platforms
|
|
97
|
+
- Improved error handling and recovery mechanisms
|
|
23
98
|
|
|
24
99
|
### 🔧 Improvements
|
|
25
100
|
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
101
|
+
- **Performance**: Optimized native module loading and execution
|
|
102
|
+
- **Developer Experience**: Enhanced CLI with better error messages and debugging info
|
|
103
|
+
- **Configuration**: Dynamic config updates without requiring restarts
|
|
104
|
+
- **Build Process**: Faster and more reliable build pipeline
|
|
30
105
|
|
|
31
106
|
### 🧪 Testing & Validation
|
|
32
107
|
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
108
|
+
- ✅ **Android Build**: Verified APK generation, installation, and runtime behavior
|
|
109
|
+
- ✅ **iOS Build**: Tested build process and device compatibility
|
|
110
|
+
- ✅ **IP Detection**: Validated automatic network resolution across platforms
|
|
111
|
+
- ✅ **Native Modules**: Confirmed API integration and performance benchmarks
|
|
112
|
+
- ✅ **CLI Operations**: Tested enhanced command-line workflows and error handling
|
|
38
113
|
|
|
39
114
|
### 🔄 Breaking Changes
|
|
40
115
|
|
|
@@ -42,17 +117,17 @@
|
|
|
42
117
|
|
|
43
118
|
### 📝 Technical Details
|
|
44
119
|
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
120
|
+
- Improved native API bridge for better cross-platform communication
|
|
121
|
+
- Enhanced error reporting with detailed stack traces and suggestions
|
|
122
|
+
- Optimized build configuration for faster development cycles
|
|
123
|
+
- Added comprehensive logging for debugging and monitoring
|
|
49
124
|
|
|
50
125
|
### 🔗 Migration Notes
|
|
51
126
|
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
127
|
+
- No migration steps required
|
|
128
|
+
- Existing projects will automatically benefit from improvements
|
|
129
|
+
- Optional: Update CLI usage to leverage new enhanced features
|
|
55
130
|
|
|
56
131
|
## Version
|
|
57
132
|
|
|
58
|
-
-
|
|
133
|
+
- Target version: 0.0.3-canary.7
|
|
@@ -15,6 +15,22 @@ val keystorePassword: String? by project.properties // Changed from keyStorePas
|
|
|
15
15
|
val keyAlias: String? by project.properties
|
|
16
16
|
val keyPassword: String? by project.properties
|
|
17
17
|
|
|
18
|
+
fun isNotificationsEnabled(): Boolean {
|
|
19
|
+
return try {
|
|
20
|
+
if (configPath == null) return false
|
|
21
|
+
val configFile = File(configPath!!)
|
|
22
|
+
if (!configFile.exists()) return false
|
|
23
|
+
|
|
24
|
+
val json = JSONObject(configFile.readText())
|
|
25
|
+
if (!json.has("WEBVIEW_CONFIG")) return false
|
|
26
|
+
|
|
27
|
+
val webviewConfig = json.getJSONObject("WEBVIEW_CONFIG")
|
|
28
|
+
webviewConfig.optJSONObject("notifications")?.optBoolean("enabled", false) ?: false
|
|
29
|
+
} catch (e: Exception) {
|
|
30
|
+
false
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
18
34
|
fun getLocalIpAddress(): String {
|
|
19
35
|
return NetworkInterface.getNetworkInterfaces().toList()
|
|
20
36
|
.flatMap { it.inetAddresses.toList() }
|
|
@@ -61,7 +77,6 @@ android {
|
|
|
61
77
|
|
|
62
78
|
buildTypes {
|
|
63
79
|
debug {
|
|
64
|
-
manifestPlaceholders += mapOf("allowCleartextTraffic" to true)
|
|
65
80
|
applicationIdSuffix = ".debug"
|
|
66
81
|
versionNameSuffix = "-debug"
|
|
67
82
|
isMinifyEnabled = false
|
|
@@ -69,7 +84,6 @@ android {
|
|
|
69
84
|
buildConfigField("String", "LOCAL_IP", "\"${getLocalIpAddress()}\"")
|
|
70
85
|
}
|
|
71
86
|
release {
|
|
72
|
-
manifestPlaceholders += mapOf("allowCleartextTraffic" to false)
|
|
73
87
|
isMinifyEnabled = true
|
|
74
88
|
isShrinkResources = true
|
|
75
89
|
proguardFiles(
|
|
@@ -129,6 +143,19 @@ android {
|
|
|
129
143
|
checkReleaseBuilds = true
|
|
130
144
|
abortOnError = true
|
|
131
145
|
}
|
|
146
|
+
|
|
147
|
+
// Conditional source sets based on notifications config
|
|
148
|
+
sourceSets {
|
|
149
|
+
getByName("main") {
|
|
150
|
+
if (isNotificationsEnabled()) {
|
|
151
|
+
logger.info("SourceSet selected: withFcm (notifications enabled)")
|
|
152
|
+
java.srcDirs("src/withFcm/java")
|
|
153
|
+
} else {
|
|
154
|
+
logger.info("SourceSet selected: noFcm (notifications disabled)")
|
|
155
|
+
java.srcDirs("src/noFcm/java")
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
132
159
|
}
|
|
133
160
|
|
|
134
161
|
dependencies {
|
|
@@ -139,18 +166,24 @@ dependencies {
|
|
|
139
166
|
testImplementation(libs.junit)
|
|
140
167
|
androidTestImplementation(libs.androidx.junit)
|
|
141
168
|
androidTestImplementation(libs.androidx.espresso.core)
|
|
142
|
-
implementation(
|
|
169
|
+
implementation(libs.androidx.webkit)
|
|
143
170
|
implementation("org.json:json:20231013")
|
|
144
|
-
implementation("androidx.core:core-splashscreen:1.0.1")
|
|
145
171
|
|
|
146
172
|
// Ktor Server dependencies for FrameworkServer (~200KB total)
|
|
147
|
-
implementation("io.ktor:ktor-server-core:
|
|
148
|
-
implementation("io.ktor:ktor-server-netty:
|
|
149
|
-
implementation("io.ktor:ktor-server-content-negotiation:
|
|
173
|
+
implementation("io.ktor:ktor-server-core:3.0.3")
|
|
174
|
+
implementation("io.ktor:ktor-server-netty:3.0.3")
|
|
175
|
+
implementation("io.ktor:ktor-server-content-negotiation:3.0.3")
|
|
150
176
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
|
|
151
|
-
|
|
177
|
+
|
|
152
178
|
// SLF4J simple logger for Ktor (optional, can be excluded if needed)
|
|
153
179
|
implementation("org.slf4j:slf4j-simple:2.0.9")
|
|
180
|
+
|
|
181
|
+
// Notification dependencies - conditional based on config
|
|
182
|
+
if (isNotificationsEnabled()) {
|
|
183
|
+
implementation("androidx.localbroadcastmanager:localbroadcastmanager:1.1.0")
|
|
184
|
+
implementation("com.google.firebase:firebase-messaging:23.4.0")
|
|
185
|
+
implementation("com.google.firebase:firebase-analytics:21.5.0")
|
|
186
|
+
}
|
|
154
187
|
}
|
|
155
188
|
|
|
156
189
|
// Task to verify local IP
|
|
@@ -258,6 +291,49 @@ tasks.register("generateWebViewConfig") {
|
|
|
258
291
|
|
|
259
292
|
extractProperties(webviewConfig)
|
|
260
293
|
|
|
294
|
+
// Extract splash screen configuration with defaults
|
|
295
|
+
if (webviewConfig.has("splashScreen")) {
|
|
296
|
+
val splashConfig = webviewConfig.getJSONObject("splashScreen")
|
|
297
|
+
properties.setProperty("splashScreen.enabled", "true")
|
|
298
|
+
|
|
299
|
+
// Duration in milliseconds
|
|
300
|
+
if (splashConfig.has("duration")) {
|
|
301
|
+
properties.setProperty("splashScreen.duration", splashConfig.get("duration").toString())
|
|
302
|
+
} else {
|
|
303
|
+
properties.setProperty("splashScreen.duration", "1000")
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// Background color
|
|
307
|
+
if (splashConfig.has("backgroundColor")) {
|
|
308
|
+
properties.setProperty("splashScreen.backgroundColor", splashConfig.getString("backgroundColor"))
|
|
309
|
+
} else {
|
|
310
|
+
properties.setProperty("splashScreen.backgroundColor", "#ffffff")
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// Image dimensions
|
|
314
|
+
if (splashConfig.has("imageWidth")) {
|
|
315
|
+
properties.setProperty("splashScreen.imageWidth", splashConfig.get("imageWidth").toString())
|
|
316
|
+
} else {
|
|
317
|
+
properties.setProperty("splashScreen.imageWidth", "120")
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
if (splashConfig.has("imageHeight")) {
|
|
321
|
+
properties.setProperty("splashScreen.imageHeight", splashConfig.get("imageHeight").toString())
|
|
322
|
+
} else {
|
|
323
|
+
properties.setProperty("splashScreen.imageHeight", "120")
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// Corner radius
|
|
327
|
+
if (splashConfig.has("cornerRadius")) {
|
|
328
|
+
properties.setProperty("splashScreen.cornerRadius", splashConfig.get("cornerRadius").toString())
|
|
329
|
+
} else {
|
|
330
|
+
properties.setProperty("splashScreen.cornerRadius", "20")
|
|
331
|
+
}
|
|
332
|
+
} else {
|
|
333
|
+
// No splash screen configuration, disable it
|
|
334
|
+
properties.setProperty("splashScreen.enabled", "false")
|
|
335
|
+
}
|
|
336
|
+
|
|
261
337
|
// Set production-specific properties for release builds
|
|
262
338
|
if (gradle.startParameter.taskNames.any { it.contains("Release") || it.contains("release") }) {
|
|
263
339
|
properties.setProperty("PRODUCTION_URL", "https://yourwebapp.com") // Replace with your domain
|
|
@@ -277,6 +353,10 @@ tasks.register("generateWebViewConfig") {
|
|
|
277
353
|
}
|
|
278
354
|
}
|
|
279
355
|
|
|
356
|
+
if (isNotificationsEnabled()) {
|
|
357
|
+
apply(plugin = "com.google.gms.google-services")
|
|
358
|
+
}
|
|
359
|
+
|
|
280
360
|
// Task to create key store if it doesn't exist
|
|
281
361
|
// Add this task to your build.gradle.kts
|
|
282
362
|
tasks.register("generateKeystore") {
|
|
@@ -292,7 +372,7 @@ tasks.register("generateKeystore") {
|
|
|
292
372
|
val keyPass = project.properties["keyPassword"] as? String ?: System.getenv("KEY_PASSWORD") ?: "android"
|
|
293
373
|
val alias = project.properties["keyAlias"] as? String ?: System.getenv("KEY_ALIAS") ?: "release"
|
|
294
374
|
|
|
295
|
-
exec {
|
|
375
|
+
project.exec {
|
|
296
376
|
commandLine = listOf(
|
|
297
377
|
"keytool",
|
|
298
378
|
"-genkey",
|
|
@@ -321,7 +401,7 @@ tasks.register("createAppBundle") {
|
|
|
321
401
|
=======================================================
|
|
322
402
|
App Bundle created successfully!
|
|
323
403
|
|
|
324
|
-
Location: ${
|
|
404
|
+
Location: ${layout.buildDirectory.get().asFile}/outputs/bundle/release/app-release.aab
|
|
325
405
|
|
|
326
406
|
Next steps:
|
|
327
407
|
1. Test your bundle with:
|
|
@@ -331,4 +411,4 @@ tasks.register("createAppBundle") {
|
|
|
331
411
|
=======================================================
|
|
332
412
|
""".trimIndent())
|
|
333
413
|
}
|
|
334
|
-
}
|
|
414
|
+
}
|
|
@@ -5,17 +5,63 @@
|
|
|
5
5
|
# For more details, see
|
|
6
6
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
7
7
|
|
|
8
|
-
#
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
#
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
8
|
+
# Keep line numbers for debugging
|
|
9
|
+
-keepattributes SourceFile,LineNumberTable
|
|
10
|
+
-renamesourcefileattribute SourceFile
|
|
11
|
+
|
|
12
|
+
# Keep JavaScript interface for WebView
|
|
13
|
+
-keepclassmembers class * {
|
|
14
|
+
@android.webkit.JavascriptInterface <methods>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
# Keep NativeBridge class (JavaScript interface)
|
|
18
|
+
-keep class io.yourname.androidproject.NativeBridge {
|
|
19
|
+
public *;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
# Keep Kotlin coroutines
|
|
23
|
+
-keepnames class kotlinx.coroutines.internal.MainDispatcherFactory {}
|
|
24
|
+
-keepnames class kotlinx.coroutines.CoroutineExceptionHandler {}
|
|
25
|
+
-dontwarn kotlinx.coroutines.**
|
|
26
|
+
|
|
27
|
+
# Keep Ktor
|
|
28
|
+
-keep class io.ktor.** { *; }
|
|
29
|
+
-keepclassmembers class io.ktor.** { volatile <fields>; }
|
|
30
|
+
-dontwarn io.ktor.**
|
|
31
|
+
|
|
32
|
+
# Keep Netty (used by Ktor server)
|
|
33
|
+
-keep class io.netty.** { *; }
|
|
34
|
+
-keepclassmembers class io.netty.** { *; }
|
|
35
|
+
-dontwarn io.netty.**
|
|
36
|
+
|
|
37
|
+
# Suppress warnings for optional Netty dependencies (not needed on Android)
|
|
38
|
+
-dontwarn io.netty.internal.tcnative.**
|
|
39
|
+
-dontwarn org.conscrypt.**
|
|
40
|
+
-dontwarn org.bouncycastle.**
|
|
41
|
+
-dontwarn org.eclipse.jetty.npn.**
|
|
42
|
+
-dontwarn reactor.blockhound.integration.**
|
|
43
|
+
-dontwarn org.apache.log4j.**
|
|
44
|
+
-dontwarn org.apache.logging.log4j.**
|
|
45
|
+
|
|
46
|
+
# Keep WebViewClient overrides
|
|
47
|
+
-keepclassmembers class * extends android.webkit.WebViewClient {
|
|
48
|
+
public void *(android.webkit.WebView, java.lang.String);
|
|
49
|
+
public void *(android.webkit.WebView, java.lang.String, android.graphics.Bitmap);
|
|
50
|
+
public boolean *(android.webkit.WebView, java.lang.String);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
# Keep WebChromeClient overrides
|
|
54
|
+
-keepclassmembers class * extends android.webkit.WebChromeClient {
|
|
55
|
+
public void *(android.webkit.WebView, java.lang.String);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
# Keep data classes used for caching
|
|
59
|
+
-keep class io.yourname.androidproject.WebCacheManager$CacheEntry { *; }
|
|
60
|
+
-keep class io.yourname.androidproject.WebCacheManager$CacheMetadata { *; }
|
|
61
|
+
|
|
62
|
+
# Remove debug logging in release builds
|
|
63
|
+
-assumenosideeffects class android.util.Log {
|
|
64
|
+
public static *** d(...);
|
|
65
|
+
public static *** v(...);
|
|
66
|
+
public static *** i(...);
|
|
67
|
+
}
|
|
@@ -21,11 +21,13 @@
|
|
|
21
21
|
android:roundIcon="@mipmap/ic_launcher_round"
|
|
22
22
|
android:supportsRtl="true"
|
|
23
23
|
android:theme="@style/Theme.AndroidProject"
|
|
24
|
-
android:usesCleartextTraffic="
|
|
24
|
+
android:usesCleartextTraffic="true"
|
|
25
|
+
android:networkSecurityConfig="@xml/network_security_config"
|
|
25
26
|
tools:targetApi="31">
|
|
26
27
|
<activity
|
|
27
|
-
android:name="io.yourname.androidproject.
|
|
28
|
+
android:name="io.yourname.androidproject.SplashActivity"
|
|
28
29
|
android:exported="true"
|
|
30
|
+
android:theme="@style/Theme.AndroidProject.Splash"
|
|
29
31
|
android:screenOrientation="portrait">
|
|
30
32
|
<intent-filter>
|
|
31
33
|
<action android:name="android.intent.action.MAIN" />
|
|
@@ -33,6 +35,11 @@
|
|
|
33
35
|
<category android:name="android.intent.category.LAUNCHER" />
|
|
34
36
|
</intent-filter>
|
|
35
37
|
</activity>
|
|
38
|
+
<activity
|
|
39
|
+
android:name="io.yourname.androidproject.MainActivity"
|
|
40
|
+
android:exported="false"
|
|
41
|
+
android:screenOrientation="portrait">
|
|
42
|
+
</activity>
|
|
36
43
|
<provider
|
|
37
44
|
android:name="androidx.core.content.FileProvider"
|
|
38
45
|
android:authorities="io.yourname.androidproject.fileprovider"
|