Skip to content

Commit

Permalink
build: 构建安卓
Browse files Browse the repository at this point in the history
  • Loading branch information
xie392 committed Jun 3, 2024
1 parent 13812ae commit b33cf06
Show file tree
Hide file tree
Showing 77 changed files with 197 additions and 394 deletions.
Binary file added android/app/COSS_KEYS
Binary file not shown.
39 changes: 38 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,45 @@ android {
// Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
}
signingConfigs {
// release {
// storeFile file('release.keystore')
// storePassword 'release'
// keyAlias 'release'
// keyPassword 'release'
// }
debug {
storeFile file('COSS_KEYS')
storePassword 'hitosea.coss'
keyPassword 'hitosea.coss'
keyAlias 'hitosea_coss'
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
//警告!在生产中,您需要生成自己的密钥库文件。
// signingConfig signingConfigs.release
// shrinkResources false
// proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}

android.applicationVariants.all {
variant -> variant.outputs.all { output ->
def date = new Date().format("yyyyMMddHHmmss",
TimeZone.getTimeZone("GMT+08"))
if (variant.buildType.name == 'debug') {
output.outputFileName = "coss_" +
"${android.defaultConfig.versionName}_${date}_debug.apk"
}else if (variant.buildType.name == 'release'){
output.outputFileName = "coss_" +
"${android.defaultConfig.versionName}_${date}_release.apk"
}
}
}
}

repositories {
Expand All @@ -40,6 +72,11 @@ dependencies {
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
implementation project(':capacitor-cordova-android-plugins')

// 以下依赖都需要添加
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'commons-codec:commons-codec:1.6'
implementation 'androidx.annotation:annotation:1.1.0'
}

apply from: 'capacitor.build.gradle'
Expand Down
Binary file added android/app/release.keystore
Binary file not shown.
39 changes: 34 additions & 5 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<!-- <uses-sdk android:minSdkVersion="22"/>-->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<!-- &lt;!&ndash; 连接网络权限 &ndash;&gt;-->
<!-- <uses-permission android:name="android.permission.INTERNET"/>-->
<!-- &lt;!&ndash; 读取网络信息状态 &ndash;&gt;-->
<!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>-->
<!-- &lt;!&ndash; 获取当前wifi状态 &ndash;&gt;-->
<!-- <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>-->
<!-- &lt;!&ndash; 允许程序改变网络连接状态 &ndash;&gt;-->
<!-- <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>-->
<!-- 读取手机信息权限 -->
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<!-- 外存储读权限 -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />
<!-- 录制音频 -->
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<!-- 修改音频设置 -->
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<!-- 相机 -->
<uses-feature android:name="android.hardware.camera" />
<!-- 相机拍照 -->
<uses-feature android:name="android.hardware.IMAGE_CAPTURE" />
<!-- 相机录像 -->
<uses-permission android:name="android.permission.CAMERA" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
Expand All @@ -15,7 +45,8 @@
android:label="@string/title_activity_main"
android:theme="@style/AppTheme.NoActionBarLaunch"
android:launchMode="singleTask"
android:exported="true">
android:exported="true"
android:windowSoftInputMode="adjustNothing">

<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -31,11 +62,9 @@
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths"></meta-data>
android:resource="@xml/file_paths" />
</provider>
</application>

<!-- Permissions -->

<uses-permission android:name="android.permission.INTERNET" />
</manifest>
</manifest>
7 changes: 0 additions & 7 deletions android/app/src/main/assets/public/css/.pnpm-BjDruDbT.css

This file was deleted.

1 change: 0 additions & 1 deletion android/app/src/main/assets/public/css/_id_-BzEb2zE4.css

This file was deleted.

Loading

0 comments on commit b33cf06

Please sign in to comment.