Skip to content

Commit

Permalink
Merge pull request #10 from geeker-ai/android-sign
Browse files Browse the repository at this point in the history
Android sign
  • Loading branch information
zmhu committed Oct 4, 2023
2 parents 89454f7 + 69d6449 commit a1506d8
Show file tree
Hide file tree
Showing 49 changed files with 132 additions and 96 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,15 @@ jobs:
CHANNEL: "site"
SYSTEM_OS_NAME: "macos"
VERSION: "${{ steps.get_version.outputs.version-without-v }}"
ANDROID_KEY_STORE_PASSWORD: ${{ secrets.ANDROID_KEY_STORE_PASSWORD }}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
ANDROID_SIGN_KEY: ${{ secrets.ANDROID_SIGN_KEY }}
ANDROID_SIGN: true
ANDROID_KEY_PATH: key.jks
run: |
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
echo $ANDROID_SIGN_KEY | base64 -d > android/app/key.jks
make change-channel
flutter_distributor release --name macos --skip-clean
flutter_distributor release --name android --skip-clean
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ python script/deploy.py
- https://codewithandrea.com/articles/flutter-responsive-layouts-split-view-drawer-navigation/
- https://flutterawesome.com/
- [Other Plugins](https://github.com/jahnli/awesome-flutter-plugins)
- https://summerscar.me/2020/11/06/flutter-%E9%A1%B9%E7%9B%AE%E4%BD%BF%E7%94%A8-github-actions/

[Flutter cli](https://flutter.cn/docs/reference/flutter-cli)

Expand Down
19 changes: 18 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

def keystoreProperties = new Properties()
if (System.getenv('ANDROID_SIGN')) {
keystoreProperties.setProperty('storePassword', System.getenv('ANDROID_KEY_STORE_PASSWORD'))
keystoreProperties.setProperty('keyPassword', System.getenv('ANDROID_KEY_PASSWORD'))
keystoreProperties.setProperty('keyAlias', System.getenv('ANDROID_KEY_ALIAS'))
keystoreProperties.setProperty('storeFile', System.getenv('ANDROID_KEY_PATH'))
}

android {
namespace "com.macgeeker.geek_chat"
compileSdkVersion flutter.compileSdkVersion
Expand Down Expand Up @@ -51,11 +59,20 @@ android {
versionName flutterVersionName
}

signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}

buildTypes {
release {
// 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
signingConfig signingConfigs.release
}
}
}
Expand Down
Binary file modified android/app/src/main/res/mipmap-hdpi/launcher_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/launcher_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/launcher_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/launcher_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/launcher_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
4 changes: 3 additions & 1 deletion lib/components/chat/chat_list_menu_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ class ChatListMenuItemComponent extends StatelessWidget {
bool isSelected = currentSession?.sid == session.sid ? true : false;
return PopupMenuItem(
padding: const EdgeInsets.all(0),
height: 42,
// value: session.sid,
child: ListTile(
minVerticalPadding: 0,
visualDensity: const VisualDensity(horizontal: -2, vertical: -3),
contentPadding:
const EdgeInsets.only(right: 2, left: 18, top: 0, bottom: 0),
const EdgeInsets.only(right: 2, left: 16, top: 0, bottom: 0),
title: buildMenuItem(context, isSelected, onDelete),
selectedTileColor: const Color.fromARGB(50, 84, 77, 77),
leading: const Icon(Icons.chat_bubble_outline),
Expand Down
2 changes: 1 addition & 1 deletion lib/components/desktop_main_right_component.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DeskTopMainRightComponent extends StatelessWidget {
scrollButtonListener();
});
scrollButtonListener();
questionInputFocus.requestFocus();
// questionInputFocus.requestFocus();
});
}

