This commit is contained in:
xkeyC 2024-09-23 20:35:19 +08:00
parent d905f8c13e
commit 6a6360540b
5 changed files with 11 additions and 8 deletions

View File

@ -287,8 +287,7 @@ async function getRSILauncherToken(channelId) {
let libraryData = (await libraryR.json())["data"]
// get user avatar
let $avatarElement = $(".c-account-sidebar__profile-metas-avatar");
let avatarUrl = $avatarElement.css("background-image");
let avatarUrl = $(".a-avatarButton__image").attr("src");
//post message
window.chrome.webview.postMessage({

View File

@ -8,8 +8,8 @@ class SystemHelper {
static initPowershellPath() async {
try {
var result = await Process.run(powershellPath, ["echo", "ping"]);
if (!result.stdout.toString().startsWith("ping") &&
var result = await Process.run(powershellPath, ["echo", "pong"]);
if (!result.stdout.toString().startsWith("pong") &&
powershellPath == "powershell.exe") {
throw "powershell check failed";
}

View File

@ -63,10 +63,13 @@ class HomeGameLoginUIModel extends _$HomeGameLoginUIModel {
final webToken = data["webToken"];
final releaseInfo = data["releaseInfo"];
final libraryData = RsiGameLibraryData.fromJson(data["libraryData"]);
final avatarUrl = data["avatar"]
var avatarUrl = data["avatar"]
?.toString()
.replaceAll("url(\"", "")
.replaceAll("\")", "");
if (avatarUrl?.startsWith("/") ?? false) {
avatarUrl = "https://robertsspaceindustries.com$avatarUrl";
}
final Map<String, dynamic> payload = Jwt.parseJwt(authToken!);
final nickname = payload["nickname"] ?? "";

View File

@ -297,7 +297,7 @@ class LocalizationUIModel extends _$LocalizationUIModel {
for (var value
in (element.rawContent?.readString() ?? "").split("\n")) {
final tv = value.trim();
if (tv.isNotEmpty) globalIni.writeln(tv);
if (tv.isNotEmpty) globalIni.writeln(value);
}
}
}

View File

@ -92,8 +92,9 @@ class SettingsUIModel extends _$SettingsUIModel {
if (r == null || r.files.firstOrNull?.path == null) return;
final fileName = r.files.first.path!;
dPrint(fileName);
final fileNameRegExp =
RegExp(r"^(.*\\StarCitizen\\.*\\)Bin64\\StarCitizen\.exe$");
final fileNameRegExp = RegExp(
r"^(.*\\StarCitizen\\.*\\)Bin64\\StarCitizen\.exe$",
caseSensitive: false);
if (fileNameRegExp.hasMatch(fileName)) {
RegExp pathRegex = RegExp(r"\\[^\\]+\\Bin64\\StarCitizen\.exe$");
String extractedPath = fileName.replaceFirst(pathRegex, '');