Browse Source

ComPDFKit(flutter) - android 新增签名配置

liuxiaolong 1 year ago
parent
commit
4d80059268

+ 18 - 1
example/android/app/build.gradle

@@ -29,7 +29,23 @@ android {
     namespace "com.compdfkit.flutter.example"
     compileSdkVersion 33
     ndkVersion flutter.ndkVersion
+    signingConfigs {
+        release {
+            if (project.hasProperty("Keystore.properties")) {
+                String filePath = project.property("Keystore.properties")
+                File propsFile = new File(filePath)
+                if (propsFile.exists()) {
+                    Properties props = new Properties()
+                    props.load(propsFile.newDataInputStream())
 
+                    storeFile file(props['keystore'])
+                    storePassword props['keystore.password']
+                    keyAlias props['keyAlias']
+                    keyPassword props['keyAlias.password']
+                }
+            }
+        }
+    }
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_8
         targetCompatibility JavaVersion.VERSION_1_8
@@ -45,7 +61,8 @@ android {
 
     buildTypes {
         release {
-            signingConfig signingConfigs.debug
+            signingConfig signingConfigs.release
+            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
         }
     }
 }

+ 24 - 0
example/android/app/proguard-rules.pro

@@ -0,0 +1,24 @@
+# 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
+-keep class com.compdfkit.ui.** {*;}
+-keep class com.compdfkit.core.** {*;}
+-keep class com.compdfkit.tools.** {*;}

+ 2 - 2
example/ios/Podfile

@@ -30,8 +30,8 @@ flutter_ios_podfile_setup
 target 'Runner' do
   use_modular_headers!
   flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
-  pod 'ComPDFKit_Tools', podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/latest.podspec'
-  pod 'ComPDFKit', podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/latest.podspec'
+  pod 'ComPDFKit_Tools', podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/1.9.0.podspec'
+  pod 'ComPDFKit', podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/1.9.0.podspec'
 
   target 'RunnerTests' do
     inherit! :search_paths

+ 5 - 5
example/ios/Podfile.lock

@@ -10,19 +10,19 @@ PODS:
     - Flutter
 
 DEPENDENCIES:
-  - ComPDFKit (from `https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/latest.podspec`)
+  - ComPDFKit (from `https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/1.9.0.podspec`)
   - compdfkit_flutter (from `.symlinks/plugins/compdfkit_flutter/ios`)
-  - ComPDFKit_Tools (from `https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/latest.podspec`)
+  - ComPDFKit_Tools (from `https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/1.9.0.podspec`)
   - Flutter (from `Flutter`)
   - integration_test (from `.symlinks/plugins/integration_test/ios`)
 
 EXTERNAL SOURCES:
   ComPDFKit:
-    :podspec: https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/latest.podspec
+    :podspec: https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/1.9.0.podspec
   compdfkit_flutter:
     :path: ".symlinks/plugins/compdfkit_flutter/ios"
   ComPDFKit_Tools:
-    :podspec: https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/latest.podspec
+    :podspec: https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/1.9.0.podspec
   Flutter:
     :path: Flutter
   integration_test:
@@ -35,6 +35,6 @@ SPEC CHECKSUMS:
   Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
   integration_test: 13825b8a9334a850581300559b8839134b124670
 
-PODFILE CHECKSUM: 5fb088340c7c09c37440352774d5c8263648ec4a
+PODFILE CHECKSUM: e95f5f2b1feed08b894cc8d3eb65b723ea4a3b01
 
 COCOAPODS: 1.11.3