Expand Down
188 changes: 97 additions & 91 deletions lib/pages/desktop_home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,101 +25,107 @@ class DesktopHomePage extends StatelessWidget {

@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(top: 4, left: 8, bottom: 10),
child: Row(
children: [
SizedBox(
width: 240,
child: Column(
children: [
SizedBox(
height: 40,
width: double.infinity,
child: OutlinedButton.icon(
style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(3))),
onPressed: () {
Get.toNamed('/editchat',
parameters: {'opt': 'new', 'sid': ''});
},
label: const Text("New Chat"),
icon: const Icon(Icons.add),
),
),
const SizedBox(
height: 5,
),
Expanded(
child: GetBuilder<ChatListController>(builder: (controller) {
return ListView.builder(
itemCount: controller.sessions.length,
controller: ScrollController(),
itemBuilder: (BuildContext ctxt, int index) {
return ChatListMenuItemComponent(
session: controller.sessions.elementAt(index),
onTap: (String sid) {
controller.switchSession(sid);
controller.update();
},
currentSession: controller.currentSession,
onDelete: (SessionModel session) {
chatMessageController
.cleanSessionMessages(session.sid);
controller.remove(session);
controller.reloadSessions();
controller.update();
});
});
}),
),
const Padding(
padding: EdgeInsets.only(left: 5, right: 10),
child: Divider(),
),
SizedBox(
width: double.infinity,
child: Column(children: [
LeftMenuButtonComponent(
title: "Settings".tr,
onPressed: () {
Get.toNamed("/dsettings");
},
icon: Icons.settings,
),
LeftMenuButtonComponent(
title:
"${'About'.tr}(v${settingsController.packageInfo.version})",
return Scaffold(
appBar: AppBar(
toolbarHeight: 0,
),
body: Padding(
padding: const EdgeInsets.only(top: 4, left: 8, bottom: 10),
child: Row(
children: [
SizedBox(
width: 240,
child: Column(
children: [
SizedBox(
height: 40,
width: double.infinity,
child: OutlinedButton.icon(
style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(3))),
onPressed: () {
Get.toNamed("/about");
// Get.snackbar(
// 'Sorry!'.tr,
// 'This feature will coming soon!'.tr,
// duration: const Duration(seconds: 2),
// snackPosition: SnackPosition.TOP,
// );
Get.toNamed('/editchat',
parameters: {'opt': 'new', 'sid': ''});
},
icon: Icons.info_outline,
label: const Text("New Chat"),
icon: const Icon(Icons.add),
),
]),
),
],
),
const SizedBox(
height: 5,
),
Expanded(
child:
GetBuilder<ChatListController>(builder: (controller) {
return ListView.builder(
itemCount: controller.sessions.length,
controller: ScrollController(),
itemBuilder: (BuildContext ctxt, int index) {
return ChatListMenuItemComponent(
session: controller.sessions.elementAt(index),
onTap: (String sid) {
controller.switchSession(sid);
controller.update();
},
currentSession: controller.currentSession,
onDelete: (SessionModel session) {
chatMessageController
.cleanSessionMessages(session.sid);
controller.remove(session);
controller.reloadSessions();
controller.update();
});
});
}),
),
const Padding(
padding: EdgeInsets.only(left: 5, right: 10),
child: Divider(),
),
SizedBox(
width: double.infinity,
child: Column(children: [
LeftMenuButtonComponent(
title: "Settings".tr,
onPressed: () {
Get.toNamed("/dsettings");
},
icon: Icons.settings,
),
LeftMenuButtonComponent(
title:
"${'About'.tr}(v${settingsController.packageInfo.version})",
onPressed: () {
Get.toNamed("/about");
// Get.snackbar(
// 'Sorry!'.tr,
// 'This feature will coming soon!'.tr,
// duration: const Duration(seconds: 2),
// snackPosition: SnackPosition.TOP,
// );
},
icon: Icons.info_outline,
),
]),
),
],
),
),
Container(
width: 0.5,
// color: Colors.black,
),
),
Container(
width: 0.5,
// color: Colors.black,
),
Expanded(
child: GetBuilder<ChatListController>(builder: (controller) {
return chatListController.currentSessionId.isEmpty
? const Text("Error!")
: DeskTopMainRightComponent(
sid: chatListController.currentSession.sid);
}),
)
],
Expanded(
child: GetBuilder<ChatListController>(builder: (controller) {
return chatListController.currentSessionId.isEmpty
? const Text("Error!")
: DeskTopMainRightComponent(
sid: chatListController.currentSession.sid);
}),
)
],
),
),
);
}
Expand Down
5 changes: 4 additions & 1 deletion lib/util/functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ DeviceType getDeviceType() {
return DeviceType.wide;
}

// TODO 折叠屏设备? iPad等设备
// Pixel fold
if (size.width > 1500 && size.height > 2000) {
return DeviceType.wide;
}
if (width > 1000.0 && height > 700.0) {
return DeviceType.wide;
}
Expand Down
Binary file modified macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
Binary file modified macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
Binary file modified macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
Binary file modified macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
Binary file modified macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
Binary file modified macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 0.0.1+1
version: 0.0.45+1

environment:
sdk: ">=3.1.0 <4.0.0"
Expand Down
Binary file modified web/favicon.png
Binary file modified web/icons/Icon-192.png
Binary file modified web/icons/Icon-512.png
Binary file modified web/icons/Icon-maskable-192.png
Binary file modified web/icons/Icon-maskable-512.png
Binary file modified windows/runner/resources/app_icon.ico
Binary file not shown.

0 comments on commit a1506d8

Please sign in to comment.