mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +08:00
mod: add buildconfig
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
2
.github/workflows/ios.yml
vendored
2
.github/workflows/ios.yml
vendored
@@ -28,6 +28,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Build iOS
|
- name: Build iOS
|
||||||
run: |
|
run: |
|
||||||
|
chmod +x lib/scripts/build.sh
|
||||||
|
lib/scripts/build.sh
|
||||||
flutter build ios --release --no-codesign
|
flutter build ios --release --no-codesign
|
||||||
ln -sf ./build/ios/iphoneos Payload
|
ln -sf ./build/ios/iphoneos Payload
|
||||||
zip -r9 ios-release-no-sign.ipa Payload/runner.app
|
zip -r9 ios-release-no-sign.ipa Payload/runner.app
|
||||||
|
|||||||
5
.github/workflows/main.yml
vendored
5
.github/workflows/main.yml
vendored
@@ -45,7 +45,10 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
- name: flutter build apk
|
- name: flutter build apk
|
||||||
run: flutter build apk --release --split-per-abi
|
run: |
|
||||||
|
chmod +x lib/scripts/build.sh
|
||||||
|
lib/scripts/build.sh
|
||||||
|
flutter build apk --release --split-per-abi
|
||||||
|
|
||||||
- name: 上传
|
- name: 上传
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -134,3 +134,5 @@ app.*.symbols
|
|||||||
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
|
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
|
||||||
!/dev/ci/**/Gemfile.lock
|
!/dev/ci/**/Gemfile.lock
|
||||||
!.vscode/settings.json
|
!.vscode/settings.json
|
||||||
|
|
||||||
|
/lib/build_config.dart
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:PiliPalaX/build_config.dart';
|
||||||
import 'package:PiliPalaX/utils/cache_manage.dart';
|
import 'package:PiliPalaX/utils/cache_manage.dart';
|
||||||
import 'package:flex_seed_scheme/flex_seed_scheme.dart';
|
import 'package:flex_seed_scheme/flex_seed_scheme.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
@@ -58,6 +59,9 @@ void main() async {
|
|||||||
SmartDialog.config.loading =
|
SmartDialog.config.loading =
|
||||||
SmartConfigLoading(backType: SmartBackType.normal);
|
SmartConfigLoading(backType: SmartBackType.normal);
|
||||||
// 异常捕获 logo记录
|
// 异常捕获 logo记录
|
||||||
|
final String buildConfig = '''
|
||||||
|
Commit Hash: ${BuildConfig.commitHash}
|
||||||
|
Build Time: ${BuildConfig.buildTime}''';
|
||||||
final Catcher2Options debugConfig = Catcher2Options(
|
final Catcher2Options debugConfig = Catcher2Options(
|
||||||
SilentReportMode(),
|
SilentReportMode(),
|
||||||
[
|
[
|
||||||
@@ -65,13 +69,25 @@ void main() async {
|
|||||||
ConsoleHandler(
|
ConsoleHandler(
|
||||||
enableDeviceParameters: false,
|
enableDeviceParameters: false,
|
||||||
enableApplicationParameters: false,
|
enableApplicationParameters: false,
|
||||||
|
enableCustomParameters: true,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
customParameters: {
|
||||||
|
'BuildConfig': buildConfig,
|
||||||
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
final Catcher2Options releaseConfig = Catcher2Options(
|
final Catcher2Options releaseConfig = Catcher2Options(
|
||||||
SilentReportMode(),
|
SilentReportMode(),
|
||||||
[FileHandler(await getLogsPath())],
|
[
|
||||||
|
FileHandler(await getLogsPath()),
|
||||||
|
ConsoleHandler(
|
||||||
|
enableCustomParameters: true,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
customParameters: {
|
||||||
|
'BuildConfig': buildConfig,
|
||||||
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
Catcher2(
|
Catcher2(
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:PiliPalaX/build_config.dart';
|
||||||
import 'package:PiliPalaX/http/constants.dart';
|
import 'package:PiliPalaX/http/constants.dart';
|
||||||
import 'package:PiliPalaX/services/loggeer.dart';
|
import 'package:PiliPalaX/services/loggeer.dart';
|
||||||
import 'package:cookie_jar/cookie_jar.dart';
|
import 'package:cookie_jar/cookie_jar.dart';
|
||||||
@@ -90,6 +91,17 @@ class _AboutPageState extends State<AboutPage> {
|
|||||||
style: subTitleStyle),
|
style: subTitleStyle),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
ListTile(
|
||||||
|
title: Text(
|
||||||
|
'''
|
||||||
|
Commit Hash: ${BuildConfig.commitHash}
|
||||||
|
Build Time: ${BuildConfig.buildTime}''',
|
||||||
|
style: TextStyle(fontSize: 14),
|
||||||
|
),
|
||||||
|
leading: const Icon(Icons.info_outline),
|
||||||
|
onTap: () => Utils.launchURL(
|
||||||
|
'https://github.com/bggRGjQaUbCoE/PiliPalaX/commit/${BuildConfig.commitHash}'),
|
||||||
|
),
|
||||||
// Obx(
|
// Obx(
|
||||||
// () => ListTile(
|
// () => ListTile(
|
||||||
// onTap: () => _aboutController.onUpdate(),
|
// onTap: () => _aboutController.onUpdate(),
|
||||||
|
|||||||
@@ -1 +1,16 @@
|
|||||||
flutter build apk --target-platform android-arm64 --split-per-abi
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
|
build_time=$(date -u -v+8H +"%Y-%m-%d %H:%M:%S")
|
||||||
|
else
|
||||||
|
build_time=$(date -u +"%Y-%m-%d %H:%M:%S" -d "+8 hours")
|
||||||
|
fi
|
||||||
|
|
||||||
|
commit_hash=$(git rev-parse HEAD)
|
||||||
|
|
||||||
|
cat <<EOL > lib/build_config.dart
|
||||||
|
class BuildConfig {
|
||||||
|
static const String buildTime = '$build_time';
|
||||||
|
static const String commitHash = '$commit_hash';
|
||||||
|
}
|
||||||
|
EOL
|
||||||
|
|||||||
Reference in New Issue
Block a user