убрана информация о паролях пользователя
This commit is contained in:
@@ -351,6 +351,7 @@ class HomeScreenBloc extends Bloc<HomeScreenEvent, HomeScreenState> {
|
||||
_gameLaunchPending = true;
|
||||
try {
|
||||
final installationDir = outputPath.toFilePath();
|
||||
await _gameInstallationService.removeSavedAccountName(installationDir);
|
||||
await _gameInstallationService.clearCache(installationDir);
|
||||
final authorization = await _launcherApiClient.issueGameTicket(
|
||||
_session.accessToken,
|
||||
|
||||
@@ -220,6 +220,27 @@ class GameInstallationService {
|
||||
await cacheDirectory.create(recursive: true);
|
||||
}
|
||||
|
||||
Future<void> removeSavedAccountName(String installationDir) async {
|
||||
final configFile = File(p.join(installationDir, 'WTF', 'Config.wtf'));
|
||||
if (!await configFile.exists()) {
|
||||
return;
|
||||
}
|
||||
|
||||
final contents = await configFile.readAsString();
|
||||
final sanitizedContents = contents.replaceAll(
|
||||
RegExp(
|
||||
r'^[ \t]*SET[ \t]+accountName(?:[ \t]+.*)?(?:\r\n|\n|\r|$)',
|
||||
caseSensitive: false,
|
||||
multiLine: true,
|
||||
),
|
||||
'',
|
||||
);
|
||||
|
||||
if (sanitizedContents != contents) {
|
||||
await configFile.writeAsString(sanitizedContents, flush: true);
|
||||
}
|
||||
}
|
||||
|
||||
Future<GameProcessHandle> launchGame(
|
||||
String installationDir, {
|
||||
required LauncherGameTicket authorization,
|
||||
|
||||
Reference in New Issue
Block a user