Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Commit

Permalink
Add icon
Browse files Browse the repository at this point in the history
  • Loading branch information
250king committed Apr 21, 2023
1 parent 092fc7e commit 0d881f0
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 16 deletions.
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher.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/ic_launcher.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/ic_launcher.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/ic_launcher.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/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ buildscript {
ext.kotlin_version = '1.7.10'
repositories {
maven {
url 'https://repo.huaweicloud.com/repository/maven/'
url 'https://maven.aliyun.com/repository/public/'
}
maven {
url 'https://maven.aliyun.com/nexus/content/repositories/google'
url 'https://maven.aliyun.com/repository/google/'
}
}

Expand All @@ -18,10 +18,10 @@ buildscript {
allprojects {
repositories {
maven {
url 'https://repo.huaweicloud.com/repository/maven/'
url 'https://maven.aliyun.com/repository/public/'
}
maven {
url 'https://maven.aliyun.com/nexus/content/repositories/google'
url 'https://maven.aliyun.com/repository/google/'
}
}
}
Expand Down
24 changes: 14 additions & 10 deletions lib/activity/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import 'package:need_resume/need_resume.dart';
import 'package:kirafan_launcher/base/data.dart';
import 'package:kirafan_launcher/base/file.dart';
import 'package:kirafan_launcher/components/button.dart';
import 'package:kirafan_launcher/components/dialog/background.dart';
import 'package:kirafan_launcher/activity/config.dart';

final data = Data.preferences;
Expand Down Expand Up @@ -71,7 +72,7 @@ class HomeActivityState extends ResumableState<HomeActivity> {
text: version.isEmpty? "安装应用": "应用已安装(v$version)",
action: () {
if (version.isEmpty) {
const url = "https://kirafan-asset-cn-shenzhen.oss-cn-shenzhen.aliyuncs.com/apk/%E3%81%8D%E3%82%89%E3%82%89%E3%83%95%E3%82%A1%E3%83%B3%E3%82%BF%E3%82%B8%E3%82%A2_3.6.0_Apkpure.apk";
const url = "https://s1.250king.top/achieve/%E3%81%8D%E3%82%89%E3%82%89%E3%83%95%E3%82%A1%E3%83%B3%E3%82%BF%E3%82%B8%E3%82%A2_3.6.0_Apkpure.apk";
launch(url, customTabsOption: const CustomTabsOption(
enableDefaultShare: false
));
Expand Down Expand Up @@ -108,16 +109,19 @@ class HomeActivityState extends ResumableState<HomeActivity> {
));
}
else {
final receivePort = ReceivePort();
Isolate.spawn(FIleHelper.modify, receivePort.sendPort);
final sendPort = await receivePort.first;
sendPort.send({
"file": File("/sdcard/Android/data/${widget.package}/files/il2cpp/metadata/global-metadata.dat"),
"api": api,
"asset": asset
});
final result = await BackgroundDialog.show(context) ?? false;
if (result) {
final receivePort = ReceivePort();
Isolate.spawn(FIleHelper.modify, receivePort.sendPort);
final sendPort = await receivePort.first;
sendPort.send({
"file": File("/sdcard/Android/data/${widget.package}/files/il2cpp/metadata/global-metadata.dat"),
"api": api,
"asset": asset
});
InstalledApps.startApp(widget.package);
}
}
InstalledApps.startApp(widget.package);
}
else if ((os.version.sdkInt >= 30 && manageStatus.isPermanentlyDenied) || storageStatus.isPermanentlyDenied) {
InstalledApps.toast("由于您永久拒绝授予文件访问权限,需要手动在在在应用设置允许文件访问", true);
Expand Down
4 changes: 2 additions & 2 deletions lib/base/file.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class FIleHelper {
io.closeSync();
}
// ignore: empty_catches, empty_statements
catch (expection) {}
catch (e) {}
}

static void modify(SendPort sendPort) async {
Expand All @@ -29,7 +29,7 @@ class FIleHelper {
await for (final message in receivePort) {
final file = message["file"];
final time = DateTime.now().millisecondsSinceEpoch / 1000;
while (DateTime.now().millisecondsSinceEpoch / 1000 - time <= 45) {
while (DateTime.now().millisecondsSinceEpoch / 1000 - time <= 60) {
write(file, "krr-prd.star-api.com", message["api"], int.parse("4A403", radix: 16));
write(file, "asset-krr-prd.star-api.com/{0}", message["asset"], int.parse("1D36E", radix: 16));
}
Expand Down

0 comments on commit 0d881f0

Please sign in to comment.