mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-30 07:15:51 +08:00
mod: 分离为PiliPalaX,修改更新逻辑与CI.yml
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import 'package:pilipala/http/constants.dart';
|
||||
import 'package:pilipala/http/init.dart';
|
||||
import 'package:PiliPalaX/http/constants.dart';
|
||||
import 'package:PiliPalaX/http/init.dart';
|
||||
import 'package:webview_cookie_manager/webview_cookie_manager.dart';
|
||||
|
||||
class SetCookie {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/http/user.dart';
|
||||
import 'package:PiliPalaX/http/user.dart';
|
||||
|
||||
import 'storage.dart';
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@ import 'dart:math';
|
||||
import 'package:crypto/crypto.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:pilipala/pages/dynamics/index.dart';
|
||||
import 'package:pilipala/pages/home/index.dart';
|
||||
import 'package:pilipala/pages/media/index.dart';
|
||||
import 'package:pilipala/pages/mine/index.dart';
|
||||
import 'package:PiliPalaX/pages/dynamics/index.dart';
|
||||
import 'package:PiliPalaX/pages/home/index.dart';
|
||||
import 'package:PiliPalaX/pages/media/index.dart';
|
||||
import 'package:PiliPalaX/pages/mine/index.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
class LoginUtils {
|
||||
|
||||
@@ -3,9 +3,9 @@ import 'dart:io';
|
||||
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:pilipala/models/model_owner.dart';
|
||||
import 'package:pilipala/models/search/hot.dart';
|
||||
import 'package:pilipala/models/user/info.dart';
|
||||
import 'package:PiliPalaX/models/model_owner.dart';
|
||||
import 'package:PiliPalaX/models/search/hot.dart';
|
||||
import 'package:PiliPalaX/models/user/info.dart';
|
||||
|
||||
class GStrorage {
|
||||
static late final Box<dynamic> userInfo;
|
||||
|
||||
@@ -216,27 +216,16 @@ class Utils {
|
||||
|
||||
// 版本对比
|
||||
static bool needUpdate(localVersion, remoteVersion) {
|
||||
List<String> localVersionList = localVersion.split('.');
|
||||
List<String> remoteVersionList = remoteVersion.split('v')[1].split('.');
|
||||
for (int i = 0; i < localVersionList.length; i++) {
|
||||
int localVersion = int.parse(localVersionList[i]);
|
||||
int remoteVersion = int.parse(remoteVersionList[i]);
|
||||
if (remoteVersion > localVersion) {
|
||||
return true;
|
||||
} else if (remoteVersion < localVersion) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return localVersion != remoteVersion;
|
||||
}
|
||||
|
||||
// 检查更新
|
||||
static Future<bool> checkUpdata() async {
|
||||
static Future<bool> checkUpdate() async {
|
||||
SmartDialog.dismiss();
|
||||
var currentInfo = await PackageInfo.fromPlatform();
|
||||
var result = await Request().get(Api.latestApp, extra: {'ua': 'mob'});
|
||||
LatestDataModel data = LatestDataModel.fromJson(result.data);
|
||||
bool isUpdate = Utils.needUpdate(currentInfo.version, data.tagName!);
|
||||
LatestDataModel data = LatestDataModel.fromJson(result.data[0]);
|
||||
bool isUpdate = Utils.needUpdate("v${currentInfo.version}+${currentInfo.buildNumber}", data.tagName!);
|
||||
if (isUpdate) {
|
||||
SmartDialog.show(
|
||||
animationType: SmartAnimationType.centerFade_otherSlide,
|
||||
@@ -270,16 +259,6 @@ class Utils {
|
||||
TextStyle(color: Theme.of(context).colorScheme.outline),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
await SmartDialog.dismiss();
|
||||
launchUrl(
|
||||
Uri.parse('https://www.123pan.com/s/9sVqVv-flu0A.html'),
|
||||
mode: LaunchMode.externalApplication,
|
||||
);
|
||||
},
|
||||
child: const Text('网盘'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => matchVersion(data),
|
||||
child: const Text('Github'),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:pilipala/models/video/play/url.dart';
|
||||
import 'package:PiliPalaX/models/video/play/url.dart';
|
||||
|
||||
class VideoUtils {
|
||||
static String getCdnUrl(dynamic item) {
|
||||
|
||||
Reference in New Issue
Block a user