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"] 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({

View File

@ -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";
} }

View File

@ -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"] ?? "";

View File

@ -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);
} }
} }
} }

View File

@ -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, '');