mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-06-22 14:13:49 +08:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9e8758b5f2 | |||
| e84c1d86bf | |||
| e39525901e | |||
| 8e8617218a | |||
| 97f49201b7 | |||
| f62665cd73 |
@@ -26,6 +26,7 @@ linux:
|
|||||||
Categories: "System;"
|
Categories: "System;"
|
||||||
mimeTypes:
|
mimeTypes:
|
||||||
- "x-scheme-handler/spk"
|
- "x-scheme-handler/spk"
|
||||||
|
- "x-scheme-handler/apt"
|
||||||
target:
|
target:
|
||||||
- "AppImage"
|
- "AppImage"
|
||||||
- "deb"
|
- "deb"
|
||||||
|
|||||||
@@ -390,6 +390,7 @@ async function processNextInQueue() {
|
|||||||
const aria2Args = [
|
const aria2Args = [
|
||||||
`--dir=${downloadDir}`,
|
`--dir=${downloadDir}`,
|
||||||
"--allow-overwrite=true",
|
"--allow-overwrite=true",
|
||||||
|
"--async-dns=false",
|
||||||
"--summary-interval=1",
|
"--summary-interval=1",
|
||||||
"--connect-timeout=10",
|
"--connect-timeout=10",
|
||||||
"--timeout=15",
|
"--timeout=15",
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ export const downloadPackage = async ({
|
|||||||
const aria2Args = [
|
const aria2Args = [
|
||||||
`--dir=${downloadDir}`,
|
`--dir=${downloadDir}`,
|
||||||
"--allow-overwrite=true",
|
"--allow-overwrite=true",
|
||||||
|
"--async-dns=false",
|
||||||
"--summary-interval=1",
|
"--summary-interval=1",
|
||||||
"--connect-timeout=10",
|
"--connect-timeout=10",
|
||||||
"--timeout=15",
|
"--timeout=15",
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class ListenersMap {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const protocols = ["spk"];
|
const protocols = ["spk", "apt"];
|
||||||
const listeners = new ListenersMap();
|
const listeners = new ListenersMap();
|
||||||
|
|
||||||
export const deepLink = {
|
export const deepLink = {
|
||||||
@@ -81,6 +81,22 @@ export function handleCommandLine(commandLine: string[]) {
|
|||||||
try {
|
try {
|
||||||
const url = new URL(target);
|
const url = new URL(target);
|
||||||
|
|
||||||
|
// Handle apt:// protocol: convert to spk://search/pkgname
|
||||||
|
if (url.protocol === "apt:") {
|
||||||
|
// Format: apt://pkgname
|
||||||
|
const pkgname = url.hostname || url.pathname.split("/").filter(Boolean)[0];
|
||||||
|
if (pkgname) {
|
||||||
|
const query: Query = { pkgname };
|
||||||
|
logger.info(`Deep link: apt protocol converted to search: ${pkgname}`);
|
||||||
|
listeners.emit("search", query);
|
||||||
|
} else {
|
||||||
|
logger.warn(
|
||||||
|
`Deep link: invalid apt format, expected //pkgname, got ${target}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const action = url.hostname; // 'search'
|
const action = url.hostname; // 'search'
|
||||||
logger.info(`Deep link: action found: ${action}`);
|
logger.info(`Deep link: action found: ${action}`);
|
||||||
|
|
||||||
|
|||||||
@@ -318,6 +318,21 @@ ipcMain.handle("check-for-updates", async () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Register custom protocol handlers
|
||||||
|
if (process.defaultApp) {
|
||||||
|
if (process.argv.length >= 2) {
|
||||||
|
app.setAsDefaultProtocolClient("spk", process.execPath, [
|
||||||
|
path.resolve(process.argv[1]),
|
||||||
|
]);
|
||||||
|
app.setAsDefaultProtocolClient("apt", process.execPath, [
|
||||||
|
path.resolve(process.argv[1]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
app.setAsDefaultProtocolClient("spk");
|
||||||
|
app.setAsDefaultProtocolClient("apt");
|
||||||
|
}
|
||||||
|
|
||||||
app.whenReady().then(() => {
|
app.whenReady().then(() => {
|
||||||
// Set User-Agent for client
|
// Set User-Agent for client
|
||||||
session.defaultSession.webRequest.onBeforeSendHeaders((details, callback) => {
|
session.defaultSession.webRequest.onBeforeSendHeaders((details, callback) => {
|
||||||
|
|||||||
@@ -23,6 +23,12 @@ if ! command -v apt >/dev/null 2>&1; then
|
|||||||
ARGS="$ARGS --no-spark"
|
ARGS="$ARGS --no-spark"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# 检查是否是AOSC OS
|
||||||
|
if grep -q "ID=aosc" /etc/os-release; then
|
||||||
|
echo "检测到 AOSC OS"
|
||||||
|
ARGS="$ARGS --no-spark"
|
||||||
|
fi
|
||||||
|
|
||||||
# 注意:已移除原先针对 arm64 + wayland 添加 --disable-gpu 的逻辑,
|
# 注意:已移除原先针对 arm64 + wayland 添加 --disable-gpu 的逻辑,
|
||||||
# 现在 arm64 设备无论是否使用 wayland 均不再添加此参数。
|
# 现在 arm64 设备无论是否使用 wayland 均不再添加此参数。
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "spark-store",
|
"name": "spark-store",
|
||||||
"version": "5.1.0",
|
"version": "5.1.1",
|
||||||
"main": "dist-electron/main/index.js",
|
"main": "dist-electron/main/index.js",
|
||||||
"description": "Client for Spark App Store",
|
"description": "Client for Spark App Store",
|
||||||
"author": "elysia-best <elysia-best@simplelinux.cn.eu.org>",
|
"author": "elysia-best <elysia-best@simplelinux.cn.eu.org>",
|
||||||
|
|||||||
@@ -10,4 +10,4 @@ Keywords=appstore;
|
|||||||
Terminal=false
|
Terminal=false
|
||||||
StartupNotify=true
|
StartupNotify=true
|
||||||
StartupWMClass=spark-store
|
StartupWMClass=spark-store
|
||||||
MimeType=x-scheme-handler/spk
|
MimeType=x-scheme-handler/spk;x-scheme-handler/apt
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ void DownloadManager::startDownload(const QString &packageName, const QString &u
|
|||||||
QStringList arguments = {
|
QStringList arguments = {
|
||||||
"--enable-rpc=false",
|
"--enable-rpc=false",
|
||||||
"--console-log-level=warn",
|
"--console-log-level=warn",
|
||||||
|
"--async-dns=false",
|
||||||
"--summary-interval=1",
|
"--summary-interval=1",
|
||||||
"--allow-overwrite=true",
|
"--allow-overwrite=true",
|
||||||
"--connect-timeout=30",
|
"--connect-timeout=30",
|
||||||
|
|||||||
Reference in New Issue
Block a user