Windows 上的安卓应用运行器:双击 APK 即装,应用以独立窗口与桌面图标运行,自持 QEMU 运行时
feat(brand): 全新 Logo — APK 大字 + start 副标
RoutineMiku569e90375c58
diff --git a/README.md b/README.mdindex 95e1c99..1bc1293 100644--- a/README.md+++ b/README.md@@ -1,5 +1,7 @@# ApkStart+<p align="center"><img src="docs/images/logo.png" alt="ApkStart Logo" width="160" /></p>+[](https://github.com/RoutineMiku/apkstart/actions/workflows/ci.yml)[](https://github.com/RoutineMiku/apkstart/releases)[](LICENSE)diff --git a/build/logo.html b/build/logo.htmlnew file mode 100644index 0000000..4380925--- /dev/null+++ b/build/logo.html@@ -0,0 +1,91 @@+<!DOCTYPE html>+<html lang="en">+<head>+<meta charset="utf-8" />+<style>+ html, body { margin: 0; padding: 0; background: transparent; width: 1024px; height: 1024px; overflow: hidden; }+ .stage { width: 1024px; height: 1024px; position: relative; display: grid; place-items: center; }+ .tile {+ position: relative; width: 896px; height: 896px; border-radius: 208px;+ background:+ radial-gradient(120% 90% at 18% 8%, #243444 0%, #131c25 46%, #0b1016 100%);+ box-shadow: inset 0 2px 0 rgba(255,255,255,.14), inset 0 -30px 70px rgba(0,0,0,.55);+ overflow: hidden;+ }+ /* 斜向高光 */+ .tile::before {+ content: ""; position: absolute; inset: -40% -20% auto -60%; height: 130%;+ background: linear-gradient(104deg, rgba(255,255,255,0) 34%, rgba(255,255,255,.10) 47%, rgba(255,255,255,0) 60%);+ transform: rotate(-6deg);+ }+ /* 网格点阵 */+ .dots {+ position: absolute; inset: 0;+ background-image: radial-gradient(rgba(255,255,255,.10) 1.6px, transparent 1.7px);+ background-size: 46px 46px; background-position: 22px 22px;+ opacity: .5;+ mask-image: radial-gradient(78% 78% at 50% 46%, #000 30%, transparent 78%);+ -webkit-mask-image: radial-gradient(78% 78% at 50% 46%, #000 30%, transparent 78%);+ }+ /* 底部绿色辉光 */+ .glow {+ position: absolute; left: 50%; bottom: -180px; width: 860px; height: 460px;+ transform: translateX(-50%);+ background: radial-gradient(closest-side, rgba(61,220,132,.42), rgba(61,220,132,0) 72%);+ filter: blur(8px);+ }+ .content { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }+ .apk {+ font-family: "Arial Black", "Segoe UI Black", "Segoe UI", Arial, sans-serif;+ font-weight: 900; font-size: 292px; line-height: .86; letter-spacing: -8px;+ background: linear-gradient(178deg, #ffffff 26%, #dfe9f2 62%, #b9cad9 100%);+ -webkit-background-clip: text; background-clip: text; color: transparent;+ text-shadow: 0 12px 34px rgba(0,0,0,.45);+ margin-top: -34px;+ }+ .bar {+ width: 372px; height: 12px; border-radius: 8px; margin: 26px 0 30px;+ background: linear-gradient(90deg, rgba(61,220,132,0) 0%, #3ddc84 22%, #6ff0a8 50%, #3ddc84 78%, rgba(61,220,132,0) 100%);+ box-shadow: 0 0 34px rgba(61,220,132,.55);+ }+ .start {+ font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;+ font-weight: 700; font-size: 146px; line-height: 1; letter-spacing: 3px;+ color: #3ddc84;+ text-shadow: 0 0 42px rgba(61,220,132,.45);+ }+ /* 点缀:播放键 + 火花 */+ .spark { position: absolute; background: #6ff0a8; border-radius: 50%; box-shadow: 0 0 26px rgba(111,240,168,.8); }+ .s1 { width: 16px; height: 16px; right: 176px; top: 214px; opacity: .95; }+ .s2 { width: 9px; height: 9px; right: 136px; top: 268px; opacity: .6; }+ .s3 { width: 11px; height: 11px; left: 168px; bottom: 236px; opacity: .55; }+ .tri { position: absolute; left: 150px; top: 200px; width: 0; height: 0;+ border-left: 30px solid #3ddc84; border-top: 18px solid transparent; border-bottom: 18px solid transparent;+ filter: drop-shadow(0 0 18px rgba(61,220,132,.7)); opacity: .9;+ }+ /* 四角刻度 */+ .corner { position: absolute; width: 62px; height: 62px; border: 5px solid rgba(255,255,255,.16); border-radius: 18px; }+ .c1 { left: 92px; top: 92px; border-right: 0; border-bottom: 0; }+ .c2 { right: 92px; bottom: 92px; border-left: 0; border-top: 0; }+</style>+</head>+<body>+ <div class="stage">+ <div class="tile">+ <div class="dots"></div>+ <div class="glow"></div>+ <div class="corner c1"></div>+ <div class="corner c2"></div>+ <div class="content">+ <div class="apk">APK</div>+ <div class="bar"></div>+ <div class="start">start</div>+ </div>+ <div class="tri"></div>+ <div class="spark s1"></div>+ <div class="spark s2"></div>+ <div class="spark s3"></div>+ </div>+ </div>+</body>+</html>diff --git a/build/render-logo.js b/build/render-logo.jsnew file mode 100644index 0000000..9984745--- /dev/null+++ b/build/render-logo.js@@ -0,0 +1,56 @@+'use strict';+/**+ * Logo 渲染:用 Electron 离屏渲染 build/logo.html → 多尺寸 PNG + ICO+ * node_modules/electron/dist/electron.exe build/render-logo.js+ * 产出:src/ui/assets/logo.png(512,供界面/窗口图标)+ * build/appicon.ico(16~256 多尺寸,供 .apk 关联与快捷方式)+ * docs/images/logo.png(README 用)+ */+const { app, BrowserWindow } = require('electron');+const fs = require('fs');+const path = require('path');+const { pngToIco } = require('../src/core/shortcut');++const ROOT = path.join(__dirname, '..');+const SIZE = 1024;++app.commandLine.appendSwitch('disable-features', 'CalculateNativeWinOcclusion');+app.disableHardwareAcceleration();++app.whenReady().then(async () => {+ const win = new BrowserWindow({+ width: SIZE,+ height: SIZE,+ show: false,+ frame: false,+ transparent: true,+ backgroundColor: '#00000000',+ webPreferences: { offscreen: true, backgroundThrottling: false },+ });+ win.setContentSize(SIZE, SIZE);+ await win.loadFile(path.join(__dirname, 'logo.html'));+ await new Promise((r) => setTimeout(r, 1200));++ const img = await win.webContents.capturePage();+ const full = img.toPNG();+ const base = require('electron').nativeImage.createFromBuffer(full);+ console.log('captured', base.getSize());++ const save = (size, file) => {+ const buf = size === SIZE ? full : base.resize({ width: size, height: size, quality: 'best' }).toPNG();+ fs.mkdirSync(path.dirname(file), { recursive: true });+ fs.writeFileSync(file, buf);+ console.log(' ->', path.relative(ROOT, file), size + 'px', Math.round(buf.length / 1024) + 'KB');+ return buf;+ };++ save(1024, path.join(ROOT, 'docs', 'images', 'logo.png'));+ save(512, path.join(ROOT, 'src', 'ui', 'assets', 'logo.png'));+ save(128, path.join(ROOT, 'src', 'ui', 'assets', 'logo-128.png'));++ const ico = pngToIco(full);+ fs.writeFileSync(path.join(ROOT, 'src', 'ui', 'assets', 'appicon.ico'), ico);+ console.log(' -> src/ui/assets/appicon.ico', Math.round(ico.length / 1024) + 'KB');++ app.exit(0);+});diff --git a/docs/images/logo.png b/docs/images/logo.pngnew file mode 100644index 0000000..8ce41eaBinary files /dev/null and b/docs/images/logo.png differdiff --git a/src/main.js b/src/main.jsindex 5d412f2..5d7dc43 100644--- a/src/main.js+++ b/src/main.js@@ -13,7 +13,20 @@ const { Installer } = require('./core/installer');const { Sharer } = require('./core/sharer');const { parseApk } = require('./core/apk');const { drawAppIcon } = require('./core/png');-const { pngToIco } = require('./core/shortcut');++// 品牌 Logo(build/render-logo.js 生成);缺失时回退到程序化绘制的旧版图标+const LOGO_DIR = path.join(__dirname, 'ui', 'assets');+const LOGO_FILE = path.join(LOGO_DIR, 'logo.png');+const APPICON_FILE = path.join(LOGO_DIR, 'appicon.ico');+function loadBrandIcon(size) {+ try {+ if (fs.existsSync(LOGO_FILE)) {+ const img = nativeImage.createFromPath(LOGO_FILE);+ return size ? img.resize({ width: size, height: size, quality: 'best' }) : img;+ }+ } catch (_) { /* 落到程序化图标 */ }+ return nativeImage.createFromBuffer(drawAppIcon(size || 256));+}const assoc = require('./core/assoc');// Windows 下窗口被遮挡时 capturePage 会拿到旧帧,自动化截图需要禁用遮挡计算@@ -23,7 +36,7 @@ const APP_ROOT = path.join(__dirname, '..');const IS_DEV = process.argv.includes('--dev');// 冒烟截图等自动化场景下跳过注册表探测(避免依赖 reg.exe)const NO_SHELL_PROBE = process.argv.includes('--smoke') || process.env.APKSTART_NO_SHELL_PROBE === '1';-const ICON_PNG = drawAppIcon(256);+const ICON_PNG = loadBrandIcon().toPNG();let mainWindow = null;let tray = null;@@ -123,7 +136,7 @@ function send(channel, payload) {// ---------------- 托盘 ----------------function buildTray() {- const icon = nativeImage.createFromBuffer(drawAppIcon(64)).resize({ width: 16, height: 16 });+ const icon = loadBrandIcon(16);try {tray = new Tray(icon);} catch (_) {@@ -468,8 +481,13 @@ function registerIpc() {const l = launcherInfo();const icoPath = path.join(store.ICON_DIR, 'apkstart.ico');if (!fs.existsSync(icoPath)) {- const ico = pngToIco(ICON_PNG);- if (ico) fs.writeFileSync(icoPath, ico);+ // 优先用随包分发的多尺寸品牌 ICO,缺失时从 Logo PNG 现算+ if (fs.existsSync(APPICON_FILE)) fs.copyFileSync(APPICON_FILE, icoPath);+ else {+ const { pngToIco } = require('./core/shortcut');+ const ico = pngToIco(ICON_PNG);+ if (ico) fs.writeFileSync(icoPath, ico);+ }}return assoc.registerAssociation(l.target, icoPath, l.args);});diff --git a/src/ui/assets/appicon.ico b/src/ui/assets/appicon.iconew file mode 100644index 0000000..7e80eacBinary files /dev/null and b/src/ui/assets/appicon.ico differdiff --git a/src/ui/assets/logo-128.png b/src/ui/assets/logo-128.pngnew file mode 100644index 0000000..d57fe63Binary files /dev/null and b/src/ui/assets/logo-128.png differdiff --git a/src/ui/assets/logo.png b/src/ui/assets/logo.pngnew file mode 100644index 0000000..401a179Binary files /dev/null and b/src/ui/assets/logo.png differdiff --git a/src/ui/index.html b/src/ui/index.htmlindex 2792a35..6d11918 100644--- a/src/ui/index.html+++ b/src/ui/index.html@@ -11,7 +11,7 @@<header class="titlebar"><div class="brand"><div class="logo" aria-hidden="true">- <svg viewBox="0 0 24 24" width="18" height="18"><rect x="1" y="1" width="22" height="22" rx="6" fill="#12161b"/><path d="M9 7.5v9l7-4.5-7-4.5z" fill="#3ddc84"/></svg>+ <img src="assets/logo.png" alt="" draggable="false" /></div><span class="brand-name">ApkStart</span><span class="brand-tag" id="engineTag">未连接运行时</span>@@ -264,6 +264,9 @@<div class="group" id="aboutGroup"><div class="group-title">关于</div><div class="about-box">+ <div class="about-brand">+ <img class="about-logo" src="assets/logo.png" alt="ApkStart Logo" draggable="false" />+ </div><div class="about-qr"><img src="assets/wechat-qr.jpg" alt="微信公众号二维码" width="112" height="112" /><span class="about-qr-tip">扫码关注公众号</span>diff --git a/src/ui/style.css b/src/ui/style.cssindex 79ba4fe..cf45cc8 100644--- a/src/ui/style.css+++ b/src/ui/style.css@@ -56,6 +56,12 @@ body {.brand { display: flex; align-items: center; gap: 8px; }.logo { display: flex; }+.logo img {+ width: 20px; height: 20px;+ border-radius: 6px;+ display: block;+ -webkit-user-drag: none;+}.brand-name { font-weight: 650; font-size: 13.5px; letter-spacing: .2px; }.brand-tag {margin-left: 4px;@@ -604,6 +610,14 @@ kbd {gap: 16px;align-items: flex-start;}+.about-brand { flex: none; }+.about-logo {+ width: 56px; height: 56px;+ border-radius: 14px;+ display: block;+ box-shadow: 0 2px 10px rgba(15, 23, 32, .18);+ -webkit-user-drag: none;+}.about-qr {display: flex;flex-direction: column;