Skip to content

Commit

Permalink
20240601 update1
Browse files Browse the repository at this point in the history
  • Loading branch information
neko0xff committed Jun 1, 2024
1 parent 3e8ea70 commit 69b21cc
Show file tree
Hide file tree
Showing 14 changed files with 98 additions and 41 deletions.
24 changes: 23 additions & 1 deletion src/demo/viewapp_master/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import java.text.SimpleDateFormat

plugins {
id "com.android.application"
id "kotlin-android"
Expand Down Expand Up @@ -56,6 +58,24 @@ android {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
minifyEnabled true //资源压缩设置

//读取代码压缩配置文件
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

// 自訂輸出檔名
applicationVariants.all { variant ->
variant.outputs.all { output ->
def appName = "com.neko0xff.viewapp_master"
def versionName = variant.versionName
def buildType = variant.buildType.name
def date = new Date()
def formattedDate = new SimpleDateFormat("yyyyMMdd").format(date)
def newApkName = "${appName}_${versionName}_${formattedDate}_${buildType}.apk"

output.outputFileName = newApkName
}
}
}
Expand All @@ -64,4 +84,6 @@ flutter {
source '../..'
}

dependencies {}
dependencies {

}
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:label="viewapp_master"
android:label="viewapp_master_v3"
android:name="${applicationName}"
android:usesCleartextTraffic="true"
android:icon="@mipmap/launcher_icon">
<activity
android:name=".MainActivity"
Expand Down
2 changes: 1 addition & 1 deletion src/demo/viewapp_master/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.7.10'
ext.kotlin_version = '1.8.0'
repositories {
google()
mavenCentral()
Expand Down
3 changes: 2 additions & 1 deletion src/demo/viewapp_master/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
org.gradle.jvmargs=-Xmx4G
android.useAndroidX=true
android.enableJetifier=true
extra-gen-snapshot-options=--obfuscate
extra-gen-snapshot-options=--obfuscate
kotlin.code.style=official
64 changes: 32 additions & 32 deletions src/demo/viewapp_master/lib/pages/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,39 +28,39 @@ class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return DefaultTabController(
length: 5,
child: Scaffold(
appBar: AppBar(
titleSpacing: 0.0,
title: const TabBar(
labelColor: Colors.white,
dividerColor: Colors.white,
labelPadding: EdgeInsets.zero,
tabs: <Widget>[
Tab(icon: Icon(Icons.home), text: "主頁"),
Tab(icon: Icon(Icons.list), text: "資料"),
Tab(icon: Icon(Icons.switch_right_sharp), text: "控制"),
Tab(icon: Icon(Icons.account_balance_outlined), text: "資訊"),
Tab(icon: Icon(Icons.account_box), text: "帳戶管理")
],
length: 5,
child: Scaffold(
appBar: AppBar(
titleSpacing: 0.0,
title: const TabBar(
labelColor: Colors.white,
dividerColor: Colors.white,
labelPadding: EdgeInsets.zero,
tabs: <Widget>[
Tab(icon: Icon(Icons.home), text: "主頁"),
Tab(icon: Icon(Icons.list), text: "資料"),
Tab(icon: Icon(Icons.switch_right_sharp), text: "控制"),
Tab(icon: Icon(Icons.account_balance_outlined), text: "資訊"),
Tab(icon: Icon(Icons.account_box), text: "帳戶管理")
],
),
),
body: TabBarView(
children: <Widget>[
Main(),
ViewData(),
Control(),
NewsData(),
AccountData()
],
),
drawer: DrawerMenu(
key: null,
username: username,
LoginName: LoginName,
serverSource: serverSource,
),
),
),
body: TabBarView(
children: <Widget>[
Main(),
ViewData(),
Control(),
NewsData(),
AccountData()
],
),
drawer: DrawerMenu(
key: null,
username: username,
LoginName: LoginName,
serverSource: serverSource,
),
),
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/demo/viewapp_master/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ packages:
source: sdk
version: "0.0.0"
flutter_web_plugins:
dependency: transitive
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
Expand Down
2 changes: 2 additions & 0 deletions src/demo/viewapp_master/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ environment:
dependencies:
flutter:
sdk: flutter
flutter_web_plugins:
sdk: flutter

dependency_overrides:
web: ^0.5.1
Expand Down
24 changes: 23 additions & 1 deletion src/demo/viewapp_user/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import java.text.SimpleDateFormat

plugins {
id "com.android.application"
id "kotlin-android"
Expand Down Expand Up @@ -56,6 +58,24 @@ android {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
minifyEnabled true //资源压缩设置

//读取代码压缩配置文件
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

// 自訂輸出檔名
applicationVariants.all { variant ->
variant.outputs.all { output ->
def appName = "com.neko0xff.viewapp_user"
def versionName = variant.versionName
def buildType = variant.buildType.name
def date = new Date()
def formattedDate = new SimpleDateFormat("yyyyMMdd").format(date)
def newApkName = "${appName}_${versionName}_${formattedDate}_${buildType}.apk"

output.outputFileName = newApkName
}
}
}
Expand All @@ -64,4 +84,6 @@ flutter {
source '../..'
}

dependencies {}
dependencies {

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
</manifest>
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:label="viewapp_user"
android:label="viewapp_user_v3"
android:name="${applicationName}"
android:usesCleartextTraffic="true"
android:icon="@mipmap/launcher_icon">
<activity
android:name=".MainActivity"
Expand Down
2 changes: 1 addition & 1 deletion src/demo/viewapp_user/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.7.10'
ext.kotlin_version = '1.8.0'
repositories {
google()
mavenCentral()
Expand Down
1 change: 1 addition & 0 deletions src/demo/viewapp_user/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ org.gradle.jvmargs=-Xmx4G
android.useAndroidX=true
android.enableJetifier=true
extra-gen-snapshot-options=--obfuscate
kotlin.code.style=official
2 changes: 1 addition & 1 deletion src/demo/viewapp_user/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ packages:
source: sdk
version: "0.0.0"
flutter_web_plugins:
dependency: transitive
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
Expand Down
2 changes: 2 additions & 0 deletions src/demo/viewapp_user/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ environment:
dependencies:
flutter:
sdk: flutter
flutter_web_plugins:
sdk: flutter

dependency_overrides:
web: ^0.5.1
Expand Down

0 comments on commit 69b21cc

Please sign in to comment.