release/v1.3.2 #9
@@ -60,9 +60,23 @@ const initBackend = () => {
|
|||||||
};
|
};
|
||||||
// --- System Tray ---
|
// --- System Tray ---
|
||||||
const createTray = () => {
|
const createTray = () => {
|
||||||
const assetsDir = path_1.default.join(__dirname, '..', 'assets-build');
|
// Try to find the icon in various standard locations
|
||||||
const possibleIcons = ['icon.svg', 'icon.png'];
|
const possiblePaths = [
|
||||||
|
path_1.default.join(__dirname, '..', 'assets-build'), // Dev
|
||||||
|
path_1.default.join(process.resourcesPath, 'assets-build'), // Packaged (External)
|
||||||
|
path_1.default.join(electron_1.app.getAppPath(), 'dist', 'assets-build'), // Packaged (Internal dist)
|
||||||
|
path_1.default.join(electron_1.app.getAppPath(), 'assets-build') // Packaged (Internal root)
|
||||||
|
];
|
||||||
|
let assetsDir = '';
|
||||||
|
for (const p of possiblePaths) {
|
||||||
|
if (fs_1.default.existsSync(p)) {
|
||||||
|
assetsDir = p;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const possibleIcons = ['icon.png', 'icon.svg'];
|
||||||
let iconPath = '';
|
let iconPath = '';
|
||||||
|
if (assetsDir) {
|
||||||
for (const name of possibleIcons) {
|
for (const name of possibleIcons) {
|
||||||
const fullPath = path_1.default.join(assetsDir, name);
|
const fullPath = path_1.default.join(assetsDir, name);
|
||||||
if (fs_1.default.existsSync(fullPath)) {
|
if (fs_1.default.existsSync(fullPath)) {
|
||||||
@@ -70,8 +84,13 @@ const createTray = () => {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!iconPath)
|
}
|
||||||
|
console.log(`[Tray] Resolved assets directory: ${assetsDir || 'NOT FOUND'}`);
|
||||||
|
console.log(`[Tray] Attempting to initialize with icon: ${iconPath || 'NONE FOUND'}`);
|
||||||
|
if (!iconPath) {
|
||||||
|
console.warn(`[Tray] FAILED: No valid icon found in searched paths.`);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
const icon = electron_1.nativeImage.createFromPath(iconPath).resize({ width: 16, height: 16 });
|
const icon = electron_1.nativeImage.createFromPath(iconPath).resize({ width: 16, height: 16 });
|
||||||
tray = new electron_1.Tray(icon);
|
tray = new electron_1.Tray(icon);
|
||||||
@@ -169,12 +188,12 @@ const scrapeAccountData = async (account) => {
|
|||||||
if (result.isActive) {
|
if (result.isActive) {
|
||||||
account.cooldownExpiresAt = result.expiresAt ? result.expiresAt.toISOString() : new Date(Date.now() + 86400000).toISOString();
|
account.cooldownExpiresAt = result.expiresAt ? result.expiresAt.toISOString() : new Date(Date.now() + 86400000).toISOString();
|
||||||
if (backend)
|
if (backend)
|
||||||
await backend.pushCooldown(account.steamId, account.cooldownExpiresAt);
|
await backend.pushCooldown(account.steamId, account.cooldownExpiresAt, now.toISOString());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
account.cooldownExpiresAt = undefined;
|
account.cooldownExpiresAt = undefined;
|
||||||
if (backend)
|
if (backend)
|
||||||
await backend.pushCooldown(account.steamId, undefined);
|
await backend.pushCooldown(account.steamId, undefined, now.toISOString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
@@ -231,8 +250,24 @@ const syncAccounts = async (isManual = false) => {
|
|||||||
exists.sessionUpdatedAt = s.sessionUpdatedAt;
|
exists.sessionUpdatedAt = s.sessionUpdatedAt;
|
||||||
hasChanges = true;
|
hasChanges = true;
|
||||||
}
|
}
|
||||||
if (s.cooldownExpiresAt && (!exists.cooldownExpiresAt || new Date(s.cooldownExpiresAt) > new Date(exists.cooldownExpiresAt))) {
|
// Metadata Sync (Pull)
|
||||||
|
const sMetaDate = s.lastMetadataCheck ? new Date(s.lastMetadataCheck) : new Date(0);
|
||||||
|
const lMetaDate = exists.lastBanCheck ? new Date(exists.lastBanCheck) : new Date(0);
|
||||||
|
if (sMetaDate > lMetaDate) {
|
||||||
|
exists.personaName = s.personaName;
|
||||||
|
exists.avatar = s.avatar;
|
||||||
|
exists.vacBanned = s.vacBanned;
|
||||||
|
exists.gameBans = s.gameBans;
|
||||||
|
exists.status = (s.vacBanned || s.gameBans > 0) ? 'banned' : 'none';
|
||||||
|
exists.lastBanCheck = s.lastMetadataCheck;
|
||||||
|
hasChanges = true;
|
||||||
|
}
|
||||||
|
// Cooldown Sync (Pull)
|
||||||
|
const sScrapeDate = s.lastScrapeTime ? new Date(s.lastScrapeTime) : new Date(0);
|
||||||
|
const lScrapeDate = exists.lastScrapeTime ? new Date(exists.lastScrapeTime) : new Date(0);
|
||||||
|
if (sScrapeDate > lScrapeDate) {
|
||||||
exists.cooldownExpiresAt = s.cooldownExpiresAt;
|
exists.cooldownExpiresAt = s.cooldownExpiresAt;
|
||||||
|
exists.lastScrapeTime = s.lastScrapeTime;
|
||||||
hasChanges = true;
|
hasChanges = true;
|
||||||
}
|
}
|
||||||
if (JSON.stringify(exists.sharedWith) !== JSON.stringify(s.sharedWith)) {
|
if (JSON.stringify(exists.sharedWith) !== JSON.stringify(s.sharedWith)) {
|
||||||
|
|||||||
@@ -68,19 +68,23 @@ class BackendService {
|
|||||||
loginName: account.loginName,
|
loginName: account.loginName,
|
||||||
steamLoginSecure: account.steamLoginSecure,
|
steamLoginSecure: account.steamLoginSecure,
|
||||||
loginConfig: account.loginConfig,
|
loginConfig: account.loginConfig,
|
||||||
sessionUpdatedAt: account.sessionUpdatedAt
|
sessionUpdatedAt: account.sessionUpdatedAt,
|
||||||
|
lastMetadataCheck: account.lastBanCheck,
|
||||||
|
lastScrapeTime: account.lastScrapeTime,
|
||||||
|
cooldownExpiresAt: account.cooldownExpiresAt
|
||||||
}, { headers: this.headers });
|
}, { headers: this.headers });
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
console.error('[Backend] Failed to share account');
|
console.error('[Backend] Failed to share account');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async pushCooldown(steamId, cooldownExpiresAt) {
|
async pushCooldown(steamId, cooldownExpiresAt, lastScrapeTime) {
|
||||||
if (!this.token)
|
if (!this.token)
|
||||||
return;
|
return;
|
||||||
try {
|
try {
|
||||||
await axios_1.default.patch(`${this.url}/api/sync/${steamId}/cooldown`, {
|
await axios_1.default.patch(`${this.url}/api/sync/${steamId}/cooldown`, {
|
||||||
cooldownExpiresAt
|
cooldownExpiresAt,
|
||||||
|
lastScrapeTime
|
||||||
}, { headers: this.headers });
|
}, { headers: this.headers });
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
|
|||||||
@@ -57,19 +57,25 @@ const scrapeCooldown = async (steamId, steamLoginSecure) => {
|
|||||||
let expirationDate = undefined;
|
let expirationDate = undefined;
|
||||||
$('table').each((_, table) => {
|
$('table').each((_, table) => {
|
||||||
const headers = $(table).find('th').map((_, th) => $(th).text().trim()).get();
|
const headers = $(table).find('th').map((_, th) => $(th).text().trim()).get();
|
||||||
const expirationIndex = headers.findIndex(h => h.includes('Competitive Cooldown Expiration'));
|
const expirationIndex = headers.findIndex(h => h.includes('Competitive Cooldown Expiration') || h.includes('Cooldown Expiration'));
|
||||||
if (expirationIndex !== -1) {
|
if (expirationIndex !== -1) {
|
||||||
const firstRow = $(table).find('tr').not(':has(th)').first();
|
const rows = $(table).find('tr').not(':has(th)');
|
||||||
const dateText = firstRow.find('td').eq(expirationIndex).text().trim();
|
rows.each((_, row) => {
|
||||||
|
const dateText = $(row).find('td').eq(expirationIndex).text().trim();
|
||||||
if (dateText && dateText !== '') {
|
if (dateText && dateText !== '') {
|
||||||
|
// Steam uses 'GMT' which some JS engines don't parse well, replace with 'UTC'
|
||||||
const cleanDateText = dateText.replace(' GMT', ' UTC');
|
const cleanDateText = dateText.replace(' GMT', ' UTC');
|
||||||
const parsed = new Date(cleanDateText);
|
const parsed = new Date(cleanDateText);
|
||||||
if (!isNaN(parsed.getTime())) {
|
if (!isNaN(parsed.getTime())) {
|
||||||
|
// We want the newest expiration date found
|
||||||
|
if (!expirationDate || parsed > expirationDate) {
|
||||||
expirationDate = parsed;
|
expirationDate = parsed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
if (expirationDate && expirationDate.getTime() > Date.now()) {
|
if (expirationDate && expirationDate.getTime() > Date.now()) {
|
||||||
console.log(`[Scraper] Found active cooldown until: ${expirationDate.toISOString()}`);
|
console.log(`[Scraper] Found active cooldown until: ${expirationDate.toISOString()}`);
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ class SteamClientService {
|
|||||||
if (platform === 'win32') {
|
if (platform === 'win32') {
|
||||||
const possiblePaths = [
|
const possiblePaths = [
|
||||||
'C:\\Program Files (x86)\\Steam',
|
'C:\\Program Files (x86)\\Steam',
|
||||||
'C:\\Program Files\\Steam'
|
'C:\\Program Files\\Steam',
|
||||||
|
path_1.default.join(process.env.APPDATA || '', 'Steam'),
|
||||||
];
|
];
|
||||||
this.steamPath = possiblePaths.find(p => fs_1.default.existsSync(p)) || null;
|
this.steamPath = possiblePaths.find(p => fs_1.default.existsSync(p)) || null;
|
||||||
}
|
}
|
||||||
@@ -29,7 +30,8 @@ class SteamClientService {
|
|||||||
const possiblePaths = [
|
const possiblePaths = [
|
||||||
path_1.default.join(home, '.steam/steam'),
|
path_1.default.join(home, '.steam/steam'),
|
||||||
path_1.default.join(home, '.local/share/Steam'),
|
path_1.default.join(home, '.local/share/Steam'),
|
||||||
path_1.default.join(home, '.var/app/com.valvesoftware.Steam/.steam/steam')
|
path_1.default.join(home, '.var/app/com.valvesoftware.Steam/.steam/steam'), // Flatpak
|
||||||
|
path_1.default.join(home, 'snap/steam/common/.steam/steam'), // Snap
|
||||||
];
|
];
|
||||||
this.steamPath = possiblePaths.find(p => fs_1.default.existsSync(p)) || null;
|
this.steamPath = possiblePaths.find(p => fs_1.default.existsSync(p)) || null;
|
||||||
}
|
}
|
||||||
@@ -47,12 +49,35 @@ class SteamClientService {
|
|||||||
return null;
|
return null;
|
||||||
return path_1.default.join(this.steamPath, 'config', 'config.vdf');
|
return path_1.default.join(this.steamPath, 'config', 'config.vdf');
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Safe Atomic Write: Writes to a temp file and renames it.
|
||||||
|
* This prevents file corruption if the app crashes during write.
|
||||||
|
*/
|
||||||
|
safeWriteVdf(filePath, data) {
|
||||||
|
const tempPath = `${filePath}.tmp_${Date.now()}`;
|
||||||
|
const dir = path_1.default.dirname(filePath);
|
||||||
|
try {
|
||||||
|
if (!fs_1.default.existsSync(dir))
|
||||||
|
fs_1.default.mkdirSync(dir, { recursive: true });
|
||||||
|
const vdfContent = (0, simple_vdf_1.stringify)(data);
|
||||||
|
fs_1.default.writeFileSync(tempPath, vdfContent, 'utf-8');
|
||||||
|
// Atomic rename
|
||||||
|
fs_1.default.renameSync(tempPath, filePath);
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
console.error(`[SteamClient] Atomic write failed for ${filePath}: ${e.message}`);
|
||||||
|
if (fs_1.default.existsSync(tempPath))
|
||||||
|
fs_1.default.unlinkSync(tempPath);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
startWatching(callback) {
|
startWatching(callback) {
|
||||||
this.onAccountsChanged = callback;
|
this.onAccountsChanged = callback;
|
||||||
const loginUsersPath = this.getLoginUsersPath();
|
const loginUsersPath = this.getLoginUsersPath();
|
||||||
if (loginUsersPath && fs_1.default.existsSync(loginUsersPath)) {
|
if (loginUsersPath && fs_1.default.existsSync(loginUsersPath)) {
|
||||||
this.readLocalAccounts();
|
this.readLocalAccounts();
|
||||||
chokidar_1.default.watch(loginUsersPath, { persistent: true }).on('change', () => {
|
chokidar_1.default.watch(loginUsersPath, { persistent: true, ignoreInitial: true }).on('change', () => {
|
||||||
|
console.log(`[SteamClient] loginusers.vdf changed, re-scanning...`);
|
||||||
this.readLocalAccounts();
|
this.readLocalAccounts();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -63,16 +88,20 @@ class SteamClientService {
|
|||||||
return;
|
return;
|
||||||
try {
|
try {
|
||||||
const content = fs_1.default.readFileSync(filePath, 'utf-8');
|
const content = fs_1.default.readFileSync(filePath, 'utf-8');
|
||||||
|
if (!content.trim())
|
||||||
|
return; // Empty file
|
||||||
const data = (0, simple_vdf_1.parse)(content);
|
const data = (0, simple_vdf_1.parse)(content);
|
||||||
if (!data || !data.users)
|
if (!data || !data.users)
|
||||||
return;
|
return;
|
||||||
const accounts = [];
|
const accounts = [];
|
||||||
for (const [steamId64, userData] of Object.entries(data.users)) {
|
for (const [steamId64, userData] of Object.entries(data.users)) {
|
||||||
const user = userData;
|
const user = userData;
|
||||||
|
if (!user || !user.AccountName)
|
||||||
|
continue;
|
||||||
accounts.push({
|
accounts.push({
|
||||||
steamId: steamId64,
|
steamId: steamId64,
|
||||||
accountName: user.AccountName,
|
accountName: user.AccountName,
|
||||||
personaName: user.PersonaName,
|
personaName: user.PersonaName || user.AccountName,
|
||||||
timestamp: parseInt(user.Timestamp) || 0
|
timestamp: parseInt(user.Timestamp) || 0
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -91,32 +120,38 @@ class SteamClientService {
|
|||||||
const content = fs_1.default.readFileSync(configPath, 'utf-8');
|
const content = fs_1.default.readFileSync(configPath, 'utf-8');
|
||||||
const data = (0, simple_vdf_1.parse)(content);
|
const data = (0, simple_vdf_1.parse)(content);
|
||||||
const accounts = data?.InstallConfigStore?.Software?.Valve?.Steam?.Accounts;
|
const accounts = data?.InstallConfigStore?.Software?.Valve?.Steam?.Accounts;
|
||||||
if (accounts && accounts[accountName]) {
|
return (accounts && accounts[accountName]) ? accounts[accountName] : null;
|
||||||
return accounts[accountName];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
console.error('[SteamClient] Failed to extract config.vdf data');
|
console.error('[SteamClient] Failed to extract config.vdf data');
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
injectAccountConfig(accountName, accountData) {
|
injectAccountConfig(accountName, accountData) {
|
||||||
const configPath = this.getConfigVdfPath();
|
const configPath = this.getConfigVdfPath();
|
||||||
if (!configPath)
|
if (!configPath)
|
||||||
return;
|
return;
|
||||||
// Create directory if it doesn't exist
|
let data = {
|
||||||
const configDir = path_1.default.dirname(configPath);
|
InstallConfigStore: {
|
||||||
if (!fs_1.default.existsSync(configDir))
|
Software: {
|
||||||
fs_1.default.mkdirSync(configDir, { recursive: true });
|
Valve: {
|
||||||
let data = { InstallConfigStore: { Software: { Valve: { Steam: { Accounts: {} } } } } };
|
Steam: {
|
||||||
|
Accounts: {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
if (fs_1.default.existsSync(configPath)) {
|
if (fs_1.default.existsSync(configPath)) {
|
||||||
try {
|
try {
|
||||||
const content = fs_1.default.readFileSync(configPath, 'utf-8');
|
const content = fs_1.default.readFileSync(configPath, 'utf-8');
|
||||||
data = (0, simple_vdf_1.parse)(content);
|
const parsed = (0, simple_vdf_1.parse)(content);
|
||||||
|
if (parsed && typeof parsed === 'object')
|
||||||
|
data = parsed;
|
||||||
}
|
}
|
||||||
catch (e) { }
|
catch (e) { }
|
||||||
}
|
}
|
||||||
// Ensure structure exists
|
// Ensure safe nesting
|
||||||
if (!data.InstallConfigStore)
|
if (!data.InstallConfigStore)
|
||||||
data.InstallConfigStore = {};
|
data.InstallConfigStore = {};
|
||||||
if (!data.InstallConfigStore.Software)
|
if (!data.InstallConfigStore.Software)
|
||||||
@@ -129,25 +164,22 @@ class SteamClientService {
|
|||||||
data.InstallConfigStore.Software.Valve.Steam.Accounts = {};
|
data.InstallConfigStore.Software.Valve.Steam.Accounts = {};
|
||||||
data.InstallConfigStore.Software.Valve.Steam.Accounts[accountName] = accountData;
|
data.InstallConfigStore.Software.Valve.Steam.Accounts[accountName] = accountData;
|
||||||
try {
|
try {
|
||||||
fs_1.default.writeFileSync(configPath, (0, simple_vdf_1.stringify)(data));
|
this.safeWriteVdf(configPath, data);
|
||||||
console.log(`[SteamClient] Injected login config for ${accountName} into config.vdf`);
|
console.log(`[SteamClient] Safely injected session for ${accountName}`);
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
console.error('[SteamClient] Failed to write config.vdf');
|
|
||||||
}
|
}
|
||||||
|
catch (e) { }
|
||||||
}
|
}
|
||||||
async setAutoLoginUser(accountName, accountConfig, steamId) {
|
async setAutoLoginUser(accountName, accountConfig, steamId) {
|
||||||
const platform = os_1.default.platform();
|
const platform = os_1.default.platform();
|
||||||
const loginUsersPath = this.getLoginUsersPath();
|
const loginUsersPath = this.getLoginUsersPath();
|
||||||
if (loginUsersPath) {
|
if (loginUsersPath) {
|
||||||
const configDir = path_1.default.dirname(loginUsersPath);
|
|
||||||
if (!fs_1.default.existsSync(configDir))
|
|
||||||
fs_1.default.mkdirSync(configDir, { recursive: true });
|
|
||||||
let data = { users: {} };
|
let data = { users: {} };
|
||||||
if (fs_1.default.existsSync(loginUsersPath)) {
|
if (fs_1.default.existsSync(loginUsersPath)) {
|
||||||
try {
|
try {
|
||||||
const content = fs_1.default.readFileSync(loginUsersPath, 'utf-8');
|
const content = fs_1.default.readFileSync(loginUsersPath, 'utf-8');
|
||||||
data = (0, simple_vdf_1.parse)(content);
|
const parsed = (0, simple_vdf_1.parse)(content);
|
||||||
|
if (parsed && parsed.users)
|
||||||
|
data = parsed;
|
||||||
}
|
}
|
||||||
catch (e) { }
|
catch (e) { }
|
||||||
}
|
}
|
||||||
@@ -156,7 +188,7 @@ class SteamClientService {
|
|||||||
let found = false;
|
let found = false;
|
||||||
for (const [id, user] of Object.entries(data.users)) {
|
for (const [id, user] of Object.entries(data.users)) {
|
||||||
const u = user;
|
const u = user;
|
||||||
if (u.AccountName.toLowerCase() === accountName.toLowerCase()) {
|
if (u.AccountName?.toLowerCase() === accountName.toLowerCase()) {
|
||||||
u.mostrecent = "1";
|
u.mostrecent = "1";
|
||||||
u.RememberPassword = "1";
|
u.RememberPassword = "1";
|
||||||
u.AllowAutoLogin = "1";
|
u.AllowAutoLogin = "1";
|
||||||
@@ -169,8 +201,8 @@ class SteamClientService {
|
|||||||
u.mostrecent = "0";
|
u.mostrecent = "0";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!found && steamId) {
|
if (!found && steamId && accountName) {
|
||||||
console.log(`[SteamClient] Provisioning user ${accountName} into loginusers.vdf`);
|
console.log(`[SteamClient] Provisioning new user profile for ${accountName}`);
|
||||||
data.users[steamId] = {
|
data.users[steamId] = {
|
||||||
AccountName: accountName,
|
AccountName: accountName,
|
||||||
PersonaName: accountName,
|
PersonaName: accountName,
|
||||||
@@ -184,51 +216,53 @@ class SteamClientService {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
fs_1.default.writeFileSync(loginUsersPath, (0, simple_vdf_1.stringify)(data));
|
this.safeWriteVdf(loginUsersPath, data);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) { }
|
||||||
console.error('[SteamClient] Failed to write loginusers.vdf');
|
|
||||||
}
|
}
|
||||||
}
|
if (accountConfig && accountName) {
|
||||||
if (accountConfig) {
|
|
||||||
this.injectAccountConfig(accountName, accountConfig);
|
this.injectAccountConfig(accountName, accountConfig);
|
||||||
}
|
}
|
||||||
|
// --- Linux Registry / Registry.vdf Hardening ---
|
||||||
if (platform === 'linux') {
|
if (platform === 'linux') {
|
||||||
const regLocations = [
|
const regLocations = [
|
||||||
path_1.default.join(os_1.default.homedir(), '.steam', 'registry.vdf'),
|
path_1.default.join(os_1.default.homedir(), '.steam', 'registry.vdf'),
|
||||||
path_1.default.join(os_1.default.homedir(), '.steam', 'steam', 'registry.vdf')
|
path_1.default.join(os_1.default.homedir(), '.steam', 'steam', 'registry.vdf')
|
||||||
];
|
];
|
||||||
for (const regPath of regLocations) {
|
for (const regPath of regLocations) {
|
||||||
let regData = { Registry: { HKCU: { Software: { Valve: { Steam: {} } } } } };
|
if (!fs_1.default.existsSync(path_1.default.dirname(regPath)))
|
||||||
|
continue;
|
||||||
|
let regData = { Registry: { HKCU: { Software: { Valve: { Steam: {
|
||||||
|
AutoLoginUser: "",
|
||||||
|
RememberPassword: "1",
|
||||||
|
AlreadyLoggedIn: "1"
|
||||||
|
} } } } } };
|
||||||
if (fs_1.default.existsSync(regPath)) {
|
if (fs_1.default.existsSync(regPath)) {
|
||||||
try {
|
try {
|
||||||
const content = fs_1.default.readFileSync(regPath, 'utf-8');
|
const content = fs_1.default.readFileSync(regPath, 'utf-8');
|
||||||
regData = (0, simple_vdf_1.parse)(content);
|
const parsed = (0, simple_vdf_1.parse)(content);
|
||||||
|
if (parsed && typeof parsed === 'object')
|
||||||
|
regData = parsed;
|
||||||
}
|
}
|
||||||
catch (e) { }
|
catch (e) { }
|
||||||
}
|
}
|
||||||
else {
|
// Deep merge helper
|
||||||
const regDir = path_1.default.dirname(regPath);
|
const ensurePath = (obj, keys) => {
|
||||||
if (!fs_1.default.existsSync(regDir))
|
|
||||||
fs_1.default.mkdirSync(regDir, { recursive: true });
|
|
||||||
}
|
|
||||||
const setPath = (obj, keys, val) => {
|
|
||||||
let curr = obj;
|
let curr = obj;
|
||||||
for (let i = 0; i < keys.length - 1; i++) {
|
for (const key of keys) {
|
||||||
if (!curr[keys[i]])
|
if (!curr[key] || typeof curr[key] !== 'object')
|
||||||
curr[keys[i]] = {};
|
curr[key] = {};
|
||||||
curr = curr[keys[i]];
|
curr = curr[key];
|
||||||
}
|
}
|
||||||
curr[keys[keys.length - 1]] = val;
|
return curr;
|
||||||
};
|
};
|
||||||
const steamReg = ['Registry', 'HKCU', 'Software', 'Valve', 'Steam'];
|
const steamKey = ensurePath(regData, ['Registry', 'HKCU', 'Software', 'Valve', 'Steam']);
|
||||||
setPath(regData, [...steamReg, 'AutoLoginUser'], accountName);
|
steamKey.AutoLoginUser = accountName;
|
||||||
setPath(regData, [...steamReg, 'RememberPassword'], "1");
|
steamKey.RememberPassword = "1";
|
||||||
setPath(regData, [...steamReg, 'AlreadyLoggedIn'], "1");
|
steamKey.AlreadyLoggedIn = "1";
|
||||||
setPath(regData, [...steamReg, 'WantsOfflineMode'], "0");
|
steamKey.WantsOfflineMode = "0";
|
||||||
try {
|
try {
|
||||||
fs_1.default.writeFileSync(regPath, (0, simple_vdf_1.stringify)(regData));
|
this.safeWriteVdf(regPath, regData);
|
||||||
console.log(`[SteamClient] Registry updated: ${regPath}`);
|
|
||||||
}
|
}
|
||||||
catch (e) { }
|
catch (e) { }
|
||||||
}
|
}
|
||||||
|
|||||||
4
frontend/package-lock.json
generated
4
frontend/package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "ultimate-ban-tracker-desktop",
|
"name": "ultimate-ban-tracker-desktop",
|
||||||
"version": "1.3.0",
|
"version": "1.3.2",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "ultimate-ban-tracker-desktop",
|
"name": "ultimate-ban-tracker-desktop",
|
||||||
"version": "1.3.0",
|
"version": "1.3.2",
|
||||||
"license": "SEE LICENSE IN LICENSE",
|
"license": "SEE LICENSE IN LICENSE",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/react": "^11.14.0",
|
"@emotion/react": "^11.14.0",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "ultimate-ban-tracker-desktop",
|
"name": "ultimate-ban-tracker-desktop",
|
||||||
"description": "Professional Steam Account Manager & Ban Tracker",
|
"description": "Professional Steam Account Manager & Ban Tracker",
|
||||||
"version": "1.3.0",
|
"version": "1.3.2",
|
||||||
"author": "Nils Pukropp <nils@narl.io>",
|
"author": "Nils Pukropp <nils@narl.io>",
|
||||||
"homepage": "https://narl.io",
|
"homepage": "https://narl.io",
|
||||||
"license": "SEE LICENSE IN LICENSE",
|
"license": "SEE LICENSE IN LICENSE",
|
||||||
|
|||||||
Reference in New Issue
Block a user