refactor(android)!: restructure to standard Capacitor plugin layout
Restructure Android project from nested module layout to standard Capacitor plugin structure following community conventions. Structure Changes: - Move plugin code from android/plugin/ to android/src/main/java/ - Move test app from android/app/ to test-apps/android-test-app/app/ - Remove nested android/plugin module structure - Remove nested android/app test app structure Build Infrastructure: - Add Gradle wrapper files (gradlew, gradlew.bat, gradle/wrapper/) - Transform android/build.gradle from root project to library module - Update android/settings.gradle for standalone plugin builds - Add android/gradle.properties with AndroidX configuration - Add android/consumer-rules.pro for ProGuard rules Configuration Updates: - Add prepare script to package.json for automatic builds on npm install - Update package.json version to 1.0.1 - Update android/build.gradle to properly resolve Capacitor dependencies - Update test-apps/android-test-app/settings.gradle with correct paths - Remove android/variables.gradle (hardcode values in build.gradle) Documentation: - Update BUILDING.md with new structure and build process - Update INTEGRATION_GUIDE.md to reflect standard structure - Update README.md to remove path fix warnings - Add test-apps/BUILD_PROCESS.md documenting test app build flows Test App Configuration: - Fix android-test-app to correctly reference plugin and Capacitor - Remove capacitor-cordova-android-plugins dependency (not needed) - Update capacitor.settings.gradle path verification in fix script BREAKING CHANGE: Plugin now uses standard Capacitor Android structure. Consuming apps must update their capacitor.settings.gradle to reference android/ instead of android/plugin/. This is automatically handled by Capacitor CLI for apps using standard plugin installation.
This commit is contained in:
+154
@@ -0,0 +1,154 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
# =============================================================================
|
||||
# Capacitor Plugin Protection Rules
|
||||
# =============================================================================
|
||||
|
||||
# Keep Capacitor Plugin annotations & your plugin facade
|
||||
-keep class com.getcapacitor.** { *; }
|
||||
-keep @com.getcapacitor.annotation.CapacitorPlugin class * { *; }
|
||||
-keepclassmembers class ** {
|
||||
@com.getcapacitor.annotation.PluginMethod *;
|
||||
}
|
||||
|
||||
# Keep DailyNotification plugin classes
|
||||
-keep class com.timesafari.dailynotification.** { *; }
|
||||
|
||||
# Keep plugin method names and signatures
|
||||
-keepclassmembers class com.timesafari.dailynotification.DailyNotificationPlugin {
|
||||
public *;
|
||||
}
|
||||
|
||||
# Keep all plugin manager classes
|
||||
-keep class com.timesafari.dailynotification.*Manager { *; }
|
||||
-keep class com.timesafari.dailynotification.*Storage { *; }
|
||||
-keep class com.timesafari.dailynotification.*Receiver { *; }
|
||||
|
||||
# Keep Room database classes
|
||||
-keep class com.timesafari.dailynotification.storage.** { *; }
|
||||
-keep class com.timesafari.dailynotification.database.** { *; }
|
||||
|
||||
# Keep error handling classes
|
||||
-keep class com.timesafari.dailynotification.*Error* { *; }
|
||||
-keep class com.timesafari.dailynotification.*Exception* { *; }
|
||||
|
||||
# Keep JWT and ETag managers
|
||||
-keep class com.timesafari.dailynotification.*JWT* { *; }
|
||||
-keep class com.timesafari.dailynotification.*ETag* { *; }
|
||||
|
||||
# Keep performance and optimization classes
|
||||
-keep class com.timesafari.dailynotification.*Performance* { *; }
|
||||
-keep class com.timesafari.dailynotification.*Optimizer* { *; }
|
||||
|
||||
# Keep rolling window and TTL classes
|
||||
-keep class com.timesafari.dailynotification.*Rolling* { *; }
|
||||
-keep class com.timesafari.dailynotification.*TTL* { *; }
|
||||
|
||||
# Keep exact alarm and reboot recovery classes
|
||||
-keep class com.timesafari.dailynotification.*Exact* { *; }
|
||||
-keep class com.timesafari.dailynotification.*Reboot* { *; }
|
||||
-keep class com.timesafari.dailynotification.*Recovery* { *; }
|
||||
|
||||
# Keep enhanced fetcher classes
|
||||
-keep class com.timesafari.dailynotification.*Enhanced* { *; }
|
||||
-keep class com.timesafari.dailynotification.*Fetcher* { *; }
|
||||
|
||||
# Keep migration classes
|
||||
-keep class com.timesafari.dailynotification.*Migration* { *; }
|
||||
|
||||
# Keep channel manager
|
||||
-keep class com.timesafari.dailynotification.ChannelManager { *; }
|
||||
|
||||
# Keep permission manager
|
||||
-keep class com.timesafari.dailynotification.PermissionManager { *; }
|
||||
|
||||
# Keep scheduler classes
|
||||
-keep class com.timesafari.dailynotification.*Scheduler* { *; }
|
||||
|
||||
# =============================================================================
|
||||
# Android System Classes
|
||||
# =============================================================================
|
||||
|
||||
# Keep Android system classes used by the plugin
|
||||
-keep class android.app.AlarmManager { *; }
|
||||
-keep class android.app.NotificationManager { *; }
|
||||
-keep class android.app.NotificationChannel { *; }
|
||||
-keep class android.app.PendingIntent { *; }
|
||||
-keep class androidx.work.WorkManager { *; }
|
||||
-keep class androidx.core.app.NotificationCompat { *; }
|
||||
|
||||
# Keep broadcast receiver classes
|
||||
-keep class android.content.BroadcastReceiver { *; }
|
||||
-keep class android.content.Intent { *; }
|
||||
|
||||
# =============================================================================
|
||||
# Room Database Protection
|
||||
# =============================================================================
|
||||
|
||||
# Keep Room database classes
|
||||
-keep class androidx.room.** { *; }
|
||||
-keep class * extends androidx.room.RoomDatabase { *; }
|
||||
-keep @androidx.room.Entity class * { *; }
|
||||
-keep @androidx.room.Dao class * { *; }
|
||||
|
||||
# Keep Room database migrations
|
||||
-keep class * extends androidx.room.migration.Migration { *; }
|
||||
|
||||
# =============================================================================
|
||||
# Gson Protection (if used)
|
||||
# =============================================================================
|
||||
|
||||
# Keep Gson classes if used for JSON serialization
|
||||
-keep class com.google.gson.** { *; }
|
||||
-keep class * implements com.google.gson.TypeAdapterFactory { *; }
|
||||
-keep class * implements com.google.gson.JsonSerializer { *; }
|
||||
-keep class * implements com.google.gson.JsonDeserializer { *; }
|
||||
|
||||
# =============================================================================
|
||||
# Debugging and Development
|
||||
# =============================================================================
|
||||
|
||||
# Keep debug information for development builds
|
||||
-keepattributes SourceFile,LineNumberTable
|
||||
-keepattributes Signature
|
||||
-keepattributes Exceptions
|
||||
-keepattributes InnerClasses
|
||||
-keepattributes EnclosingMethod
|
||||
|
||||
# Keep generic signatures for reflection
|
||||
-keepattributes Signature
|
||||
|
||||
# Keep annotations
|
||||
-keepattributes *Annotation*
|
||||
|
||||
# =============================================================================
|
||||
# Network and Security
|
||||
# =============================================================================
|
||||
|
||||
# Keep network-related classes
|
||||
-keep class java.net.** { *; }
|
||||
-keep class javax.net.ssl.** { *; }
|
||||
|
||||
# Keep security-related classes
|
||||
-keep class java.security.** { *; }
|
||||
-keep class javax.crypto.** { *; }
|
||||
Reference in New Issue
Block a user