Browse Source

打包Android

warrior 2 months ago
parent
commit
80b8c7dba6

+ 7 - 2
android/app/build.gradle

@@ -19,12 +19,17 @@ android {
     signingConfigs {
         //签名信息
         release {
-            keyAlias System.getenv('KEY_ALIAS') ?: 'my-key-alias'
+            keyAlias System.getenv('KEY_ALIAS') ?: 'heychat'
             keyPassword System.getenv('KEY_PASSWORD') ?: '12345678'
-            storeFile file(System.getenv('KEYSTORE_PATH') ?: '../my-release-key.keystore')
+            storeFile file(System.getenv('KEYSTORE_PATH') ?: '../heychat.keystore')
             storePassword System.getenv('STORE_PASSWORD') ?: '12345678'
         }
     }
+    android.applicationVariants.all(variant ->{
+      variant.outputs.all{
+        outputFileName = "heychat.apk"
+      }
+    })
     buildTypes {
         release {
             minifyEnabled false

BIN
android/heychat.keystore


BIN
android/my-release-key.keystore


+ 14 - 0
android/network_security_config.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+    <domain-config cleartextTrafficPermitted="true">
+        <domain includeSubdomains="true">nova-cloud.obs.cn-south-1.myhuaweicloud.com</domain>
+        <domain includeSubdomains="true">localhost</domain>
+        <domain includeSubdomains="true">*.fmode.cn</domain>
+        <domain includeSubdomains="true">fmode.cn</domain>
+        <domain includeSubdomains="true">server.fmode.cn</domain>
+        <domain includeSubdomains="true">upload-z2.qiniup.com</domain>
+        <domain includeSubdomains="true">*.qiniup.com</domain>
+        <domain includeSubdomains="true">webapi.amap.com</domain>
+        <domain includeSubdomains="true">*.amap.com</domain>
+    </domain-config>
+</network-security-config>

+ 2 - 2
build.android.md

@@ -27,7 +27,7 @@
 # Question:
   - 签名密钥问题
     - 如果你决定创建一个新的 keystore 文件,并使用简单的密钥别名,可以运行以下命令:
-      keytool -genkey -v -keystore my-release-key.keystore -alias release-key -keyalg RSA -keysize 2048 -validity 10000
-    - 查看签名配置信息:keytool -list -v -keystore D:\Desktop\works\nova-live\android\my-release-key.keystore -storepass 12345678
+      keytool -genkey -v -keystore heychat.keystore -alias heychat -keyalg RSA -keysize 2048 -validity 10000
+    - 查看签名配置信息:keytool -list -v -keystore D:\Desktop\works\nova-live\android\heychat.keystore -storepass 12345678
   - angular cli创建的项目不支持ionic命令问题
     - ionic init 生成ionic.config.json

+ 2 - 2
capacitor.config.ts

@@ -7,9 +7,9 @@ const config: CapacitorConfig = {
   android: {
     buildOptions: {
       releaseType: 'APK',
-      keystorePath: './my-release-key.keystore',
+      keystorePath: './heychat.keystore',
       keystorePassword: '12345678',
-      keystoreAlias: 'my-key-alias',
+      keystoreAlias: 'heychat',
       keystoreAliasPassword: '12345678'
     }
   },

+ 9 - 4
config.xml

@@ -1,8 +1,8 @@
 <?xml version='1.0' encoding='utf-8'?>
-<widget id="io.ionic.starter" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
-    <name>MyApp</name>
-    <description>An awesome Ionic/Cordova app.</description>
-    <author email="hi@ionicframework.com" href="http://ionicframework.com/">Ionic Framework Team</author>
+<widget id="com.heychat.live" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+    <name>hey聊</name>
+    <description>hey聊</description>
+    <author email="support@fmode.cn" href="http://heychat.com/">Heychat Inc.</author>
     <content src="index.html" />
     <access origin="*" />
     <allow-intent href="http://*/*" />
@@ -23,6 +23,11 @@
         <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
             <application android:networkSecurityConfig="@xml/network_security_config" />
         </edit-config>
+        <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/uses-permission[@android:name='android.permission.CAMERA']" xmlns:android="http://schemas.android.com/apk/res/android">
+            <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
+            <uses-permission android:name="android.permission.RECORD_AUDIO" />
+            <uses-permission android:name="android.permission.CAMERA" />
+        </edit-config>
         <resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" />
         <allow-intent href="market:*" />
         <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />

BIN
heychat.keystore


BIN
my-release-key.keystore