mirror of
https://mirror.ghproxy.com/https://github.com/StarCitizenToolBox/app.git
synced 2024-12-23 00:33:42 +08:00
bugfix
This commit is contained in:
parent
d905f8c13e
commit
6a6360540b
@ -287,8 +287,7 @@ async function getRSILauncherToken(channelId) {
|
|||||||
let libraryData = (await libraryR.json())["data"]
|
let libraryData = (await libraryR.json())["data"]
|
||||||
|
|
||||||
// get user avatar
|
// get user avatar
|
||||||
let $avatarElement = $(".c-account-sidebar__profile-metas-avatar");
|
let avatarUrl = $(".a-avatarButton__image").attr("src");
|
||||||
let avatarUrl = $avatarElement.css("background-image");
|
|
||||||
|
|
||||||
//post message
|
//post message
|
||||||
window.chrome.webview.postMessage({
|
window.chrome.webview.postMessage({
|
||||||
|
@ -8,8 +8,8 @@ class SystemHelper {
|
|||||||
|
|
||||||
static initPowershellPath() async {
|
static initPowershellPath() async {
|
||||||
try {
|
try {
|
||||||
var result = await Process.run(powershellPath, ["echo", "ping"]);
|
var result = await Process.run(powershellPath, ["echo", "pong"]);
|
||||||
if (!result.stdout.toString().startsWith("ping") &&
|
if (!result.stdout.toString().startsWith("pong") &&
|
||||||
powershellPath == "powershell.exe") {
|
powershellPath == "powershell.exe") {
|
||||||
throw "powershell check failed";
|
throw "powershell check failed";
|
||||||
}
|
}
|
||||||
|
@ -63,10 +63,13 @@ class HomeGameLoginUIModel extends _$HomeGameLoginUIModel {
|
|||||||
final webToken = data["webToken"];
|
final webToken = data["webToken"];
|
||||||
final releaseInfo = data["releaseInfo"];
|
final releaseInfo = data["releaseInfo"];
|
||||||
final libraryData = RsiGameLibraryData.fromJson(data["libraryData"]);
|
final libraryData = RsiGameLibraryData.fromJson(data["libraryData"]);
|
||||||
final avatarUrl = data["avatar"]
|
var avatarUrl = data["avatar"]
|
||||||
?.toString()
|
?.toString()
|
||||||
.replaceAll("url(\"", "")
|
.replaceAll("url(\"", "")
|
||||||
.replaceAll("\")", "");
|
.replaceAll("\")", "");
|
||||||
|
if (avatarUrl?.startsWith("/") ?? false) {
|
||||||
|
avatarUrl = "https://robertsspaceindustries.com$avatarUrl";
|
||||||
|
}
|
||||||
final Map<String, dynamic> payload = Jwt.parseJwt(authToken!);
|
final Map<String, dynamic> payload = Jwt.parseJwt(authToken!);
|
||||||
final nickname = payload["nickname"] ?? "";
|
final nickname = payload["nickname"] ?? "";
|
||||||
|
|
||||||
|
@ -297,7 +297,7 @@ class LocalizationUIModel extends _$LocalizationUIModel {
|
|||||||
for (var value
|
for (var value
|
||||||
in (element.rawContent?.readString() ?? "").split("\n")) {
|
in (element.rawContent?.readString() ?? "").split("\n")) {
|
||||||
final tv = value.trim();
|
final tv = value.trim();
|
||||||
if (tv.isNotEmpty) globalIni.writeln(tv);
|
if (tv.isNotEmpty) globalIni.writeln(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,8 +92,9 @@ class SettingsUIModel extends _$SettingsUIModel {
|
|||||||
if (r == null || r.files.firstOrNull?.path == null) return;
|
if (r == null || r.files.firstOrNull?.path == null) return;
|
||||||
final fileName = r.files.first.path!;
|
final fileName = r.files.first.path!;
|
||||||
dPrint(fileName);
|
dPrint(fileName);
|
||||||
final fileNameRegExp =
|
final fileNameRegExp = RegExp(
|
||||||
RegExp(r"^(.*\\StarCitizen\\.*\\)Bin64\\StarCitizen\.exe$");
|
r"^(.*\\StarCitizen\\.*\\)Bin64\\StarCitizen\.exe$",
|
||||||
|
caseSensitive: false);
|
||||||
if (fileNameRegExp.hasMatch(fileName)) {
|
if (fileNameRegExp.hasMatch(fileName)) {
|
||||||
RegExp pathRegex = RegExp(r"\\[^\\]+\\Bin64\\StarCitizen\.exe$");
|
RegExp pathRegex = RegExp(r"\\[^\\]+\\Bin64\\StarCitizen\.exe$");
|
||||||
String extractedPath = fileName.replaceFirst(pathRegex, '');
|
String extractedPath = fileName.replaceFirst(pathRegex, '');
|
||||||
|
Loading…
Reference in New Issue
Block a user