Compare commits

..

3 Commits

Author SHA1 Message Date
ikun0014
b91bf42981 2.1.1 2025-11-10 22:33:24 +08:00
ikun0014
dacaa1c62e update web ver 2025-11-10 22:33:22 +08:00
ikun0014
22619df037 fix: GreenLuma 2025-11-10 22:32:49 +08:00
4 changed files with 56 additions and 27 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "onekey",
"version": "2.1.0",
"version": "2.1.1",
"description": "一个Steam仓库清单下载器",
"main": "index.js",
"scripts": {

View File

@@ -4,36 +4,65 @@ from typing import List
from .base import UnlockTool
from ..models import DepotInfo
class GreenLuma(UnlockTool):
"""GreenLuma解锁工具实现"""
async def setup(self, depot_data: List[DepotInfo], app_id: str, **kwargs) -> bool:
"""设置GreenLuma解锁"""
applist_dir = self.steam_path / "AppList"
applist_dir.mkdir(exist_ok=True)
for f in applist_dir.glob("*.txt"):
f.unlink()
for idx, depot in enumerate(depot_data, 1):
(applist_dir / f"{idx}.txt").write_text(depot.depot_id)
if applist_dir.is_file():
applist_dir.unlink(missing_ok=True)
if not applist_dir.is_dir():
applist_dir.mkdir(parents=True, exist_ok=True)
depot_dict = {}
for i in applist_dir.iterdir():
if i.stem.isdecimal() and i.suffix == '.txt':
with i.open('r', encoding='utf-8') as f:
app_id_ = f.read().strip()
depot_dict[int(i.stem)] = int(app_id_) if app_id_.isdecimal() else None
def find_next_index():
if not depot_dict:
return 0
for i in range(max(depot_dict.keys())):
if i not in depot_dict:
return i
return max(depot_dict.keys()) + 1
if app_id and app_id.isdecimal():
app_id_int = int(app_id)
if app_id_int not in depot_dict.values():
index = find_next_index()
with (applist_dir / f'{index}.txt').open('w', encoding='utf-8') as f:
f.write(str(app_id))
depot_dict[index] = app_id_int
for depot in depot_data:
depot_id = int(depot.depot_id)
if depot_id not in depot_dict.values():
index = find_next_index()
with (applist_dir / f'{index}.txt').open('w', encoding='utf-8') as f:
f.write(str(depot_id))
depot_dict[index] = depot_id
config_path = self.steam_path / "config" / "config.vdf"
try:
with open(config_path, "r", encoding="utf-8") as f:
content = vdf.loads(f.read())
content.setdefault("depots", {}).update(
{
depot.depot_id: {"DecryptionKey": depot.decryption_key}
for depot in depot_data
}
)
if config_path.is_file():
with open(config_path, "r", encoding="utf-8") as f:
content = vdf.loads(f.read())
else:
content = {}
config_path.parent.mkdir(parents=True, exist_ok=True)
if "depots" not in content:
content["depots"] = {}
for depot in depot_data:
content["depots"][depot.depot_id] = {"DecryptionKey": depot.decryption_key}
with open(config_path, "w", encoding="utf-8") as f:
f.write(vdf.dumps(content))
return True
except Exception:
return False
except Exception as e:
print(f"GreenLuma配置失败: {e}")
return False

View File

@@ -33,7 +33,7 @@
</p>
</div>
<div class="project-version">
<span class="version-label">v2.1.0</span>
<span class="version-label">v2.1.1</span>
<span class="version-type">Web UI</span>
</div>
</div>

View File

@@ -31,7 +31,7 @@
<p class="project-subtitle">直观,优雅的游戏解锁解决方案</p>
</div>
<div class="project-version">
<span class="version-label">v2.1.0</span>
<span class="version-label">v2.1.1</span>
<span class="version-type">Web UI</span>
</div>
</div>