Compare commits
303 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1b71a64f00 | |||
| 23b09627f7 | |||
| 10dfe1168b | |||
| 4bee6cefea | |||
| 9af8c38cc5 | |||
| 36ec2a4e8b | |||
| 6db8e6c11a | |||
| 51e2bac641 | |||
| c061379ac2 | |||
| 7bc97e0c3a | |||
| 91040dbef7 | |||
| 033a7c07c1 | |||
| 081e284b12 | |||
| e6246b4529 | |||
| 43d4fe451d | |||
| 98ce717d53 | |||
| c3f975f0c1 | |||
| 55a62fe9ce | |||
| e49f4baa87 | |||
| 796bc1d1c7 | |||
| 74a8e5c669 | |||
| 08f593ce74 | |||
| 5338e1409a | |||
| 04db540f2c | |||
| 33efff0347 | |||
| fc91419895 | |||
| 9ad6620681 | |||
| 5b21b49e74 | |||
| 318cc780e1 | |||
| c2764636e4 | |||
| 2b06f84583 | |||
| 7175bf4e4d | |||
| bda5b7ca7a | |||
| 6afabe9eb6 | |||
| f0b337b222 | |||
| 4f73289602 | |||
| c3cd29bb66 | |||
| 1b722e78a5 | |||
| 6f9fd8e65e | |||
| fa50daf5be | |||
| 25a83c7fb8 | |||
| 8004cea8be | |||
| 585d0582b8 | |||
| e8ea4ed1a9 | |||
| 5754b3cfc2 | |||
| e0811a34bf | |||
| b157f134d4 | |||
| 35f34dd469 | |||
| 8f240db798 | |||
| c3df697ee2 | |||
| 89fb73ae0c | |||
| 47dea9b388 | |||
| 01d2a2f1d8 | |||
| c6b1bcf4a8 | |||
| 207d42153f | |||
| 2257b3943c | |||
| a285c02cc9 | |||
| bd2a0ba726 | |||
| 3036749c69 | |||
| 2459224c7e | |||
| 7b26c6dd9c | |||
| 0f82cc54d0 | |||
| 35a1170bd5 | |||
| b461729fa5 | |||
| 975e3f6afb | |||
| b7bf70e402 | |||
| 7387f8af95 | |||
| ba1be0deb3 | |||
| 4951fc7dd1 | |||
| de0f7c4df1 | |||
| 642f658230 | |||
| 249ac1d4fd | |||
| d8a37114eb | |||
| 5c44ee7226 | |||
| 4d00b0bec8 | |||
| 7132ae0b42 | |||
| 93d443deeb | |||
| 3114d3b23d | |||
| 6c8c257765 | |||
| c8dc09ef7e | |||
| c66930f9a3 | |||
| eeb74c0a1c | |||
| 39887285de | |||
| 1cc49dcaf0 | |||
| be6fb10019 | |||
| 161b268c24 | |||
| c89e30e0e4 | |||
| 6b67f0ec0a | |||
| 4355d8d819 | |||
| c0811ef6d2 | |||
| b3cd99ac51 | |||
| a44131b9c8 | |||
| 95ee0f5381 | |||
| 6799dff2c5 | |||
| c804ae3ab7 | |||
| a78ee36ae7 | |||
| 84c5897d9b | |||
| f07ca5aac0 | |||
| 62da824263 | |||
| 083674f6a5 | |||
| ff97cd2769 | |||
| 964231a77f | |||
| a7e45d37da | |||
| dcfb57f2a7 | |||
| 72935c3f09 | |||
| 7fe53e8caa | |||
| 8ca073b849 | |||
| 6a0d6ad822 | |||
| 3c22d7cf5f | |||
| bc97519124 | |||
| 286f34f3f8 | |||
| c02a1f01f7 | |||
| c92bc86716 | |||
| e5217b3829 | |||
| 514848c09f | |||
| d7f90c80bd | |||
| dd11831dfa | |||
| ef38755e74 | |||
| 42f7b44945 | |||
| c5a6125fd6 | |||
| ae459373dc | |||
| 3e6cb43b2a | |||
| 52e6888b9d | |||
| 85ca5dfb86 | |||
| ebe9187ca8 | |||
| 76a5d7313b | |||
| 1797fccc2c | |||
| d60390e83c | |||
| 02d63a349e | |||
| 949f3f402d | |||
| edfe2512b0 | |||
| 8ea38112d2 | |||
| c54c83834f | |||
| 00f296e971 | |||
| 411efd79bb | |||
| 9a14b38d14 | |||
| a2018df6fa | |||
| e60d2740d8 | |||
| 1dc50be61c | |||
| 655d562bac | |||
| f06d17c57a | |||
| 2367137dc5 | |||
| 2b62cc7677 | |||
| 77dde49653 | |||
| 31575a4a35 | |||
| 934fe22402 | |||
| 3c0356430f | |||
| a061170957 | |||
| ad675a92dd | |||
| 364a87fd44 | |||
| 5c510ab81c | |||
| cfa8e04755 | |||
| de581fd000 | |||
| 25a1df8bd9 | |||
| ad5705405a | |||
| 5456de8613 | |||
| c92f275a6b | |||
| 7adf7ac4d7 | |||
| 9bbcfd4a94 | |||
| 6f66cd664d | |||
| 03b053bcc0 | |||
| 266be7146d | |||
| a79d76067e | |||
| 8e84fa9d64 | |||
| 1573ed677d | |||
| 135a78f4c8 | |||
| 9f78ca5190 | |||
| 7ac6677b2d | |||
| ec582508a9 | |||
| fd431cba2b | |||
| 5ece84cefb | |||
| dac56a0ec5 | |||
| a9ed97a1d6 | |||
| df19d6b8cc | |||
| 84478ef1ff | |||
| 270f937476 | |||
| fdc1f2cdbd | |||
| cddb8532fe | |||
| bb2f9453e3 | |||
| bdd8a93edc | |||
| c73f375daf | |||
| 9391171713 | |||
| feb1e61d90 | |||
| 503111f111 | |||
| 9ef3f3d264 | |||
| 7fbc480776 | |||
| d2f89b9a52 | |||
| 528ddd7e40 | |||
| 67ecf0bc75 | |||
| d262d2f81a | |||
| 4018e526c6 | |||
| bd5691947a | |||
| 9ff98eb33e | |||
| 04dbf51d48 | |||
| ff7af42ef9 | |||
| 5200c0940c | |||
| d0b295652b | |||
| c16bfeebb2 | |||
| 2688e2e849 | |||
| 30840d0865 | |||
| 772cc261c8 | |||
| 7c5745f7ce | |||
| 01aa9bc281 | |||
| 70fe7f5da9 | |||
| 1efc83817b | |||
| 8f6e6a9f37 | |||
| 1f5a58e3c2 | |||
| 958af61a1c | |||
| 6ef7bb9e5e | |||
| 0964ae5cc7 | |||
| 0906adc49e | |||
| 6ceb7490aa | |||
| 27d76429c5 | |||
| 966b0533d2 | |||
| 29c1bc4194 | |||
| 118a6403bf | |||
| c45d09f099 | |||
| bc7e6bdb95 | |||
| 1c43f11645 | |||
| c9f0ac7c5e | |||
| 73af595774 | |||
| c93cc11843 | |||
| 0e235e37fe | |||
| 6fbec7be2f | |||
| 14720c064c | |||
| 963289355c | |||
| d75c3a6453 | |||
| 61b6758204 | |||
| 3be5f359ca | |||
| df91a411d3 | |||
| b379207542 | |||
| 736d9abb04 | |||
| 1c40908031 | |||
| e5a5c70afb | |||
| 63bb580eb9 | |||
| 663d3d88fb | |||
| 97224aecdd | |||
| aba941ba90 | |||
| a08e9b8c41 | |||
| d786f64645 | |||
| af6c8c87ea | |||
| 006171a86b | |||
| d3f2d236c5 | |||
|
|
eb46a23323 | ||
| e9c143309b | |||
| 08328c7480 | |||
|
|
ce0af27826 | ||
| bf2c315e77 | |||
| 820e3cb94c | |||
| 1ad44ed5c4 | |||
| 55b81a1393 | |||
| aa3d14a45b | |||
| 09e326b670 | |||
| 4df81c6438 | |||
| d1a2f8ffa9 | |||
| e87896db22 | |||
| f8e0cf41e7 | |||
| 3c248d5332 | |||
| 5e87deb8d1 | |||
|
|
d6f9957e86 | ||
|
|
b332212615 | ||
| 0f8634a8cf | |||
| 4f2de2e28a | |||
| e015666b96 | |||
| 99db2c4ab9 | |||
| 9c5b6549ff | |||
| daf784609b | |||
| f044278a48 | |||
| 1156090ed0 | |||
| a6b3a1871f | |||
| fb3343dca8 | |||
| 89c13f758b | |||
| 6724c54287 | |||
| 379d3ebcfb | |||
| c1c7620d6f | |||
| 42b5b33d99 | |||
| 710acf793b | |||
| 72bb574c8e | |||
| 7ba41fec50 | |||
| af24df4525 | |||
| 6272bd6178 | |||
| 2eb5cd9836 | |||
| e7f41a3d3f | |||
| 93e2c6bee6 | |||
| 53df0b7ba6 | |||
| 92ecddedf4 | |||
| 2b2a094d1f | |||
| 3628285a8f | |||
| f855b4dc33 | |||
| 6201c79069 | |||
| 11ecf1ca41 | |||
| eadd74b71c | |||
| 44889c03d3 | |||
|
|
f75a0f4c82 | ||
|
|
3fd9c573fc | ||
|
|
66e8a83ee0 | ||
| 3323dce97f | |||
| d24004dcea | |||
| 21ffcc166e | |||
| bdcd504eb0 | |||
| 460abbca89 | |||
| 7761310558 | |||
| 01b04286a6 |
13
.github/workflows/program-builder.yml
vendored
@@ -1,13 +0,0 @@
|
|||||||
name: Building Program
|
|
||||||
run-name: Building ${{ GITHUB.REPOSITORY }}
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- "*"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
call:
|
|
||||||
uses: GXDE-OS/GXDE/.github/workflows/building-deb.yml@master
|
|
||||||
secrets: inherit
|
|
||||||
22
.gitignore
vendored
@@ -6,6 +6,7 @@
|
|||||||
*.la
|
*.la
|
||||||
*.lai
|
*.lai
|
||||||
*.so
|
*.so
|
||||||
|
*.so.*
|
||||||
*.dll
|
*.dll
|
||||||
*.dylib
|
*.dylib
|
||||||
|
|
||||||
@@ -28,13 +29,12 @@ ui_*.h
|
|||||||
*.jsc
|
*.jsc
|
||||||
Makefile*
|
Makefile*
|
||||||
*build-*
|
*build-*
|
||||||
|
*.qm
|
||||||
|
*.prl
|
||||||
|
|
||||||
# Qt unit tests
|
# Qt unit tests
|
||||||
target_wrapper.*
|
target_wrapper.*
|
||||||
|
|
||||||
# Qt qm files
|
|
||||||
translations/*.qm
|
|
||||||
|
|
||||||
# QtCreator
|
# QtCreator
|
||||||
*.autosave
|
*.autosave
|
||||||
|
|
||||||
@@ -44,13 +44,23 @@ translations/*.qm
|
|||||||
|
|
||||||
# QtCreator CMake
|
# QtCreator CMake
|
||||||
CMakeLists.txt.user*
|
CMakeLists.txt.user*
|
||||||
build
|
|
||||||
|
|
||||||
# Debian dpkg-buildpackage
|
# QtCreator 4.8< compilation database
|
||||||
|
compile_commands.json
|
||||||
|
|
||||||
|
# QtCreator local machine specific files for imported projects
|
||||||
|
*creator.user*
|
||||||
|
|
||||||
|
*_qmlcache.qrc
|
||||||
|
|
||||||
|
# debian
|
||||||
debian/*.debhelper*
|
debian/*.debhelper*
|
||||||
debian/files
|
debian/files
|
||||||
debian/*.substvars
|
debian/*.substvars
|
||||||
debian/spark-store
|
debian/spark-store
|
||||||
|
|
||||||
.vscode/*
|
# Others
|
||||||
|
build
|
||||||
obj-*
|
obj-*
|
||||||
|
.vscode
|
||||||
|
.cache
|
||||||
@@ -18,28 +18,22 @@ stages:
|
|||||||
name: execute_by_docker
|
name: execute_by_docker
|
||||||
displayName: 基于镜像的DTK构建
|
displayName: 基于镜像的DTK构建
|
||||||
certificate: ''
|
certificate: ''
|
||||||
image: docker.jianmuhub.com/library/debian:buster
|
image: docker.io/debian:buster
|
||||||
command:
|
command:
|
||||||
- sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
|
- sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
|
||||||
- '# 换源'
|
- '# 换源'
|
||||||
- apt update
|
- apt update
|
||||||
- export DEBIAN_FRONTEND=noninteractive
|
- export DEBIAN_FRONTEND=noninteractive
|
||||||
- echo "安装依赖..."
|
- echo "安装git devscripts equivs curl..."
|
||||||
- 'apt install libgsettings-qt-dev -y '
|
- 'apt install git devscripts equivs curl -y '
|
||||||
- 'apt install debhelper git curl fakeroot qtbase5-dev zlib1g-dev qt5-default -y '
|
|
||||||
- git clone https://gitlink.org.cn/shenmo7192/dtk-old-bundle.git
|
- git clone https://gitlink.org.cn/shenmo7192/dtk-old-bundle.git
|
||||||
- cd dtk-old-bundle
|
- cd dtk-old-bundle
|
||||||
- apt install ./*.deb -y
|
- apt install ./*.deb -y
|
||||||
- cd ..
|
- cd ..
|
||||||
- rm -rf dtk-old-bundle
|
- rm -rf dtk-old-bundle
|
||||||
- ''
|
- ''
|
||||||
- '#mk-build-deps --install --tool "apt-get -o Debug::pkgProblemResolver=yes -y" '
|
- 'mk-build-deps --install --tool "apt-get -o Debug::pkgProblemResolver=yes -y" '
|
||||||
- apt build-dep . -y
|
- dpkg-buildpackage -j2 -b -us -uc
|
||||||
- strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
|
|
||||||
- uname -a
|
|
||||||
- sed -i 's/dh \$@ --parallel/dh \$@/' debian/rules
|
|
||||||
- '# Gitee的配置太低了'
|
|
||||||
- dpkg-buildpackage -b -us -uc
|
|
||||||
- cd ..
|
- cd ..
|
||||||
- ls -all
|
- ls -all
|
||||||
- pwd
|
- pwd
|
||||||
|
|||||||
44
CMakeLists.txt
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.12)
|
||||||
|
|
||||||
|
project(spark-store)
|
||||||
|
|
||||||
|
if(NOT DEFINED VERSION)
|
||||||
|
set(VERSION 4.0.0)
|
||||||
|
endif()
|
||||||
|
add_compile_definitions(APP_VERSION="${VERSION}")
|
||||||
|
|
||||||
|
execute_process(
|
||||||
|
COMMAND git symbolic-ref --short -q HEAD
|
||||||
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
|
OUTPUT_VARIABLE BRANCH
|
||||||
|
)
|
||||||
|
string(STRIP "${BRANCH}" BRANCH)
|
||||||
|
add_compile_definitions(APP_BRANCH="${BRANCH}")
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
set(CMAKE_AUTORCC ON)
|
||||||
|
set(CMAKE_AUTOUIC ON)
|
||||||
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
set(AUTOMOC_COMPILER_PREDEFINES ON)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall")
|
||||||
|
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "sw_64")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mieee")
|
||||||
|
endif ()
|
||||||
|
if (NOT ${CMAKE_BUILD_TYPE} MATCHES "Debug")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
add_compile_definitions(QT_MESSAGELOGCONTEXT)
|
||||||
|
|
||||||
|
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||||
|
set(CMAKE_INSTALL_PREFIX /usr)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
|
add_subdirectory(src)
|
||||||
|
add_subdirectory(translations)
|
||||||
|
add_subdirectory(spark-update-tool)
|
||||||
41
EULA
@@ -1,41 +0,0 @@
|
|||||||
星火开源软件协议(Spark Opensource LICENSE)
|
|
||||||
|
|
||||||
版权所有 (C) 2023 星火社区
|
|
||||||
|
|
||||||
根据 GNU 通用公共许可证第三版(GPL v3),本软件是自由软件,您可以修改和再发布它。但是,为了维护原作者的权益并保护社区用户的权益,请遵守以下条款:
|
|
||||||
|
|
||||||
1. 对本仓库下的所有文件生效:本许可证适用于本仓库(或项目)下的所有文件。任何使用、修改或再发布本软件的个人或组织都必须遵守本许可证。
|
|
||||||
2. 版权声明和许可证文件:您不得移除、隐藏或更改本软件中包含的原作者的版权声明和许可证文件。保留原作者的权益信息对于维护开源软件生态系统至关重要。
|
|
||||||
3. 版本标注: 如果您对本软件做出修改并再发布,您必须在醒目位置标注此版本并非星火社区官方提供。这样可以避免误导使用者认为该软件为星火社区官方提供的版本。此软件仅授权用于个人非盈利用途,任何将其用于商业目的或在盈利性组织中使用的行为均需事先获得星火社区的书面许可。
|
|
||||||
4. 商标使用:您不得在再发布版本中使用“星火应用商店”、“Spark Store”或星火应用商店的Logo等可能误导使用者此软件由星火社区官方提供的信息。
|
|
||||||
5. 服务条款:您使用星火商店软件的行为将被视为您同意星火在不侵犯您隐私的前提下搜集版本、日志等信息,以便于星火社区更好地为您提供服务。
|
|
||||||
6. 仓库版权条款:为了更好的提供持续性服务,星火仅对个人用户免费开放服务仓库,如您或您的组织需要提供商业服务或者您的组织为盈利性组织,请联系星火社区获取商业授权。
|
|
||||||
7. 禁止恶意行为和批量爬取: 用户或组织在使用本软件时,严禁进行任何形式的恶意行为,包括但不限于恶意攻击、滥用、破坏、批量爬取软件仓库等。恶意行为的定义由星火社区自行判断,违反者将被追究法律责任。
|
|
||||||
8. 分发与再分发权利: 星火社区保留对其制作的软件包的分发权利。未经明确授权,禁止任何个人或组织将星火社区软件包用于商业目的或在未获得星火社区许可的情况下进行再分发。此条款旨在确保开源精神的同时,维护星火社区的知识产权。
|
|
||||||
9. 商业应用限制:您不得使用本软件的代码开发商业应用,也不得在商业应用中使用本软件的代码,除非获得星火社区和火穗(沈阳)计算机软件开发有限公司的书面许可。
|
|
||||||
10. 其他条款:除上述约定外,若您使用了星火商店的主程序或其部分代码,您应遵守 GPL v3 的所有其他条款和要求。若本协议条款的内容与GPL V3中的内容不同的,以本协议条款为准
|
|
||||||
11. 其他约定:本许可以简体中文版本为最准确释义
|
|
||||||
|
|
||||||
GPLV3许可证的完整文本可以在以下链接找到:https://www.gnu.org/licenses/gpl-3.0.html
|
|
||||||
|
|
||||||
---------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
Spark Opensource LICENSE
|
|
||||||
|
|
||||||
Copyright (C) 2023 The Spark Community
|
|
||||||
|
|
||||||
This software is free software; you can modify and redistribute it under the terms of the GNU General Public License version 3 (GPL v3). However, to protect the rights of the original authors and the interests of the community users, please adhere to the following terms:
|
|
||||||
|
|
||||||
1. Applicability to all files in this repository: This license applies to all files in this repository (or project). Any individuals or organizations that use, modify, or redistribute this software must comply with this license.
|
|
||||||
2. Copyright notice and license files: You must not remove, hide, or modify the copyright notice and license files of the original authors included in this software. Preserving the rights information of the original authors is essential for maintaining the open-source software ecosystem.
|
|
||||||
3. Version annotation: If you modify and redistribute this software, you must mark in a prominent position that this version is not officially provided by the Spark community. This avoids misleading users into thinking that the software is an official version provided by the Spark community. This software is licensed for personal, non-profit use only, and any use of it for commercial purposes or in for-profit organizations requires the prior written permission of the Spark Community.
|
|
||||||
4. Trademark usage: You are not allowed to use terms such as "Spark App Store," "Spark Store," or the logo of Spark App Store in redistributed versions, as they may mislead users into believing that the software is provided by the official Spark community.
|
|
||||||
5. Terms of Service: Your use of the software of Spark Store will be deemed as your consent to collect version, log and other information on the premise of not violating your privacy, so as to facilitate the Spark community to provide you with better services.
|
|
||||||
6. Warehouse copyright terms: In order to better provide continuous services, Spark is only free for individual users to open the service warehouse, if you or your organization needs to provide commercial services or your organization is a for-profit organization, please contact Spark community to obtain commercial authorization.
|
|
||||||
7. Prohibited malicious behavior and mass crawling: Users or organizations are strictly prohibited to engage in any form of malicious behavior when using the software, including but not limited to malicious attacks, abuse, destruction, and mass crawling of software warehouses. The definition of malicious behavior is judged by the Spark community, and violators will be held legally responsible.
|
|
||||||
8. Distribution and redistribution rights: Spark Community reserves the right to distribute the software packages it produces. Any person or organization is prohibited from using the Spark Community software package for commercial purposes or redistributing it without the express authorization of the Spark Community. This clause is intended to ensure the spirit of open source while safeguarding the intellectual property rights of the Spark community.
|
|
||||||
9. Business Application Restriction: You are not permitted to utilize the code of this software for developing commercial applications, nor are you allowed to integrate the code of this software into commercial applications without obtaining written consent from both the Spark Community and Flamescion (Shenyang) Computer Software Development Co., Ltd.
|
|
||||||
10. Other Terms: In addition to the above provisions, if you use the main program or any part of the code of Spark Store, you must comply with all other terms and requirements of GPL v3. In case of any inconsistency between the terms of this agreement and those of GPL v3, the terms of this agreement shall prevail.
|
|
||||||
11. Additional Agreements: This license shall be interpreted most accurately in its Simplified Chinese version.
|
|
||||||
|
|
||||||
You can find the full text of GPLV3 license at: https://www.gnu.org/licenses/gpl-3.0.html
|
|
||||||
695
LICENSE
@@ -1,674 +1,41 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
星火开源软件协议(Spark Opensource LICENSE)
|
||||||
Version 3, 29 June 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
版权所有 (C) 2023 星火社区
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
根据 GNU 通用公共许可证第三版(GPL v3),本软件是自由软件,您可以修改和再发布它。但是,为了维护原作者的权益并保护社区用户的权益,请遵守以下条款:
|
||||||
|
|
||||||
The GNU General Public License is a free, copyleft license for
|
1. 对本仓库下的所有文件生效:本许可证适用于本仓库(或项目)下的所有文件。任何使用、修改或再发布本软件的个人或组织都必须遵守本许可证。
|
||||||
software and other kinds of works.
|
2. 版权声明和许可证文件:您不得移除、隐藏或更改本软件中包含的原作者的版权声明和许可证文件。保留原作者的权益信息对于维护开源软件生态系统至关重要。
|
||||||
|
3. 版本标注: 如果您对本软件做出修改并再发布,您必须在醒目位置标注此版本并非星火社区官方提供。这样可以避免误导使用者认为该软件为星火社区官方提供的版本。此软件仅授权用于个人非盈利用途,任何将其用于商业目的或在盈利性组织中使用的行为均需事先获得星火社区的书面许可。
|
||||||
|
4. 商标使用:您不得在再发布版本中使用“星火应用商店”、“Spark Store”或星火应用商店的Logo等可能误导使用者此软件由星火社区官方提供的信息。
|
||||||
|
5. 服务条款:您使用星火商店软件的行为将被视为您同意星火在不侵犯您隐私的前提下搜集版本、日志等信息,以便于星火社区更好地为您提供服务。
|
||||||
|
6. 仓库版权条款:为了更好的提供持续性服务,星火仅对个人用户免费开放服务仓库,如您或您的组织需要提供商业服务或者您的组织为盈利性组织,请联系星火社区获取商业授权。
|
||||||
|
7. 禁止恶意行为和批量爬取: 用户或组织在使用本软件时,严禁进行任何形式的恶意行为,包括但不限于恶意攻击、滥用、破坏、批量爬取软件仓库等。恶意行为的定义由星火社区自行判断,违反者将被追究法律责任。
|
||||||
|
8. 分发与再分发权利: 星火社区保留对其制作的软件包的分发权利。未经明确授权,禁止任何个人或组织将星火社区软件包用于商业目的或在未获得星火社区许可的情况下进行再分发。此条款旨在确保开源精神的同时,维护星火社区的知识产权。
|
||||||
|
9. 商业应用限制:您不得使用本软件的代码开发商业应用,也不得在商业应用中使用本软件的代码,除非获得星火社区和火穗(沈阳)计算机软件开发有限公司的书面许可。
|
||||||
|
10. 其他条款:除上述约定外,若您使用了星火商店的主程序或其部分代码,您应遵守 GPL v3 的所有其他条款和要求。若本协议条款的内容与GPL V3中的内容不同的,以本协议条款为准
|
||||||
|
11. 其他约定:本许可以简体中文版本为最准确释义
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
GPLV3许可证的完整文本可以在以下链接找到:https://www.gnu.org/licenses/gpl-3.0.html
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
the GNU General Public License is intended to guarantee your freedom to
|
|
||||||
share and change all versions of a program--to make sure it remains free
|
|
||||||
software for all its users. We, the Free Software Foundation, use the
|
|
||||||
GNU General Public License for most of our software; it applies also to
|
|
||||||
any other work released this way by its authors. You can apply it to
|
|
||||||
your programs, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
---------------------------------------------------------------------------------------------------------------------------------
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to prevent others from denying you
|
Spark Opensource LICENSE
|
||||||
these rights or asking you to surrender the rights. Therefore, you have
|
|
||||||
certain responsibilities if you distribute copies of the software, or if
|
|
||||||
you modify it: responsibilities to respect the freedom of others.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
Copyright (C) 2023 The Spark Community
|
||||||
gratis or for a fee, you must pass on to the recipients the same
|
|
||||||
freedoms that you received. You must make sure that they, too, receive
|
|
||||||
or can get the source code. And you must show them these terms so they
|
|
||||||
know their rights.
|
|
||||||
|
|
||||||
Developers that use the GNU GPL protect your rights with two steps:
|
This software is free software; you can modify and redistribute it under the terms of the GNU General Public License version 3 (GPL v3). However, to protect the rights of the original authors and the interests of the community users, please adhere to the following terms:
|
||||||
(1) assert copyright on the software, and (2) offer you this License
|
|
||||||
giving you legal permission to copy, distribute and/or modify it.
|
|
||||||
|
|
||||||
For the developers' and authors' protection, the GPL clearly explains
|
1. Applicability to all files in this repository: This license applies to all files in this repository (or project). Any individuals or organizations that use, modify, or redistribute this software must comply with this license.
|
||||||
that there is no warranty for this free software. For both users' and
|
2. Copyright notice and license files: You must not remove, hide, or modify the copyright notice and license files of the original authors included in this software. Preserving the rights information of the original authors is essential for maintaining the open-source software ecosystem.
|
||||||
authors' sake, the GPL requires that modified versions be marked as
|
3. Version annotation: If you modify and redistribute this software, you must mark in a prominent position that this version is not officially provided by the Spark community. This avoids misleading users into thinking that the software is an official version provided by the Spark community. This software is licensed for personal, non-profit use only, and any use of it for commercial purposes or in for-profit organizations requires the prior written permission of the Spark Community.
|
||||||
changed, so that their problems will not be attributed erroneously to
|
4. Trademark usage: You are not allowed to use terms such as "Spark App Store," "Spark Store," or the logo of Spark App Store in redistributed versions, as they may mislead users into believing that the software is provided by the official Spark community.
|
||||||
authors of previous versions.
|
5. Terms of Service: Your use of the software of Spark Store will be deemed as your consent to collect version, log and other information on the premise of not violating your privacy, so as to facilitate the Spark community to provide you with better services.
|
||||||
|
6. Warehouse copyright terms: In order to better provide continuous services, Spark is only free for individual users to open the service warehouse, if you or your organization needs to provide commercial services or your organization is a for-profit organization, please contact Spark community to obtain commercial authorization.
|
||||||
|
7. Prohibited malicious behavior and mass crawling: Users or organizations are strictly prohibited to engage in any form of malicious behavior when using the software, including but not limited to malicious attacks, abuse, destruction, and mass crawling of software warehouses. The definition of malicious behavior is judged by the Spark community, and violators will be held legally responsible.
|
||||||
|
8. Distribution and redistribution rights: Spark Community reserves the right to distribute the software packages it produces. Any person or organization is prohibited from using the Spark Community software package for commercial purposes or redistributing it without the express authorization of the Spark Community. This clause is intended to ensure the spirit of open source while safeguarding the intellectual property rights of the Spark community.
|
||||||
|
9. Business Application Restriction: You are not permitted to utilize the code of this software for developing commercial applications, nor are you allowed to integrate the code of this software into commercial applications without obtaining written consent from both the Spark Community and Flamescion (Shenyang) Computer Software Development Co., Ltd.
|
||||||
|
10. Other Terms: In addition to the above provisions, if you use the main program or any part of the code of Spark Store, you must comply with all other terms and requirements of GPL v3. In case of any inconsistency between the terms of this agreement and those of GPL v3, the terms of this agreement shall prevail.
|
||||||
|
11. Additional Agreements: This license shall be interpreted most accurately in its Simplified Chinese version.
|
||||||
|
|
||||||
Some devices are designed to deny users access to install or run
|
You can find the full text of GPLV3 license at: https://www.gnu.org/licenses/gpl-3.0.html
|
||||||
modified versions of the software inside them, although the manufacturer
|
|
||||||
can do so. This is fundamentally incompatible with the aim of
|
|
||||||
protecting users' freedom to change the software. The systematic
|
|
||||||
pattern of such abuse occurs in the area of products for individuals to
|
|
||||||
use, which is precisely where it is most unacceptable. Therefore, we
|
|
||||||
have designed this version of the GPL to prohibit the practice for those
|
|
||||||
products. If such problems arise substantially in other domains, we
|
|
||||||
stand ready to extend this provision to those domains in future versions
|
|
||||||
of the GPL, as needed to protect the freedom of users.
|
|
||||||
|
|
||||||
Finally, every program is threatened constantly by software patents.
|
|
||||||
States should not allow patents to restrict development and use of
|
|
||||||
software on general-purpose computers, but in those that do, we wish to
|
|
||||||
avoid the special danger that patents applied to a free program could
|
|
||||||
make it effectively proprietary. To prevent this, the GPL assures that
|
|
||||||
patents cannot be used to render the program non-free.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Use with the GNU Affero General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU Affero General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the special requirements of the GNU Affero General Public License,
|
|
||||||
section 13, concerning interaction through a network will apply to the
|
|
||||||
combination as such.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU General Public License from time to time. Such new versions will
|
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Program specifies that a certain numbered version of the GNU General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
||||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
||||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
||||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
||||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
||||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
state the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If the program does terminal interaction, make it output a short
|
|
||||||
notice like this when it starts in an interactive mode:
|
|
||||||
|
|
||||||
<program> Copyright (C) <year> <name of author>
|
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
||||||
This is free software, and you are welcome to redistribute it
|
|
||||||
under certain conditions; type `show c' for details.
|
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
||||||
parts of the General Public License. Of course, your program's commands
|
|
||||||
might be different; for a GUI interface, you would use an "about box".
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
||||||
For more information on this, and how to apply and follow the GNU GPL, see
|
|
||||||
<http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
The GNU General Public License does not permit incorporating your program
|
|
||||||
into proprietary programs. If your program is a subroutine library, you
|
|
||||||
may consider it more useful to permit linking proprietary applications with
|
|
||||||
the library. If this is what you want to do, use the GNU Lesser General
|
|
||||||
Public License instead of this License. But first, please read
|
|
||||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
|
||||||
674
LICENSE-GPL3
Normal file
@@ -0,0 +1,674 @@
|
|||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
<program> Copyright (C) <year> <name of author>
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, your program's commands
|
||||||
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your program
|
||||||
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License. But first, please read
|
||||||
|
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||||
25
README.md
@@ -43,14 +43,23 @@ If you have software packages to submit, please [click here to contribute](https
|
|||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
- [Read the Copyright Notice](#read-the-copyright-notice)
|
- [Spark Store](#spark-store)
|
||||||
- [Determine Your System Architecture](#determine-your-system-architecture)
|
- [Introduction](#introduction)
|
||||||
- [System Support and Installation Instructions](#system-support-and-installation-instructions)
|
- [About Team Collaboration](#about-team-collaboration)
|
||||||
- [For deepin Users](#for-deepin-users)
|
- [Table of Contents](#table-of-contents)
|
||||||
- [For Ubuntu Users](#for-ubuntu-users)
|
- [Read the Copyright Notice](#read-the-copyright-notice)
|
||||||
- [For Debian Users](#for-debian-users)
|
- [Determine Your System Architecture](#determine-your-system-architecture)
|
||||||
- [Frequently Asked Questions (FAQ)](#frequently-asked-questions-faq)
|
- [System Support and Installation Instructions](#system-support-and-installation-instructions)
|
||||||
- [Contact and Feedback](#contact-and-feedback)
|
- [For deepin Users](#for-deepin-users)
|
||||||
|
- [For deepin Users](#for-deepin-users-1)
|
||||||
|
- [For Ubuntu Users](#for-ubuntu-users)
|
||||||
|
- [For Ubuntu 20.04 Users](#for-ubuntu-2004-users)
|
||||||
|
- [For Ubuntu 22.04 and Newer Ubuntu Versions](#for-ubuntu-2204-and-newer-ubuntu-versions)
|
||||||
|
- [For Debian Users](#for-debian-users)
|
||||||
|
- [For Debian 11 Users](#for-debian-11-users)
|
||||||
|
- [For Debian 12+ Users](#for-debian-12-users)
|
||||||
|
- [Frequently Asked Questions (FAQ)](#frequently-asked-questions-faq)
|
||||||
|
- [Contact and Feedback](#contact-and-feedback)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -112,9 +112,6 @@ https://github.com/spark-store-project/spark-store
|
|||||||
cd ~/Downloads
|
cd ~/Downloads
|
||||||
sudo apt install ./spark-store*.deb
|
sudo apt install ./spark-store*.deb
|
||||||
```
|
```
|
||||||
2. **使用更新器**
|
|
||||||
您可以在应用商店左下角找到更新按钮,点击即可查看更新列表。
|
|
||||||
|
|
||||||
|
|
||||||
### 对于 Ubuntu 用户
|
### 对于 Ubuntu 用户
|
||||||
|
|
||||||
@@ -189,6 +186,7 @@ https://github.com/spark-store-project/spark-store
|
|||||||
|
|
||||||
对于高级用户,如需自定义配置 aptss config,请参阅 [aptss 软件仓库](https://gitee.com/GXDE-OS/aptss)。
|
对于高级用户,如需自定义配置 aptss config,请参阅 [aptss 软件仓库](https://gitee.com/GXDE-OS/aptss)。
|
||||||
|
|
||||||
|
对于星火更新器,请参阅[Spark-Update-Tool](https://gitee.com/spark-store-project/Spark-Update-Tool)
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
32
debian/changelog
vendored
@@ -1,16 +1,40 @@
|
|||||||
spark-store (4.8.1) UNRELEASED; urgency=medium
|
spark-store (4.8.3) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
* 修复更新器安装软件完成后仍然显示下载完成的问题
|
* 更新软件主图标
|
||||||
|
* 软件更新器更新成功后删除软件包
|
||||||
|
* 修复:首次安装ACE环境情况下无法正确配置ACE中aptss的问题
|
||||||
|
* 修复:使用aptss后在/tmp下留下垃圾的问题
|
||||||
|
* aptss 更新,支持在APM下使用
|
||||||
|
* 更新器添加忽略功能
|
||||||
|
* 修复:更新器在更新完成后删除软件包时,未删除软件包的问题
|
||||||
|
* 修复:更新器初始化窗口过大的问题
|
||||||
|
|
||||||
-- momen <vmomenv@gmail.com> Tue, 28 Aug 2025 01:03:08 +0800
|
-- momen <vmomenv@gmail.com> Tue, 28 Aug 2025 01:03:08 +0800
|
||||||
|
|
||||||
|
spark-store (4.8.3-1) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
|
* 更新软件主图标
|
||||||
|
* 软件更新器更新成功后删除软件包
|
||||||
|
* 修复:首次安装ACE环境情况下无法正确配置ACE中aptss的问题
|
||||||
|
* 修复:使用aptss后在/tmp下留下垃圾的问题
|
||||||
|
* aptss 更新,支持在APM下使用
|
||||||
|
|
||||||
|
-- momen <vmomenv@gmail.com> Tue, 28 Aug 2025 01:03:08 +0800
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
spark-store (4.8.1-1) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
|
* 修复了更新器安装完成后显示下载完成的bug
|
||||||
|
|
||||||
|
-- momen <vmomenv@gmail.com> Fri, 29 Aug 2025 01:03:08 +0800
|
||||||
|
|
||||||
spark-store (4.8.1~test1) UNRELEASED; urgency=medium
|
spark-store (4.8.1~test1) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
* 添加全新的更新器
|
* 添加全新的更新器
|
||||||
* 替换了新版更新器的polkit policy
|
* 替换了新版更新器的polkit policy
|
||||||
|
|
||||||
-- momen <vmomenv@gmail.com> Tue, 15 Jul 2025 01:03:08 +0800
|
-- momen <vmomenv@gmail.com> Tue, 15 Jul 2025 01:03:08 +0800
|
||||||
|
|
||||||
spark-store (4.8.0) UNRELEASED; urgency=medium
|
spark-store (4.8.0) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
* ssinstall重写,支持安装到ACE和自动安装到ACE,支持只允许安装到本地
|
* ssinstall重写,支持安装到ACE和自动安装到ACE,支持只允许安装到本地
|
||||||
|
|||||||
24
debian/control
vendored
@@ -3,16 +3,18 @@ Maintainer: shenmo <shenmo@spark-app.store>
|
|||||||
Section: utils
|
Section: utils
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Build-Depends:
|
Build-Depends:
|
||||||
debhelper (>= 9),
|
cmake,
|
||||||
|
debhelper (>= 11),
|
||||||
pkg-config,
|
pkg-config,
|
||||||
qtchooser (>= 55-gc9562a1-1~) | qt5-default,
|
qtchooser (>= 55-gc9562a1-1~),
|
||||||
qtbase5-dev,
|
qt6-base-dev,
|
||||||
libqt5svg5-dev,
|
qt6-svg-dev,
|
||||||
qttools5-dev-tools,
|
qt6-tools-dev,
|
||||||
qtwebengine5-dev,
|
qt6-webengine-dev,
|
||||||
libdtkcore-dev (>= 5.0),
|
libdtkcommon-dev,
|
||||||
libdtkgui-dev (>= 5.0),
|
libdtk6core-dev,
|
||||||
libdtkwidget-dev (>= 5.0)
|
libdtk6gui-dev,
|
||||||
|
libdtk6widget-dev
|
||||||
Standards-Version: 4.1.7
|
Standards-Version: 4.1.7
|
||||||
Homepage: https://www.spark-app.store/
|
Homepage: https://www.spark-app.store/
|
||||||
|
|
||||||
@@ -20,15 +22,15 @@ Package: spark-store
|
|||||||
Architecture: any
|
Architecture: any
|
||||||
Provides: spark-store-console-in-container
|
Provides: spark-store-console-in-container
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends},
|
Depends: ${shlibs:Depends}, ${misc:Depends},
|
||||||
dde-qt5integration,
|
dde-qt6integration,
|
||||||
curl,
|
curl,
|
||||||
openssl,
|
openssl,
|
||||||
aria2,
|
aria2,
|
||||||
|
qtwayland5,
|
||||||
gnupg,
|
gnupg,
|
||||||
zenity,
|
zenity,
|
||||||
policykit-1 | pkexec,
|
policykit-1 | pkexec,
|
||||||
libnotify-bin,
|
libnotify-bin,
|
||||||
qtwayland5,
|
|
||||||
desktop-file-utils,
|
desktop-file-utils,
|
||||||
dpkg-dev,
|
dpkg-dev,
|
||||||
lsb-release,
|
lsb-release,
|
||||||
|
|||||||
33
debian/rules
vendored
@@ -1,9 +1,14 @@
|
|||||||
#!/usr/bin/make -f
|
#!/usr/bin/make -f
|
||||||
|
|
||||||
export QT_SELECT = qt5
|
|
||||||
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
|
||||||
include /usr/share/dpkg/default.mk
|
include /usr/share/dpkg/default.mk
|
||||||
|
|
||||||
|
export QT_SELECT = qt6
|
||||||
|
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
||||||
|
|
||||||
|
DEB_CFLAGS ?= $(shell dpkg-buildflags --get CFLAGS)
|
||||||
|
DEB_CPPFLAGS ?= $(shell dpkg-buildflags --get CPPFLAGS)
|
||||||
|
DEB_CXXFLAGS ?= $(shell dpkg-buildflags --get CXXFLAGS)
|
||||||
|
|
||||||
DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
|
DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
|
||||||
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
|
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
|
||||||
|
|
||||||
@@ -16,25 +21,15 @@ SOURCE_DATE_EPOCH := $(shell date +%s)
|
|||||||
%:
|
%:
|
||||||
dh $@ --parallel
|
dh $@ --parallel
|
||||||
|
|
||||||
override_dh_auto_clean:
|
|
||||||
rm -rf $(CURDIR)/build-$(DEB_HOST_MULTIARCH)
|
|
||||||
|
|
||||||
override_dh_auto_configure:
|
override_dh_auto_configure:
|
||||||
mkdir -p $(CURDIR)/build-$(DEB_HOST_MULTIARCH)
|
dh_auto_configure -- \
|
||||||
|
-DVERSION=$(DEB_VERSION_UPSTREAM) \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_C_FLAGS="$(DEB_CFLAGS) $(DEB_CPPFLAGS)" \
|
||||||
|
-DCMAKE_CXX_FLAGS="$(DEB_CXXFLAGS) $(DEB_CPPFLAGS)"
|
||||||
|
|
||||||
qmake BUILD_VERSION=$(DEB_VERSION_UPSTREAM) spark-store-project.pro \
|
#Ignore the dpkg-shlibdeps: warning (it uses none of the library's symbols)
|
||||||
-spec linux-g++ CONFIG+=force_debug_info \
|
#Qt Mutidedia lib will ref to network libraray.
|
||||||
-o $(CURDIR)/build-$(DEB_HOST_MULTIARCH)/
|
|
||||||
|
|
||||||
override_dh_auto_build:
|
|
||||||
make -C $(CURDIR)/build-$(DEB_HOST_MULTIARCH) -j$(JOBS)
|
|
||||||
|
|
||||||
override_dh_auto_install:
|
|
||||||
make -C $(CURDIR)/build-$(DEB_HOST_MULTIARCH) install \
|
|
||||||
INSTALL_ROOT=$(CURDIR)/debian/spark-store
|
|
||||||
|
|
||||||
# Ignore the dpkg-shlibdeps: warning (it uses none of the library's symbols)
|
|
||||||
# Qt Mutidedia lib will ref to network libraray.
|
|
||||||
override_dh_shlibdeps:
|
override_dh_shlibdeps:
|
||||||
dh_shlibdeps --dpkg-shlibdeps-params=--warnings=0 --exclude=opt/durapps/spark-store/bin/ss-feedback/
|
dh_shlibdeps --dpkg-shlibdeps-params=--warnings=0 --exclude=opt/durapps/spark-store/bin/ss-feedback/
|
||||||
override_dh_strip:
|
override_dh_strip:
|
||||||
|
|||||||
3
debian/spark-store.postinst
vendored
@@ -26,6 +26,7 @@ case "$1" in
|
|||||||
|
|
||||||
# Remove the sources.list file
|
# Remove the sources.list file
|
||||||
rm -f /etc/apt/sources.list.d/sparkstore.list
|
rm -f /etc/apt/sources.list.d/sparkstore.list
|
||||||
|
rm -f /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list
|
||||||
|
|
||||||
# Check if /usr/local/bin existed
|
# Check if /usr/local/bin existed
|
||||||
mkdir -p /usr/local/bin
|
mkdir -p /usr/local/bin
|
||||||
@@ -41,7 +42,7 @@ case "$1" in
|
|||||||
ln -s -f /opt/durapps/spark-store/bin/aptss /usr/local/bin/ss-apt-fast
|
ln -s -f /opt/durapps/spark-store/bin/aptss /usr/local/bin/ss-apt-fast
|
||||||
|
|
||||||
ln -s -f /opt/durapps/spark-store/bin/aptss /usr/bin/aptss
|
ln -s -f /opt/durapps/spark-store/bin/aptss /usr/bin/aptss
|
||||||
ln -sf /usr/lib/qt5/bin/spark-update-tool /usr/bin/spark-update-tool
|
|
||||||
|
|
||||||
|
|
||||||
# Install key
|
# Install key
|
||||||
|
|||||||
1
debian/spark-store.triggers
vendored
@@ -1,2 +1 @@
|
|||||||
interest-noawait /opt/apps
|
interest-noawait /opt/apps
|
||||||
|
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
deb [by-hash=force] https://d.store.deepinos.org.cn /
|
|
||||||
@@ -2,14 +2,13 @@
|
|||||||
Description=Spark Store update notifier
|
Description=Spark Store update notifier
|
||||||
After=apt-daily.service network.target network-online.target systemd-networkd.service NetworkManager.service connman.service
|
After=apt-daily.service network.target network-online.target systemd-networkd.service NetworkManager.service connman.service
|
||||||
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
ExecStart=/opt/durapps/spark-store/bin/update-upgrade/ss-update-notifier.sh
|
ExecStart=/opt/durapps/spark-store/bin/update-upgrade/ss-update-notifier.sh
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=15 # 可以设置为更长的重试间隔,比如 15 秒或 30 秒
|
RestartSec=10
|
||||||
StartLimitIntervalSec=1h # 设置为 1 小时的时间窗口
|
|
||||||
StartLimitBurst=3 # 最大允许失败次数为 3 次
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
TRANSHELL_CONTENT_RUNNING_IN_NOT_ROOT_USER="INFO:Running in non-root mode! If error occurs, please try to excute me as root."
|
TRANSHELL_CONTENT_RUNNING_IN_NOT_ROOT_USER="INFO: Running in non-Root mode! If error occurs, please try running the command with Root privileges."
|
||||||
TRANSHELL_CONTENT_INFO_SOURCES_LIST_D_IS_EMPTY="INFO:sources.list.d directory is empty,will not try to sync"
|
TRANSHELL_CONTENT_INFO_SOURCES_LIST_D_IS_EMPTY="INFO: The sources.list.d directory is empty. Synchronization will not be attempted."
|
||||||
TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST="Getting server and mirror lists..."
|
TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST="Fetching configuration and mirror list from the server..."
|
||||||
TRANSHELL_CONTENT_PLEASE_USE_APTSS_INSTEAD_OF_APT="Please note: Although the error message suggests using \"apt\" (such as \"apt install --fix-broken\"), please use \"aptss\" instead of \"apt\" when troubleshooting errors (for example, change to \"aptss install --fix-broken\")."
|
TRANSHELL_CONTENT_PLEASE_USE_APTSS_INSTEAD_OF_APT="NOTE: Although the error message may suggest using apt (e.g. apt install --fix-broken) to fix the issue, please use aptss instead when troubleshooting (for example, use: aptss install --fix-broken)."
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
TRANSHELL_CONTENT_RUNNING_IN_NOT_ROOT_USER="信息:正在使用非root权限模式启动!若出现问题,请尝试使用root权限执行指令"
|
TRANSHELL_CONTENT_RUNNING_IN_NOT_ROOT_USER="信息:正在使用非 Root 权限模式启动!若出现问题,请尝试使用 Root 权限执行命令。"
|
||||||
TRANSHELL_CONTENT_INFO_SOURCES_LIST_D_IS_EMPTY="信息:sources.list.d文件夹是空的,将不会尝试同步"
|
TRANSHELL_CONTENT_INFO_SOURCES_LIST_D_IS_EMPTY="信息:sources.list.d 文件夹是空的,将不会尝试同步。"
|
||||||
TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST="从服务器获取配置和镜像列表..."
|
TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST="正在从服务器获取配置和镜像列表……"
|
||||||
TRANSHELL_CONTENT_PLEASE_USE_APTSS_INSTEAD_OF_APT="注意:尽管报错信息中提示使用apt(如apt install --fix-broken),请在排查错误的时候使用aptss而不是apt(对于例子,改为使用 aptss install --fix-broken)."
|
TRANSHELL_CONTENT_PLEASE_USE_APTSS_INSTEAD_OF_APT="注意:尽管报错信息提示使用 apt(如 apt install --fix-broken)修复问题,但请在排查错误时使用 aptss 进行替代(对于例子,请改为使用 aptss install --fix-broken)。"
|
||||||
|
Before Width: | Height: | Size: 253 KiB After Width: | Height: | Size: 253 KiB |
|
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 34 KiB |
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
TRANSHELL_CONTENT_HASH_CHECK_FAILED="Failed in checking package hash! \nPossibly reason can be the package is broken, laggy in sync of Spark Store repository, or, there is a malware attempt to attack. \nIf you don't know what happend, please try install again after execute the command below\n sudo aptss update\n\nIf the problem still happen, please click APP Feedback button in the APP information page to feedback to us.\n\n If you are in the Audition Group,Please use ssaudit instead of ssinstall to audit APPs,for ssinstall is used for password-free install now.\nIf you want to install an app that is removed from Spark Store repository,you can also use ssaudit."
|
TRANSHELL_CONTENT_HASH_CHECK_FAILED="An unexpected error caused the package verification to fail, and the installation process has been terminated.\n\nPossible causes include:\nNetwork or storage issues resulting in a corrupted package; The Spark Store repository has not yet completed synchronization; In extreme cases, malware may be attempting to tamper with the installation package to compromise the system.\n\nFor normal users: please run the following command in the terminal and then try installing again:\nsudo aptss update\n\nIf the problem persists, click 'App Feedback' button in the application information page to submit the issue.\n\nFor auditors: please use ssaudit instead of ssinstall for auditing, as ssinstall is now reserved for password-free installation.\nThe ssaudit command can also be used to attempt installation of applications that have been removed from the Spark Store."
|
||||||
TRANSHELL_CONTENT_PLEASE_RUN_AS_ROOT="Please run ssinstall as root"
|
TRANSHELL_CONTENT_PLEASE_RUN_AS_ROOT="Please run the ssinstall command with Root privileges."
|
||||||
TRANSHELL_CONTENT_FILE_NOT_EXIST="File not exist"
|
TRANSHELL_CONTENT_FILE_NOT_EXIST="The specified file does not exist."
|
||||||
TRANSHELL_CONTENT_WILL_NOT_DELETE_DEB="No delete after install option given, will not delete the deb"
|
TRANSHELL_CONTENT_WILL_NOT_DELETE_DEB="No --delete-after-install option specified or installation failed. The Deb package will not be deleted."
|
||||||
TRANSHELL_CONTENT_DEB_IS_DELETED="--delete-after-install option is given and the installation is succeeded, delete the deb file."
|
TRANSHELL_CONTENT_DEB_IS_DELETED="The --delete-after-install option was used and the installation succeeded. The Deb package has been deleted."
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
TRANSHELL_CONTENT_HASH_CHECK_FAILED="软件包校验失败!这不应该发生!\n可能是因为软件包已损坏,星火仓库未同步,或者最坏的情况:恶意软件尝试利用自动安装来入侵系统!\n如果你不清楚发生了什么,请执行 sudo aptss update 后再尝试安装。\n如果问题仍然存在,请在应用信息界面点击 应用反馈 来提交反馈给我们!\n\n 如果你是审核人员,请使用 ssaudit来替代ssinstall进行审核工作,因为现在ssinstall已经被用于免密安装。\n如果你正在尝试安装已经下架的星火应用,也可用ssaudit来替代ssinstall"
|
TRANSHELL_CONTENT_HASH_CHECK_FAILED="意外错误导致软件包校验失败,安装进程已终止。\n\n可能导致此错误的原因:\n网络或存储问题导致软件包损坏;星火应用商店软件仓库未完成同步;极端情况下,恶意软件尝试篡改安装包进行入侵。\n\n对于普通用户,请在终端执行 sudo aptss update 后再次尝试安装;如仍然遇到此错误,请在应用信息界面点击“应用反馈”提交问题。\n对于审核人员,请使用 ssaudit 替代 ssinstall 执行,现在 ssinstall 已被用于免密安装;此替代命令也可用于尝试安装已于星火应用商店下架的应用。"
|
||||||
TRANSHELL_CONTENT_PLEASE_RUN_AS_ROOT="请使用root启动ssinstall"
|
TRANSHELL_CONTENT_PLEASE_RUN_AS_ROOT="请使用 Root 权限运行 ssinstall 命令。"
|
||||||
TRANSHELL_CONTENT_FILE_NOT_EXIST="文件不存在"
|
TRANSHELL_CONTENT_FILE_NOT_EXIST="指定的文件不存在。"
|
||||||
TRANSHELL_CONTENT_WILL_NOT_DELETE_DEB="未指定安装后删除或安装出错,不删除deb包"
|
TRANSHELL_CONTENT_WILL_NOT_DELETE_DEB="未指定安装后删除软件包或安装出错,不删除 Deb 包。"
|
||||||
TRANSHELL_CONTENT_DEB_IS_DELETED="使用了--delete-after-install选项且安装未出错,删除deb包"
|
TRANSHELL_CONTENT_DEB_IS_DELETED="使用了 --delete-after-install 选项且安装未出错,删除 Deb 包。"
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
TRANSHELL_CONTENT_HASH_CHECK_FAILED="Failed in checking package hash! \nPossibly reason can be the package is broken, laggy in sync of Spark Store repository, or, there is a malware attempt to attack. \nIf you don't know what happend, please try install again after execute the command below\n sudo aptss update\n\nIf the problem still happen, please click APP Feedback button in the APP information page to feedback to us.\n\n If you are in the Audition Group,Please use ssaudit instead of ssinstall to audit APPs,for ssinstall is used for password-free install now.\nIf you want to install an app that is removed from Spark Store repository,you can also use ssaudit."
|
TRANSHELL_CONTENT_HASH_CHECK_FAILED="An unexpected error caused the package verification to fail, and the installation process has been terminated.\n\nPossible causes include:\nNetwork or storage issues resulting in a corrupted package; The Spark Store repository has not yet completed synchronization; In extreme cases, malware may be attempting to tamper with the installation package to compromise the system.\n\nFor normal users: please run the following command in the terminal and then try installing again:\nsudo aptss update\n\nIf the problem persists, click 'App Feedback' button in the application information page to submit the issue.\n\nFor auditors: please use ssaudit instead of ssinstall for auditing, as ssinstall is now reserved for password-free installation.\nThe ssaudit command can also be used to attempt installation of applications that have been removed from the Spark Store."
|
||||||
TRANSHELL_CONTENT_PLEASE_RUN_AS_ROOT="Please run ssinstall as root"
|
TRANSHELL_CONTENT_PLEASE_RUN_AS_ROOT="Please run the ssinstall command with Root privileges."
|
||||||
TRANSHELL_CONTENT_FILE_NOT_EXIST="File not exist"
|
TRANSHELL_CONTENT_FILE_NOT_EXIST="The specified file does not exist."
|
||||||
TRANSHELL_CONTENT_WILL_NOT_DELETE_DEB="No delete after install option given, will not delete the deb"
|
TRANSHELL_CONTENT_WILL_NOT_DELETE_DEB="No --delete-after-install option specified or installation failed. The Deb package will not be deleted."
|
||||||
TRANSHELL_CONTENT_DEB_IS_DELETED="--delete-after-install option is given and the installation is succeeded, delete the deb file."
|
TRANSHELL_CONTENT_DEB_IS_DELETED="The --delete-after-install option was used and the installation succeeded. The Deb package has been deleted."
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
TRANSHELL_CONTENT_HASH_CHECK_FAILED="软件包校验失败!这不应该发生!\n可能是因为软件包已损坏,星火仓库未同步,或者最坏的情况:恶意软件尝试利用自动安装来入侵系统!\n如果你不清楚发生了什么,请执行 sudo aptss update 后再尝试安装。\n如果问题仍然存在,请在应用信息界面点击 应用反馈 来提交反馈给我们!\n\n 如果你是审核人员,请使用 ssaudit来替代ssinstall进行审核工作,因为现在ssinstall已经被用于免密安装。\n如果你正在尝试安装已经下架的星火应用,也可用ssaudit来替代ssinstall"
|
TRANSHELL_CONTENT_HASH_CHECK_FAILED="意外错误导致软件包校验失败,安装进程已终止。\n\n可能导致此错误的原因:\n网络或存储问题导致软件包损坏;星火应用商店软件仓库未完成同步;极端情况下,恶意软件尝试篡改安装包进行入侵。\n\n对于普通用户,请在终端执行 sudo aptss update 后再次尝试安装;如仍然遇到此错误,请在应用信息界面点击“应用反馈”提交问题。\n对于审核人员,请使用 ssaudit 替代 ssinstall 执行,现在 ssinstall 已被用于免密安装;此替代命令也可用于尝试安装已于星火应用商店下架的应用。"
|
||||||
TRANSHELL_CONTENT_PLEASE_RUN_AS_ROOT="请使用root启动ssinstall"
|
TRANSHELL_CONTENT_PLEASE_RUN_AS_ROOT="请使用 Root 权限运行 ssinstall 命令。"
|
||||||
TRANSHELL_CONTENT_FILE_NOT_EXIST="文件不存在"
|
TRANSHELL_CONTENT_FILE_NOT_EXIST="指定的文件不存在。"
|
||||||
TRANSHELL_CONTENT_WILL_NOT_DELETE_DEB="未指定安装后删除或安装出错,不删除deb包"
|
TRANSHELL_CONTENT_WILL_NOT_DELETE_DEB="未指定安装后删除软件包或安装出错,不删除 Deb 包。"
|
||||||
TRANSHELL_CONTENT_DEB_IS_DELETED="使用了--delete-after-install选项且安装未出错,删除deb包"
|
TRANSHELL_CONTENT_DEB_IS_DELETED="使用了 --delete-after-install 选项且安装未出错,删除 Deb 包。"
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
#-------------------------------------------------
|
|
||||||
#
|
|
||||||
# Project created by QtCreator 2022-01-12T04:00:00
|
|
||||||
#
|
|
||||||
#-------------------------------------------------
|
|
||||||
|
|
||||||
TARGET = spark-store
|
|
||||||
TEMPLATE = subdirs
|
|
||||||
|
|
||||||
CONFIG += ordered
|
|
||||||
|
|
||||||
SUBDIRS += \
|
|
||||||
src/spark-store.pro
|
|
||||||
|
|
||||||
# https://wiki.debian.org/Hardening
|
|
||||||
QMAKE_CFLAGS *= $(shell dpkg-buildflags --get CFLAGS)
|
|
||||||
QMAKE_CPPFLAGS *= $(shell dpkg-buildflags --get CPPFLAGS)
|
|
||||||
QMAKE_CXXFLAGS *= $(shell dpkg-buildflags --get CXXFLAGS)
|
|
||||||
QMAKE_LFLAGS *= $(shell dpkg-buildflags --get LDFLAGS)
|
|
||||||
|
|
||||||
# Update translation files
|
|
||||||
CONFIG(release, debug | release) {
|
|
||||||
system(bash $${PWD}/translate_update.sh)
|
|
||||||
system(bash $${PWD}/translate_generation.sh)
|
|
||||||
}
|
|
||||||
|
|
||||||
# Rules for deployment
|
|
||||||
tool.files += tool/*
|
|
||||||
tool.path = /opt/durapps/$${TARGET}/bin
|
|
||||||
|
|
||||||
qm.files += translations/*.qm
|
|
||||||
qm.path = /usr/share/spark-store/translations
|
|
||||||
|
|
||||||
#preferences.files += pkg/etc/apt/preferences.d/sparkstore
|
|
||||||
#preferences.path = /etc/apt/preferences.d
|
|
||||||
|
|
||||||
#sourceslist.files += pkg/etc/apt/sources.list.d/sparkstore.list
|
|
||||||
#sourceslist.path = /etc/apt/sources.list.d
|
|
||||||
|
|
||||||
bash_completion.files += pkg/usr/share/bash-completion/completions/aptss
|
|
||||||
bash_completion.path = /usr/share/bash-completion/completions
|
|
||||||
|
|
||||||
fish_completion.files += pkg/usr/share/fish/completions/aptss.fish
|
|
||||||
fish_completion.path = /usr/share/fish/completions/
|
|
||||||
|
|
||||||
desktop.files += pkg/usr/share/applications/*.desktop
|
|
||||||
desktop.path = /usr/share/applications
|
|
||||||
|
|
||||||
service.files += pkg/usr/lib/systemd/system/spark-update-notifier.service
|
|
||||||
service.path = /usr/lib/systemd/system/
|
|
||||||
|
|
||||||
polkit-1.files += pkg/usr/share/polkit-1/actions/*
|
|
||||||
polkit-1.path = /usr/share/polkit-1/actions/
|
|
||||||
|
|
||||||
icon.files += pkg/usr/share/icons/hicolor/scalable/apps/*.svg
|
|
||||||
icon.files += pkg/usr/share/icons/hicolor/scalable/apps/*.png
|
|
||||||
icon.path = /usr/share/icons/hicolor/scalable/apps
|
|
||||||
|
|
||||||
ssinstall-transhell.files += pkg/usr/share/ssinstall/transhell
|
|
||||||
ssinstall-transhell.path = /usr/share/ssinstall/
|
|
||||||
|
|
||||||
aptss-transhell.files += pkg/usr/share/aptss/transhell
|
|
||||||
aptss-transhell.path = /usr/share/aptss/
|
|
||||||
|
|
||||||
tmp.files += pkg/tmp/spark-store-install/feedback.sh
|
|
||||||
tmp.path = /tmp/spark-store-install
|
|
||||||
|
|
||||||
INSTALLS += \
|
|
||||||
tool \
|
|
||||||
qm \
|
|
||||||
desktop \
|
|
||||||
icon \
|
|
||||||
ssinstall-transhell \
|
|
||||||
aptss-transhell \
|
|
||||||
# sourceslist \
|
|
||||||
tmp \
|
|
||||||
service \
|
|
||||||
bash_completion \
|
|
||||||
fish_completion \
|
|
||||||
polkit-1
|
|
||||||
# 暂时不添加
|
|
||||||
|
|
||||||
SUBDIRS += src/spark-update-tool
|
|
||||||
|
|
||||||
spark-update-tool.subdir = src/spark-update-tool
|
|
||||||
spark-update-tool.file = src/spark-update-tool/spark-update-tool.pro
|
|
||||||
spark-update-tool.target = spark-update-tool
|
|
||||||
spark-update-tool.depends = spark-store
|
|
||||||
81
spark-update-tool/CMakeLists.txt
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
|
project(spark-update-tool VERSION 0.1 LANGUAGES CXX)
|
||||||
|
|
||||||
|
set(CMAKE_AUTOUIC ON)
|
||||||
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
set(CMAKE_AUTORCC ON)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
|
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets Network Concurrent)
|
||||||
|
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Network Concurrent)
|
||||||
|
|
||||||
|
set(PROJECT_SOURCES
|
||||||
|
src/main.cpp
|
||||||
|
src/mainwindow.cpp
|
||||||
|
src/mainwindow.h
|
||||||
|
src/mainwindow.ui
|
||||||
|
src/aptssupdater.h
|
||||||
|
src/aptssupdater.cpp
|
||||||
|
src/icons.qrc
|
||||||
|
src/appdelegate.h
|
||||||
|
src/appdelegate.cpp
|
||||||
|
src/applistmodel.h
|
||||||
|
src/applistmodel.cpp
|
||||||
|
src/downloadmanager.h
|
||||||
|
src/downloadmanager.cpp
|
||||||
|
src/ignoreconfig.h
|
||||||
|
src/ignoreconfig.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
|
||||||
|
qt_add_executable(spark-update-tool
|
||||||
|
MANUAL_FINALIZATION
|
||||||
|
${PROJECT_SOURCES}
|
||||||
|
)
|
||||||
|
# Define target properties for Android with Qt 6 as:
|
||||||
|
# set_property(TARGET spark-update-tool APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
|
||||||
|
# ${CMAKE_CURRENT_SOURCE_DIR}/android)
|
||||||
|
# For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation
|
||||||
|
else()
|
||||||
|
if(ANDROID)
|
||||||
|
add_library(spark-update-tool SHARED
|
||||||
|
${PROJECT_SOURCES}
|
||||||
|
)
|
||||||
|
# Define properties for Android with Qt 5 after find_package() calls as:
|
||||||
|
# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
|
||||||
|
else()
|
||||||
|
add_executable(spark-update-tool
|
||||||
|
${PROJECT_SOURCES}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_link_libraries(spark-update-tool PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Network Qt${QT_VERSION_MAJOR}::Concurrent)
|
||||||
|
|
||||||
|
# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
|
||||||
|
# If you are developing for iOS or macOS you should consider setting an
|
||||||
|
# explicit, fixed bundle identifier manually though.
|
||||||
|
if(${QT_VERSION} VERSION_LESS 6.1.0)
|
||||||
|
set(BUNDLE_ID_OPTION MACOSX_BUNDLE_GUI_IDENTIFIER com.example.spark-update-tool)
|
||||||
|
endif()
|
||||||
|
set_target_properties(spark-update-tool PROPERTIES
|
||||||
|
${BUNDLE_ID_OPTION}
|
||||||
|
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
|
||||||
|
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
|
||||||
|
MACOSX_BUNDLE TRUE
|
||||||
|
WIN32_EXECUTABLE TRUE
|
||||||
|
)
|
||||||
|
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
install(TARGETS spark-update-tool
|
||||||
|
BUNDLE DESTINATION .
|
||||||
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
if(QT_VERSION_MAJOR EQUAL 6)
|
||||||
|
qt_finalize_executable(spark-update-tool)
|
||||||
|
endif()
|
||||||
15
spark-update-tool/README.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
### Spark Update Tool
|
||||||
|
#### Introduction
|
||||||
|
|
||||||
|
Welcome to Spark Software Updater. Use this tool to update applications on your Linux system.
|
||||||
|
This version is specifically designed for Linux distributions with Qt6 support.
|
||||||
|
Please run under root privileges (recommended: use `sudo`).
|
||||||
|
#### Currently Supported Linux Distributions
|
||||||
|
- [x] GXDE OS
|
||||||
|
- [x] Ubuntu
|
||||||
|
- [x] deepin
|
||||||
|
- [ ] Kylin
|
||||||
|
|
||||||
|
|
||||||
|
#### Contact & Feedback
|
||||||
|
momen@momen.world
|
||||||
@@ -1,14 +1,10 @@
|
|||||||
### 星火软件更新器
|
### 星火软件更新器
|
||||||
|
|
||||||
#### 简介
|
#### 简介
|
||||||
|
|
||||||
欢迎使用星火软件更新器!本工具可帮助您便捷地更新 Linux 计算机上的各类程序。
|
欢迎使用星火软件更新器,您可以使用此更新器更新位于您 Linux 计算机的程序。
|
||||||
|
此版本专为有qt6的Linux发行版所使用。
|
||||||
本版本专为仅包含 Qt5 的 Linux 发行版设计。
|
请在root环境下运行。
|
||||||
**请在 root 权限下运行本程序。**
|
|
||||||
|
|
||||||
#### 当前支持的 Linux 发行版
|
#### 当前支持的 Linux 发行版
|
||||||
|
|
||||||
- [x] GXDE OS
|
- [x] GXDE OS
|
||||||
- [x] Ubuntu
|
- [x] Ubuntu
|
||||||
- [x] deepin
|
- [x] deepin
|
||||||
@@ -26,5 +22,4 @@
|
|||||||
|
|
||||||
如您已安装星火应用商店,则会附带本程序。
|
如您已安装星火应用商店,则会附带本程序。
|
||||||
#### 联系与反馈
|
#### 联系与反馈
|
||||||
|
momen@momen.world
|
||||||
如有问题或建议,欢迎联系:momen@momen.world
|
|
||||||
23
spark-update-tool/debian/changelog
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
spark-update-tool (1.0.3) unstable; urgency=low
|
||||||
|
|
||||||
|
* 修复默认图标加载失败的问题
|
||||||
|
* 修复更新器在安装阶段强制关闭窗口后再次更新无法安装软件包的问题。
|
||||||
|
|
||||||
|
-- momen <vmomenv@gmail.com> Fri, 17 Oct 2025 00:00:00 +0000
|
||||||
|
spark-update-tool (1.0.2) unstable; urgency=low
|
||||||
|
|
||||||
|
* 添加复选框,选择多个包更新
|
||||||
|
* 修复缩放问题
|
||||||
|
* 添加忽略应用功能
|
||||||
|
|
||||||
|
-- momen <vmomenv@gmail.com> Mon, 29 Sep 2025 00:00:00 +0000
|
||||||
|
spark-update-tool (1.0.1) unstable; urgency=low
|
||||||
|
|
||||||
|
* 修复窗口调整大小时的错误
|
||||||
|
|
||||||
|
-- momen <vmomenv@gmail.com> Wed, 18 Jun 2025 00:00:00 +0000
|
||||||
|
spark-update-tool (1.0.0) unstable; urgency=low
|
||||||
|
|
||||||
|
* Initial release.
|
||||||
|
|
||||||
|
-- momen <vmomenv@gmail.com> Wed, 18 Jun 2025 00:00:00 +0000
|
||||||
1
spark-update-tool/debian/compat
Normal file
@@ -0,0 +1 @@
|
|||||||
|
13
|
||||||
27
spark-update-tool/debian/rules
Executable file
@@ -0,0 +1,27 @@
|
|||||||
|
#!/usr/bin/make -f
|
||||||
|
|
||||||
|
# 声明兼容性级别
|
||||||
|
export DH_VERBOSE=1
|
||||||
|
|
||||||
|
%:
|
||||||
|
dh $@ --buildsystem=cmake
|
||||||
|
|
||||||
|
# 确保使用CMake进行配置
|
||||||
|
override_dh_auto_configure:
|
||||||
|
dh_auto_configure -- -DCMAKE_INSTALL_PREFIX=/usr
|
||||||
|
|
||||||
|
# 确保使用CMake进行构建
|
||||||
|
override_dh_auto_build:
|
||||||
|
dh_auto_build
|
||||||
|
|
||||||
|
# 确保使用CMake进行安装
|
||||||
|
override_dh_auto_install:
|
||||||
|
dh_auto_install
|
||||||
|
|
||||||
|
# 确保使用CMake进行清理
|
||||||
|
override_dh_auto_clean:
|
||||||
|
dh_auto_clean
|
||||||
|
|
||||||
|
# 确保使用CMake进行依赖解析
|
||||||
|
override_dh_shlibdeps:
|
||||||
|
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
|
||||||
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 8.9 KiB |
BIN
spark-update-tool/resources/default_icon.png
Normal file
|
After Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 1009 B After Width: | Height: | Size: 1009 B |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
506
spark-update-tool/src/appdelegate.cpp
Normal file
@@ -0,0 +1,506 @@
|
|||||||
|
#include "appdelegate.h"
|
||||||
|
#include <QIcon>
|
||||||
|
#include <QDebug>
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QProgressBar>
|
||||||
|
#include <QPushButton>
|
||||||
|
#include <QPainter>
|
||||||
|
#include <QMouseEvent>
|
||||||
|
#include <QFile>
|
||||||
|
|
||||||
|
AppDelegate::AppDelegate(QObject *parent)
|
||||||
|
: QStyledItemDelegate(parent), m_downloadManager(new DownloadManager(this)), m_installProcess(nullptr) {
|
||||||
|
connect(m_downloadManager, &DownloadManager::downloadFinished, this,
|
||||||
|
[this](const QString &packageName, bool success) {
|
||||||
|
if (m_downloads.contains(packageName)) {
|
||||||
|
m_downloads[packageName].isDownloading = false;
|
||||||
|
// 不要提前设置 isInstalled
|
||||||
|
emit updateDisplay(packageName);
|
||||||
|
qDebug() << (success ? "下载完成:" : "下载失败:") << packageName;
|
||||||
|
if (success) {
|
||||||
|
enqueueInstall(packageName); // 安装完成后再设置 isInstalled
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
connect(m_downloadManager, &DownloadManager::downloadProgress, this,
|
||||||
|
[this](const QString &packageName, int progress) {
|
||||||
|
if (m_downloads.contains(packageName)) {
|
||||||
|
m_downloads[packageName].progress = progress;
|
||||||
|
qDebug()<<progress;
|
||||||
|
emit updateDisplay(packageName); // 实时刷新进度条
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// m_spinnerTimer.start(); // 移除这行
|
||||||
|
|
||||||
|
// 新增:初始化和连接 QTimer
|
||||||
|
m_spinnerUpdateTimer.setInterval(20); // 刷新间隔,可以调整
|
||||||
|
connect(&m_spinnerUpdateTimer, &QTimer::timeout, this, &AppDelegate::updateSpinner);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AppDelegate::setModel(QAbstractItemModel *model) {
|
||||||
|
m_model = model;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AppDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const {
|
||||||
|
painter->save();
|
||||||
|
|
||||||
|
// 检查是否为忽略状态
|
||||||
|
bool isIgnored = index.data(Qt::UserRole + 8).toBool();
|
||||||
|
|
||||||
|
if (option.state & QStyle::State_Selected)
|
||||||
|
painter->fillRect(option.rect, option.palette.highlight());
|
||||||
|
else
|
||||||
|
painter->fillRect(option.rect, QColor("#F3F4F6"));
|
||||||
|
|
||||||
|
// 绘制复选框
|
||||||
|
QString packageName = index.data(Qt::UserRole + 1).toString();
|
||||||
|
bool isSelected = m_selectedPackages.contains(packageName);
|
||||||
|
|
||||||
|
QRect checkboxRect(option.rect.left() + 10, option.rect.top() + (option.rect.height() - 20) / 2, 20, 20);
|
||||||
|
|
||||||
|
// 绘制复选框边框
|
||||||
|
QColor checkboxColor = isIgnored ? QColor("#CCCCCC") : QColor("#888888");
|
||||||
|
painter->setPen(checkboxColor);
|
||||||
|
painter->setBrush(Qt::NoBrush);
|
||||||
|
painter->drawRect(checkboxRect);
|
||||||
|
|
||||||
|
// 如果选中,绘制勾选标记
|
||||||
|
if (isSelected && !isIgnored) {
|
||||||
|
painter->setPen(QPen(QColor("#2563EB"), 2));
|
||||||
|
painter->setBrush(QColor("#2563EB"));
|
||||||
|
painter->drawRect(checkboxRect.adjusted(4, 4, -4, -4));
|
||||||
|
}
|
||||||
|
|
||||||
|
QFont boldFont = option.font;
|
||||||
|
boldFont.setBold(true);
|
||||||
|
QFont normalFont = option.font;
|
||||||
|
|
||||||
|
QString name = index.data(Qt::DisplayRole).toString();
|
||||||
|
QString currentVersion = index.data(Qt::UserRole + 2).toString();
|
||||||
|
QString newVersion = index.data(Qt::UserRole + 3).toString();
|
||||||
|
QString iconPath = index.data(Qt::UserRole + 4).toString();
|
||||||
|
QString size = index.data(Qt::UserRole + 5).toString();
|
||||||
|
QString description = index.data(Qt::UserRole + 6).toString();
|
||||||
|
|
||||||
|
QRect rect = option.rect;
|
||||||
|
int margin = 10, spacing = 6, iconSize = 40;
|
||||||
|
|
||||||
|
// 调整图标位置,为复选框留出空间
|
||||||
|
QRect iconRect(rect.left() + 40, rect.top() + (rect.height() - iconSize) / 2, iconSize, iconSize);
|
||||||
|
|
||||||
|
|
||||||
|
// 如果是忽略状态,绘制灰色图标
|
||||||
|
if (isIgnored) {
|
||||||
|
// 创建灰度效果
|
||||||
|
QPixmap originalPixmap = QIcon(iconPath).pixmap(iconSize, iconSize);
|
||||||
|
QPixmap grayPixmap(originalPixmap.size());
|
||||||
|
grayPixmap.fill(Qt::transparent);
|
||||||
|
QPainter grayPainter(&grayPixmap);
|
||||||
|
grayPainter.setOpacity(0.3); // 设置透明度使其变灰
|
||||||
|
grayPainter.drawPixmap(0, 0, originalPixmap);
|
||||||
|
grayPainter.end();
|
||||||
|
painter->drawPixmap(iconRect, grayPixmap);
|
||||||
|
} else {
|
||||||
|
QIcon(iconPath).paint(painter, iconRect);
|
||||||
|
}
|
||||||
|
|
||||||
|
int textX = iconRect.right() + margin;
|
||||||
|
int textWidth = rect.width() - textX - 100;
|
||||||
|
|
||||||
|
QRect nameRect(textX, rect.top() + margin, textWidth, 20);
|
||||||
|
painter->setFont(boldFont);
|
||||||
|
QColor nameColor = isIgnored ? QColor("#999999") : QColor("#333333");
|
||||||
|
painter->setPen(nameColor);
|
||||||
|
painter->drawText(nameRect, Qt::AlignLeft | Qt::AlignVCenter, name);
|
||||||
|
|
||||||
|
QRect versionRect(textX, nameRect.bottom() + spacing, textWidth, 20);
|
||||||
|
painter->setFont(normalFont);
|
||||||
|
QColor versionColor = isIgnored ? QColor("#AAAAAA") : QColor("#888888");
|
||||||
|
painter->setPen(versionColor);
|
||||||
|
painter->drawText(versionRect, Qt::AlignLeft | Qt::AlignVCenter,
|
||||||
|
QString("当前版本: %1 → 新版本: %2").arg(currentVersion, newVersion));
|
||||||
|
|
||||||
|
QRect descRect(textX, versionRect.bottom() + spacing, textWidth, 40);
|
||||||
|
painter->setFont(normalFont);
|
||||||
|
QColor descColor = isIgnored ? QColor("#CCCCCC") : QColor("#AAAAAA");
|
||||||
|
painter->setPen(descColor);
|
||||||
|
painter->drawText(descRect, Qt::TextWordWrap,
|
||||||
|
QString("包大小:%1 MB").arg(QString::number(size.toDouble() / (1024 * 1024), 'f', 2)));
|
||||||
|
|
||||||
|
bool isDownloading = m_downloads.contains(packageName) && m_downloads[packageName].isDownloading;
|
||||||
|
int progress = m_downloads.value(packageName, DownloadInfo{0, false}).progress;
|
||||||
|
bool isInstalled = m_downloads.value(packageName).isInstalled;
|
||||||
|
bool isInstalling = m_downloads.value(packageName).isInstalling;
|
||||||
|
|
||||||
|
// 如果是忽略状态,显示"已忽略"文本和"取消忽略"按钮
|
||||||
|
if (isIgnored) {
|
||||||
|
QRect ignoredTextRect(rect.right() - 170, rect.top() + (rect.height() - 30) / 2, 80, 30);
|
||||||
|
painter->setPen(QColor("#999999"));
|
||||||
|
painter->setFont(option.font);
|
||||||
|
painter->drawText(ignoredTextRect, Qt::AlignCenter, "已忽略");
|
||||||
|
|
||||||
|
// 绘制取消忽略按钮
|
||||||
|
QRect unignoreButtonRect(rect.right() - 80, rect.top() + (rect.height() - 30) / 2, 70, 30);
|
||||||
|
painter->setPen(Qt::NoPen);
|
||||||
|
painter->setBrush(QColor("#F3F4F6"));
|
||||||
|
painter->drawRoundedRect(unignoreButtonRect, 4, 4);
|
||||||
|
painter->setPen(QColor("#6B7280"));
|
||||||
|
painter->drawText(unignoreButtonRect, Qt::AlignCenter, "取消忽略");
|
||||||
|
} else if (isDownloading) {
|
||||||
|
QRect progressRect(rect.right() - 270, rect.top() + (rect.height() - 20) / 2, 150, 20);
|
||||||
|
QStyleOptionProgressBar progressBarOption;
|
||||||
|
progressBarOption.rect = progressRect;
|
||||||
|
progressBarOption.minimum = 0;
|
||||||
|
progressBarOption.maximum = 100;
|
||||||
|
progressBarOption.progress = progress;
|
||||||
|
progressBarOption.text = QString("%1%").arg(progress);
|
||||||
|
progressBarOption.textVisible = true;
|
||||||
|
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &progressBarOption, painter);
|
||||||
|
|
||||||
|
QRect cancelButtonRect(rect.right() - 80, rect.top() + (rect.height() - 30) / 2, 70, 30);
|
||||||
|
painter->setPen(Qt::NoPen);
|
||||||
|
painter->setBrush(QColor("#ff4444"));
|
||||||
|
painter->drawRoundedRect(cancelButtonRect, 4, 4);
|
||||||
|
|
||||||
|
painter->setPen(Qt::white);
|
||||||
|
painter->setFont(option.font);
|
||||||
|
painter->drawText(cancelButtonRect, Qt::AlignCenter, "取消");
|
||||||
|
} else if (isInstalling) {
|
||||||
|
QRect spinnerRect(option.rect.right() - 80, option.rect.top() + (option.rect.height() - 30) / 2, 30, 30);
|
||||||
|
|
||||||
|
// 修改:使用 m_spinnerAngle
|
||||||
|
QPen pen(QColor("#2563EB"), 3);
|
||||||
|
painter->setPen(pen);
|
||||||
|
painter->setRenderHint(QPainter::Antialiasing, true);
|
||||||
|
QRectF arcRect = spinnerRect.adjusted(3, 3, -3, -3);
|
||||||
|
painter->drawArc(arcRect, m_spinnerAngle * 16, 120 * 16); // 120度弧
|
||||||
|
|
||||||
|
QRect textRect(option.rect.right() - 120, option.rect.top() + (option.rect.height() - 30) / 2, 110, 30);
|
||||||
|
painter->setPen(QColor("#2563EB"));
|
||||||
|
painter->setFont(option.font);
|
||||||
|
painter->drawText(textRect, Qt::AlignLeft | Qt::AlignVCenter, "正在安装中");
|
||||||
|
} else {
|
||||||
|
// 绘制忽略按钮
|
||||||
|
QRect ignoreButtonRect(option.rect.right() - 160, option.rect.top() + (option.rect.height() - 30) / 2, 70, 30);
|
||||||
|
painter->setPen(Qt::NoPen);
|
||||||
|
painter->setBrush(QColor("#F3F4F6"));
|
||||||
|
painter->drawRoundedRect(ignoreButtonRect, 4, 4);
|
||||||
|
painter->setPen(QColor("#6B7280"));
|
||||||
|
painter->drawText(ignoreButtonRect, Qt::AlignCenter, "忽略");
|
||||||
|
|
||||||
|
// 绘制更新按钮
|
||||||
|
QRect updateButtonRect(option.rect.right() - 80, option.rect.top() + (option.rect.height() - 30) / 2, 70, 30);
|
||||||
|
painter->setPen(Qt::NoPen);
|
||||||
|
if (isInstalled) {
|
||||||
|
painter->setBrush(QColor("#10B981"));
|
||||||
|
painter->drawRoundedRect(updateButtonRect, 4, 4);
|
||||||
|
painter->setPen(Qt::white);
|
||||||
|
painter->drawText(updateButtonRect, Qt::AlignCenter, "已安装");
|
||||||
|
} else if (m_downloads.contains(packageName) && !m_downloads[packageName].isDownloading) {
|
||||||
|
painter->setBrush(QColor("#10B981"));
|
||||||
|
painter->drawRoundedRect(updateButtonRect, 4, 4);
|
||||||
|
painter->setPen(Qt::white);
|
||||||
|
painter->drawText(updateButtonRect, Qt::AlignCenter, "下载完成");
|
||||||
|
} else {
|
||||||
|
painter->setBrush(QColor("#e9effd"));
|
||||||
|
painter->drawRoundedRect(updateButtonRect, 4, 4);
|
||||||
|
painter->setPen(QColor("#2563EB"));
|
||||||
|
painter->drawText(updateButtonRect, Qt::AlignCenter, "更新");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
painter->restore();
|
||||||
|
}
|
||||||
|
|
||||||
|
QSize AppDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const {
|
||||||
|
return QSize(option.rect.width(), 110);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AppDelegate::editorEvent(QEvent *event, QAbstractItemModel *model,
|
||||||
|
const QStyleOptionViewItem &option, const QModelIndex &index) {
|
||||||
|
if (event->type() == QEvent::MouseButtonRelease) {
|
||||||
|
QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
|
||||||
|
QRect rect = option.rect;
|
||||||
|
QString packageName = index.data(Qt::UserRole + 1).toString();
|
||||||
|
|
||||||
|
// 检查是否为忽略状态,如果是则只允许取消忽略按钮的交互
|
||||||
|
bool isIgnored = index.data(Qt::UserRole + 8).toBool();
|
||||||
|
if (isIgnored) {
|
||||||
|
QRect unignoreButtonRect(option.rect.right() - 80, option.rect.top() + (option.rect.height() - 30) / 2, 70, 30);
|
||||||
|
if (unignoreButtonRect.contains(mouseEvent->pos())) {
|
||||||
|
// 发送取消忽略信号
|
||||||
|
emit unignoreApp(packageName);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return true; // 消耗其他事件,不允许其他交互
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查是否点击了复选框
|
||||||
|
QRect checkboxRect(rect.left() + 10, rect.top() + (rect.height() - 20) / 2, 20, 20);
|
||||||
|
if (checkboxRect.contains(mouseEvent->pos())) {
|
||||||
|
if (m_selectedPackages.contains(packageName)) {
|
||||||
|
m_selectedPackages.remove(packageName);
|
||||||
|
} else {
|
||||||
|
m_selectedPackages.insert(packageName);
|
||||||
|
}
|
||||||
|
emit updateDisplay(packageName);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_downloads.contains(packageName) && m_downloads[packageName].isDownloading) {
|
||||||
|
QRect cancelButtonRect(rect.right() - 70, rect.top() + (rect.height() - 20) / 2, 60, 20);
|
||||||
|
if (cancelButtonRect.contains(mouseEvent->pos())) {
|
||||||
|
m_downloadManager->cancelDownload(packageName);
|
||||||
|
m_downloads.remove(packageName);
|
||||||
|
emit updateDisplay(packageName);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 检查是否点击了忽略按钮
|
||||||
|
QRect ignoreButtonRect(rect.right() - 160, rect.top() + (rect.height() - 30) / 2, 70, 30);
|
||||||
|
if (ignoreButtonRect.contains(mouseEvent->pos())) {
|
||||||
|
QString currentVersion = index.data(Qt::UserRole + 2).toString();
|
||||||
|
emit ignoreApp(packageName, currentVersion);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查是否点击了更新按钮
|
||||||
|
QRect updateButtonRect(rect.right() - 80, rect.top() + (rect.height() - 30) / 2, 70, 30);
|
||||||
|
if (updateButtonRect.contains(mouseEvent->pos())) {
|
||||||
|
if (m_downloads.contains(packageName) && !m_downloads[packageName].isDownloading) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查/tmp目录下是否已经存在deb包
|
||||||
|
QDir tempDir(QDir::tempPath());
|
||||||
|
QStringList debs = tempDir.entryList(QStringList() << QString("%1_*.deb").arg(packageName), QDir::Files);
|
||||||
|
QString debPath;
|
||||||
|
if (!debs.isEmpty()) {
|
||||||
|
debPath = tempDir.absoluteFilePath(debs.first());
|
||||||
|
} else {
|
||||||
|
debs = tempDir.entryList(QStringList() << QString("%1*.deb").arg(packageName), QDir::Files);
|
||||||
|
if (!debs.isEmpty()) {
|
||||||
|
debPath = tempDir.absoluteFilePath(debs.first());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果存在deb包,直接进行安装
|
||||||
|
if (!debPath.isEmpty() && QFile::exists(debPath)) {
|
||||||
|
qDebug() << "发现已存在的deb包,直接进行安装:" << debPath;
|
||||||
|
enqueueInstall(packageName);
|
||||||
|
} else {
|
||||||
|
// 否则触发下载流程
|
||||||
|
QString downloadUrl = index.data(Qt::UserRole + 7).toString();
|
||||||
|
QString outputPath = QString("%1/%2.metalink").arg(QDir::tempPath(), packageName);
|
||||||
|
|
||||||
|
m_downloads[packageName] = {0, true};
|
||||||
|
m_downloadManager->startDownload(packageName, downloadUrl, outputPath);
|
||||||
|
emit updateDisplay(packageName);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return QStyledItemDelegate::editorEvent(event, model, option, index);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AppDelegate::startDownloadForAll() {
|
||||||
|
if (!m_model) return;
|
||||||
|
for (int row = 0; row < m_model->rowCount(); ++row) {
|
||||||
|
QModelIndex index = m_model->index(row, 0);
|
||||||
|
QString packageName = index.data(Qt::UserRole + 1).toString();
|
||||||
|
if (m_downloads.contains(packageName) && (m_downloads[packageName].isDownloading || m_downloads[packageName].isInstalled))
|
||||||
|
continue;
|
||||||
|
QString downloadUrl = index.data(Qt::UserRole + 7).toString();
|
||||||
|
QString outputPath = QString("%1/%2.metalink").arg(QDir::tempPath(), packageName);
|
||||||
|
m_downloads[packageName] = {0, true, false};
|
||||||
|
m_downloadManager->startDownload(packageName, downloadUrl, outputPath);
|
||||||
|
emit updateDisplay(packageName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AppDelegate::enqueueInstall(const QString &packageName) {
|
||||||
|
m_installQueue.enqueue(packageName);
|
||||||
|
if (!m_isInstalling) {
|
||||||
|
startNextInstall();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AppDelegate::startNextInstall() {
|
||||||
|
if (m_installQueue.isEmpty()) {
|
||||||
|
m_isInstalling = false;
|
||||||
|
m_installingPackage.clear();
|
||||||
|
m_spinnerUpdateTimer.stop(); // 新增:停止定时器
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
m_isInstalling = true;
|
||||||
|
QString packageName = m_installQueue.dequeue();
|
||||||
|
m_installingPackage = packageName;
|
||||||
|
m_downloads[packageName].isInstalling = true;
|
||||||
|
m_spinnerUpdateTimer.start(); // 新增:启动定时器
|
||||||
|
emit updateDisplay(packageName);
|
||||||
|
|
||||||
|
QDir tempDir(QDir::tempPath());
|
||||||
|
QStringList debs = tempDir.entryList(QStringList() << QString("%1_*.deb").arg(packageName), QDir::Files);
|
||||||
|
QString debPath;
|
||||||
|
if (!debs.isEmpty()) {
|
||||||
|
debPath = tempDir.absoluteFilePath(debs.first());
|
||||||
|
} else {
|
||||||
|
debs = tempDir.entryList(QStringList() << QString("%1*.deb").arg(packageName), QDir::Files);
|
||||||
|
if (!debs.isEmpty()) {
|
||||||
|
debPath = tempDir.absoluteFilePath(debs.first());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (debPath.isEmpty()) {
|
||||||
|
qWarning() << "未找到deb文件,包名:" << packageName;
|
||||||
|
m_downloads[packageName].isInstalling = false;
|
||||||
|
emit updateDisplay(packageName);
|
||||||
|
m_installingPackage.clear();
|
||||||
|
startNextInstall();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_installProcess = new QProcess(this);
|
||||||
|
|
||||||
|
QString logPath = QString("/tmp/%1_install.log").arg(packageName);
|
||||||
|
QFile *logFile = new QFile(logPath, m_installProcess);
|
||||||
|
if (logFile->open(QIODevice::Append | QIODevice::Text)) {
|
||||||
|
QFile::setPermissions(logPath, QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner |
|
||||||
|
QFile::ReadGroup | QFile::WriteGroup | QFile::ExeGroup |
|
||||||
|
QFile::ReadOther | QFile::WriteOther | QFile::ExeOther);
|
||||||
|
connect(m_installProcess, &QProcess::readyReadStandardOutput, this, [this, packageName, logFile]() {
|
||||||
|
QByteArray out = m_installProcess->readAllStandardOutput();
|
||||||
|
logFile->write(out);
|
||||||
|
logFile->flush();
|
||||||
|
QString text = QString::fromLocal8Bit(out);
|
||||||
|
qDebug().noquote() << text;
|
||||||
|
if (text.contains(QStringLiteral("软件包已安装"))) {
|
||||||
|
m_downloads[packageName].isInstalling = false;
|
||||||
|
m_downloads[packageName].isInstalled = true;
|
||||||
|
emit updateDisplay(packageName);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
connect(m_installProcess, &QProcess::readyReadStandardError, this, [this, logFile]() {
|
||||||
|
QByteArray err = m_installProcess->readAllStandardError();
|
||||||
|
logFile->write(err);
|
||||||
|
logFile->flush();
|
||||||
|
qDebug().noquote() << QString::fromLocal8Bit(err);
|
||||||
|
});
|
||||||
|
connect(m_installProcess, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
||||||
|
this, [this, packageName, logFile, debPath](int exitCode, QProcess::ExitStatus status) {
|
||||||
|
if (logFile) logFile->close();
|
||||||
|
m_downloads[packageName].isInstalling = false;
|
||||||
|
if (exitCode == 0) {
|
||||||
|
m_downloads[packageName].isInstalled = true;
|
||||||
|
|
||||||
|
// 安装成功后删除deb包
|
||||||
|
if (QFile::exists(debPath)) {
|
||||||
|
if (QFile::remove(debPath)) {
|
||||||
|
qDebug() << "已删除deb包:" << debPath;
|
||||||
|
} else {
|
||||||
|
qWarning() << "删除deb包失败:" << debPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
emit updateDisplay(packageName);
|
||||||
|
m_installProcess->deleteLater();
|
||||||
|
m_installProcess = nullptr;
|
||||||
|
m_installingPackage.clear();
|
||||||
|
startNextInstall();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
connect(m_installProcess, &QProcess::readyReadStandardOutput, this, [this, packageName, debPath]() {
|
||||||
|
QByteArray out = m_installProcess->readAllStandardOutput();
|
||||||
|
QString text = QString::fromLocal8Bit(out);
|
||||||
|
qDebug().noquote() << text;
|
||||||
|
if (text.contains(QStringLiteral("软件包已安装"))) {
|
||||||
|
m_downloads[packageName].isInstalling = false;
|
||||||
|
m_downloads[packageName].isInstalled = true;
|
||||||
|
|
||||||
|
// 安装成功后删除deb包
|
||||||
|
if (QFile::exists(debPath)) {
|
||||||
|
if (QFile::remove(debPath)) {
|
||||||
|
qDebug() << "已删除deb包:" << debPath;
|
||||||
|
} else {
|
||||||
|
qWarning() << "删除deb包失败:" << debPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
emit updateDisplay(packageName);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
connect(m_installProcess, &QProcess::readyReadStandardError, this, [this]() {
|
||||||
|
QByteArray err = m_installProcess->readAllStandardError();
|
||||||
|
qDebug().noquote() << QString::fromLocal8Bit(err);
|
||||||
|
});
|
||||||
|
connect(m_installProcess, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
||||||
|
this, [this, packageName, debPath](int exitCode, QProcess::ExitStatus /*status*/) {
|
||||||
|
// 如果通过退出码判断安装成功,也删除deb包
|
||||||
|
if (exitCode == 0 && QFile::exists(debPath)) {
|
||||||
|
if (QFile::remove(debPath)) {
|
||||||
|
qDebug() << "已删除deb包:" << debPath;
|
||||||
|
} else {
|
||||||
|
qWarning() << "删除deb包失败:" << debPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
emit updateDisplay(packageName);
|
||||||
|
m_installProcess->deleteLater();
|
||||||
|
m_installProcess = nullptr;
|
||||||
|
m_installingPackage.clear();
|
||||||
|
startNextInstall();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList args;
|
||||||
|
args << debPath << "--no-create-desktop-entry" << "--delete-after-install";
|
||||||
|
m_installProcess->start("ssinstall", args);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增槽函数,用于更新旋转角度并触发刷新
|
||||||
|
void AppDelegate::updateSpinner() {
|
||||||
|
m_spinnerAngle = (m_spinnerAngle + 10) % 360; // 每次增加10度
|
||||||
|
emit updateDisplay(m_installingPackage); // 仅刷新当前正在安装的项
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增:更新选中应用的方法
|
||||||
|
void AppDelegate::startDownloadForSelected() {
|
||||||
|
if (!m_model) return;
|
||||||
|
for (int row = 0; row < m_model->rowCount(); ++row) {
|
||||||
|
QModelIndex index = m_model->index(row, 0);
|
||||||
|
QString packageName = index.data(Qt::UserRole + 1).toString();
|
||||||
|
|
||||||
|
// 只下载选中的应用
|
||||||
|
if (m_selectedPackages.contains(packageName)) {
|
||||||
|
if (m_downloads.contains(packageName) && (m_downloads[packageName].isDownloading || m_downloads[packageName].isInstalled))
|
||||||
|
continue;
|
||||||
|
QString downloadUrl = index.data(Qt::UserRole + 7).toString();
|
||||||
|
QString outputPath = QString("%1/%2.metalink").arg(QDir::tempPath(), packageName);
|
||||||
|
m_downloads[packageName] = {0, true, false};
|
||||||
|
m_downloadManager->startDownload(packageName, downloadUrl, outputPath);
|
||||||
|
emit updateDisplay(packageName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 复选框相关方法实现
|
||||||
|
void AppDelegate::setSelectedPackages(const QSet<QString> &selected) {
|
||||||
|
m_selectedPackages = selected;
|
||||||
|
}
|
||||||
|
|
||||||
|
QSet<QString> AppDelegate::getSelectedPackages() const {
|
||||||
|
return m_selectedPackages;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AppDelegate::clearSelection() {
|
||||||
|
m_selectedPackages.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 实现获取下载状态信息的方法
|
||||||
|
const QHash<QString, DownloadInfo>& AppDelegate::getDownloads() const {
|
||||||
|
return m_downloads;
|
||||||
|
}
|
||||||
@@ -5,13 +5,16 @@
|
|||||||
#include <QQueue>
|
#include <QQueue>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QElapsedTimer>
|
#include <QElapsedTimer>
|
||||||
|
#include <QTimer>
|
||||||
|
#include <QSet>
|
||||||
|
|
||||||
#include "downloadmanager.h"
|
#include "downloadmanager.h"
|
||||||
|
|
||||||
struct DownloadInfo {
|
struct DownloadInfo {
|
||||||
int progress = 0;
|
int progress = 0;
|
||||||
bool isDownloading = false;
|
bool isDownloading = false;
|
||||||
bool isInstalled = false;
|
bool isInstalled = false;
|
||||||
bool isInstalling = false; // 新增:标记是否正在安装
|
bool isInstalling = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
class AppDelegate : public QStyledItemDelegate {
|
class AppDelegate : public QStyledItemDelegate {
|
||||||
@@ -26,21 +29,43 @@ public:
|
|||||||
bool editorEvent(QEvent *event, QAbstractItemModel *model,
|
bool editorEvent(QEvent *event, QAbstractItemModel *model,
|
||||||
const QStyleOptionViewItem &option, const QModelIndex &index) override;
|
const QStyleOptionViewItem &option, const QModelIndex &index) override;
|
||||||
void startDownloadForAll();
|
void startDownloadForAll();
|
||||||
|
void startDownloadForSelected();
|
||||||
|
|
||||||
|
// 复选框相关方法
|
||||||
|
void setSelectedPackages(const QSet<QString> &selected);
|
||||||
|
QSet<QString> getSelectedPackages() const;
|
||||||
|
void clearSelection();
|
||||||
|
|
||||||
|
// 获取下载状态信息
|
||||||
|
const QHash<QString, DownloadInfo>& getDownloads() const;
|
||||||
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void updateDisplay(const QString &packageName);
|
void updateDisplay(const QString &packageName);
|
||||||
|
void updateFinished(bool success); //传递是否完成更新
|
||||||
|
void ignoreApp(const QString &packageName, const QString &version); // 新增:忽略应用信号
|
||||||
|
void unignoreApp(const QString &packageName); // 新增:取消忽略应用信号
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void updateSpinner(); // 新增槽函数
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DownloadManager *m_downloadManager;
|
DownloadManager *m_downloadManager;
|
||||||
QHash<QString, DownloadInfo> m_downloads;
|
QHash<QString, DownloadInfo> m_downloads;
|
||||||
QAbstractItemModel *m_model = nullptr;
|
QAbstractItemModel *m_model = nullptr;
|
||||||
|
|
||||||
|
// 复选框相关成员变量
|
||||||
|
QSet<QString> m_selectedPackages;
|
||||||
|
|
||||||
QQueue<QString> m_installQueue;
|
QQueue<QString> m_installQueue;
|
||||||
bool m_isInstalling = false;
|
bool m_isInstalling = false;
|
||||||
QProcess *m_installProcess = nullptr;
|
QProcess *m_installProcess = nullptr;
|
||||||
QString m_installingPackage; // 当前正在安装的包名
|
QString m_installingPackage;
|
||||||
QElapsedTimer m_spinnerTimer; // 用于转圈动画
|
QElapsedTimer m_spinnerTimer;
|
||||||
|
|
||||||
|
QTimer m_spinnerUpdateTimer; // 新增定时器
|
||||||
|
int m_spinnerAngle = 0; // 新增角度变量
|
||||||
|
|
||||||
void enqueueInstall(const QString &packageName);
|
void enqueueInstall(const QString &packageName);
|
||||||
void startNextInstall();
|
void startNextInstall();
|
||||||
};
|
};
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
#include "applistmodel.h"
|
#include "applistmodel.h"
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
AppListModel::AppListModel(QObject *parent) : QAbstractListModel(parent) {}
|
AppListModel::AppListModel(QObject *parent) : QAbstractListModel(parent) {}
|
||||||
|
|
||||||
@@ -33,6 +32,8 @@ QVariant AppListModel::data(const QModelIndex &index, int role) const
|
|||||||
return map.value("description");
|
return map.value("description");
|
||||||
case Qt::UserRole + 7: // 下载 URL
|
case Qt::UserRole + 7: // 下载 URL
|
||||||
return map.value("download_url"); // 返回下载 URL
|
return map.value("download_url"); // 返回下载 URL
|
||||||
|
case Qt::UserRole + 8: // 忽略状态
|
||||||
|
return map.value("ignored");
|
||||||
default:
|
default:
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
@@ -53,11 +54,21 @@ void AppListModel::setUpdateData(const QJsonArray &updateInfo)
|
|||||||
map["icon"] = obj["icon"].toString();
|
map["icon"] = obj["icon"].toString();
|
||||||
map["size"] = obj["size"].toString();
|
map["size"] = obj["size"].toString();
|
||||||
map["download_url"] = obj["download_url"].toString(); // 确保设置下载 URL
|
map["download_url"] = obj["download_url"].toString(); // 确保设置下载 URL
|
||||||
|
map["ignored"] = obj["ignored"].toBool(); // 设置忽略状态
|
||||||
m_data.append(map); // 添加到 QList<QVariantMap>
|
m_data.append(map); // 添加到 QList<QVariantMap>
|
||||||
|
|
||||||
qDebug() << "设置到模型的包名:" << map["package"].toString();
|
qDebug() << "设置到模型的包名:" << map["package"].toString() << "忽略状态:" << map["ignored"].toBool();
|
||||||
qDebug() << "设置到模型的下载 URL:" << map["download_url"].toString(); // 检查设置的数据
|
qDebug() << "设置到模型的下载 URL:" << map["download_url"].toString(); // 检查设置的数据
|
||||||
}
|
}
|
||||||
|
|
||||||
endResetModel();
|
endResetModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AppListModel::isAppIgnored(const QModelIndex &index) const
|
||||||
|
{
|
||||||
|
if (!index.isValid() || index.row() >= m_data.size())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
const QVariantMap &map = m_data.at(index.row());
|
||||||
|
return map.value("ignored").toBool();
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
// 添加 QJsonObject 头文件
|
// 添加 QJsonObject 头文件
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
|
#include <QDebug>
|
||||||
class AppListModel : public QAbstractListModel
|
class AppListModel : public QAbstractListModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -18,9 +18,12 @@ public:
|
|||||||
|
|
||||||
// 设置更新数据
|
// 设置更新数据
|
||||||
void setUpdateData(const QJsonArray &data);
|
void setUpdateData(const QJsonArray &data);
|
||||||
|
|
||||||
|
// 获取忽略状态
|
||||||
|
bool isAppIgnored(const QModelIndex &index) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<QVariantMap> m_data; // 修改类型为 QList<QVariantMap>
|
QList<QVariantMap> m_data; // 修改类型为 QList<QVariantMap>
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // APPLISTMODEL_H
|
#endif // APPLISTMODEL_H
|
||||||
@@ -15,16 +15,17 @@ QStringList aptssUpdater::getUpdateablePackages()
|
|||||||
{
|
{
|
||||||
QStringList packageDetails;
|
QStringList packageDetails;
|
||||||
QProcess process;
|
QProcess process;
|
||||||
QString command = R"(env LANGUAGE=en_US /usr/bin/apt -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf list --upgradable -o Dir::Etc::sourcelist="/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="/dev/null" -o APT::Get::List-Cleanup="0" | awk 'NR>1')";
|
QString command = R"(env LANGUAGE=en_US /usr/bin/apt -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf list --upgradable -o Dir::Etc::sourcelist="/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/aptss.list" -o Dir::Etc::sourceparts="/dev/null" -o APT::Get::List-Cleanup="0" | awk 'NR>1')";
|
||||||
|
|
||||||
process.start("bash", QStringList() << "-c" << command);
|
process.start("bash", QStringList() << "-c" << command);
|
||||||
if (!process.waitForFinished()) {
|
if (!process.waitForFinished(30000)) { // 30秒超时
|
||||||
qWarning() << "Process failed to finish.";
|
qWarning() << "Process failed to finish within 30 seconds.";
|
||||||
|
process.kill();
|
||||||
return packageDetails;
|
return packageDetails;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString output = process.readAllStandardOutput();
|
QString output = process.readAllStandardOutput();
|
||||||
QStringList lines = output.split('\n', QString::SkipEmptyParts);
|
QStringList lines = output.split('\n', Qt::SkipEmptyParts);
|
||||||
|
|
||||||
// 创建临时文件
|
// 创建临时文件
|
||||||
QTemporaryFile tempFile;
|
QTemporaryFile tempFile;
|
||||||
@@ -68,7 +69,6 @@ QStringList aptssUpdater::getUpdateablePackages()
|
|||||||
QStringList aptssUpdater::getPackageSizes()
|
QStringList aptssUpdater::getPackageSizes()
|
||||||
{
|
{
|
||||||
QStringList packageDetails;
|
QStringList packageDetails;
|
||||||
QProcess process;
|
|
||||||
|
|
||||||
// 获取可更新包名列表
|
// 获取可更新包名列表
|
||||||
QStringList updateablePackages;
|
QStringList updateablePackages;
|
||||||
@@ -77,14 +77,17 @@ QStringList aptssUpdater::getPackageSizes()
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach (const QString &packageName, updateablePackages) {
|
foreach (const QString &packageName, updateablePackages) {
|
||||||
|
QProcess process; // 在循环内部创建新的QProcess实例
|
||||||
|
|
||||||
// 构建新命令(包含包名参数)
|
// 构建新命令(包含包名参数)
|
||||||
QString command = QString("apt download %1 --print-uris -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf "
|
QString command = QString("/usr/bin/apt download %1 --print-uris -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf "
|
||||||
"-o Dir::Etc::sourcelist=\"/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list\" "
|
"-o Dir::Etc::sourcelist=\"/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/aptss.list\" "
|
||||||
"-o Dir::Etc::sourceparts=\"/dev/null\"").arg(packageName);
|
"-o Dir::Etc::sourceparts=\"/dev/null\"").arg(packageName);
|
||||||
|
|
||||||
process.start("bash", QStringList() << "-c" << command);
|
process.start("bash", QStringList() << "-c" << command);
|
||||||
if (!process.waitForFinished()) {
|
if (!process.waitForFinished(30000)) { // 30秒超时
|
||||||
qWarning() << "获取包信息失败:" << packageName;
|
qWarning() << "获取包信息失败:" << packageName << "(超时)";
|
||||||
|
process.kill();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,7 +119,6 @@ QStringList aptssUpdater::getPackageSizes()
|
|||||||
QStringList aptssUpdater::getDesktopAppNames()
|
QStringList aptssUpdater::getDesktopAppNames()
|
||||||
{
|
{
|
||||||
QStringList appNames;
|
QStringList appNames;
|
||||||
QProcess dpkgProcess;
|
|
||||||
|
|
||||||
// 获取当前系统语言环境
|
// 获取当前系统语言环境
|
||||||
QString lang = QLocale().name().replace("_", "-");
|
QString lang = QLocale().name().replace("_", "-");
|
||||||
@@ -125,13 +127,19 @@ QStringList aptssUpdater::getDesktopAppNames()
|
|||||||
QStringList packages = packageName;
|
QStringList packages = packageName;
|
||||||
|
|
||||||
foreach (const QString &package, packages) {
|
foreach (const QString &package, packages) {
|
||||||
|
QProcess dpkgProcess; // 在循环内部创建新的QProcess实例
|
||||||
|
|
||||||
QString packageName = package.split(":")[0];
|
QString packageName = package.split(":")[0];
|
||||||
QString finalName = packageName; // 默认使用包名
|
QString finalName = packageName; // 默认使用包名
|
||||||
|
|
||||||
// 获取包文件列表
|
// 获取包文件列表
|
||||||
dpkgProcess.start("dpkg", QStringList() << "-L" << packageName);
|
dpkgProcess.start("dpkg", QStringList() << "-L" << packageName);
|
||||||
dpkgProcess.waitForFinished();
|
if (!dpkgProcess.waitForFinished(30000)) { // 30秒超时
|
||||||
QStringList files = QString(dpkgProcess.readAllStandardOutput()).split('\n', QString::SkipEmptyParts);
|
qWarning() << "获取包文件列表失败:" << packageName << "(超时)";
|
||||||
|
dpkgProcess.kill();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
QStringList files = QString(dpkgProcess.readAllStandardOutput()).split('\n', Qt::SkipEmptyParts);
|
||||||
|
|
||||||
// 先检查常规应用目录
|
// 先检查常规应用目录
|
||||||
QStringList regularDesktopFiles = files.filter("/usr/share/applications/");
|
QStringList regularDesktopFiles = files.filter("/usr/share/applications/");
|
||||||
@@ -225,19 +233,25 @@ bool aptssUpdater::checkDesktopFiles(const QStringList &desktopFiles, QString &a
|
|||||||
QStringList aptssUpdater::getPackageIcons()
|
QStringList aptssUpdater::getPackageIcons()
|
||||||
{
|
{
|
||||||
QStringList packageIcons;
|
QStringList packageIcons;
|
||||||
QProcess dpkgProcess;
|
|
||||||
|
|
||||||
// 遍历所有可更新包
|
// 遍历所有可更新包
|
||||||
QStringList packages = packageName;
|
QStringList packages = packageName;
|
||||||
|
|
||||||
foreach (const QString &package, packages) {
|
foreach (const QString &package, packages) {
|
||||||
|
QProcess dpkgProcess; // 在循环内部创建新的QProcess实例
|
||||||
|
|
||||||
QString packageName = package.split(":")[0];
|
QString packageName = package.split(":")[0];
|
||||||
QString iconPath = ":/resources/default_icon.svg"; // 默认图标
|
QString iconPath = ":/resources/default_icon.png"; // 默认图标
|
||||||
|
|
||||||
// 获取包文件列表
|
// 获取包文件列表
|
||||||
dpkgProcess.start("dpkg", QStringList() << "-L" << packageName);
|
dpkgProcess.start("dpkg", QStringList() << "-L" << packageName);
|
||||||
dpkgProcess.waitForFinished();
|
if (!dpkgProcess.waitForFinished(30000)) { // 30秒超时
|
||||||
QStringList files = QString(dpkgProcess.readAllStandardOutput()).split('\n', QString::SkipEmptyParts);
|
qWarning() << "获取包文件列表失败:" << packageName << "(超时)";
|
||||||
|
dpkgProcess.kill();
|
||||||
|
packageIcons << QString("%1: %2").arg(packageName, iconPath);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
QStringList files = QString(dpkgProcess.readAllStandardOutput()).split('\n', Qt::SkipEmptyParts);
|
||||||
|
|
||||||
// 查找.desktop文件
|
// 查找.desktop文件
|
||||||
QStringList desktopFiles = files.filter(QRegularExpression("/(usr/share|opt/apps)/.*\\.desktop$"));
|
QStringList desktopFiles = files.filter(QRegularExpression("/(usr/share|opt/apps)/.*\\.desktop$"));
|
||||||
@@ -265,6 +279,7 @@ QStringList aptssUpdater::getPackageIcons()
|
|||||||
foreach (const QString &path, iconPaths) {
|
foreach (const QString &path, iconPaths) {
|
||||||
if (QFile::exists(path)) {
|
if (QFile::exists(path)) {
|
||||||
iconPath = path;
|
iconPath = path;
|
||||||
|
qDebug() << "找到图标文件:" << path;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -272,6 +287,7 @@ QStringList aptssUpdater::getPackageIcons()
|
|||||||
// 已经是绝对路径
|
// 已经是绝对路径
|
||||||
if (QFile::exists(iconName)) {
|
if (QFile::exists(iconName)) {
|
||||||
iconPath = iconName;
|
iconPath = iconName;
|
||||||
|
qDebug() << "使用绝对路径图标文件:" << iconName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -282,10 +298,14 @@ QStringList aptssUpdater::getPackageIcons()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 如果.desktop中没有找到图标,尝试直接查找包中的图标文件
|
// 如果.desktop中没有找到图标,尝试直接查找包中的图标文件
|
||||||
if (iconPath == ":/resources/default_icon.svg") {
|
if (iconPath == ":/resources/default_icon.png") {
|
||||||
|
qDebug() << "未在.desktop文件中找到图标,尝试直接查找包中的图标文件";
|
||||||
QStringList iconFiles = files.filter(QRegularExpression("/(usr/share/pixmaps|usr/share/icons|opt/apps/.*/entries/icons)/.*\\.(png|svg)$"));
|
QStringList iconFiles = files.filter(QRegularExpression("/(usr/share/pixmaps|usr/share/icons|opt/apps/.*/entries/icons)/.*\\.(png|svg)$"));
|
||||||
if (!iconFiles.isEmpty()) {
|
if (!iconFiles.isEmpty()) {
|
||||||
iconPath = iconFiles.first();
|
iconPath = iconFiles.first();
|
||||||
|
qDebug() << "从包中找到图标文件:" << iconPath;
|
||||||
|
} else {
|
||||||
|
qDebug() << "未在包中找到图标文件,使用默认图标";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -393,6 +413,4 @@ QJsonArray aptssUpdater::getUpdateInfoAsJson()
|
|||||||
}
|
}
|
||||||
qDebug()<<jsonArray;
|
qDebug()<<jsonArray;
|
||||||
return jsonArray;
|
return jsonArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -4,5 +4,6 @@
|
|||||||
<file>../resources/default_icon.svg</file>
|
<file>../resources/default_icon.svg</file>
|
||||||
<file>../resources/spark-update-tool.svg</file>
|
<file>../resources/spark-update-tool.svg</file>
|
||||||
<file>../resources/128*128/spark-update-tool.png</file>
|
<file>../resources/128*128/spark-update-tool.png</file>
|
||||||
|
<file>../resources/default_icon.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
148
spark-update-tool/src/ignoreconfig.cpp
Normal file
@@ -0,0 +1,148 @@
|
|||||||
|
#include "ignoreconfig.h"
|
||||||
|
#include <QStandardPaths>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QFile>
|
||||||
|
#include <QTextStream>
|
||||||
|
#include <QDebug>
|
||||||
|
#include <unistd.h> // for geteuid
|
||||||
|
|
||||||
|
IgnoreConfig::IgnoreConfig(QObject *parent)
|
||||||
|
: QObject(parent)
|
||||||
|
{
|
||||||
|
// 设置配置文件路径
|
||||||
|
QString configDir;
|
||||||
|
|
||||||
|
// // 检查是否以 root 权限运行
|
||||||
|
// if (geteuid() == 0) {
|
||||||
|
// // 首先检查是否有 SUDO_USER_HOME 环境变量(表示是通过 pkexec 提权的普通用户)
|
||||||
|
// QByteArray sudoUserHomeEnv = qgetenv("SUDO_USER_HOME");
|
||||||
|
// if (!sudoUserHomeEnv.isEmpty()) {
|
||||||
|
// // 通过 pkexec 提权的普通用户,使用原用户的配置目录
|
||||||
|
// QString sudoUserHomePath = QString::fromLocal8Bit(sudoUserHomeEnv);
|
||||||
|
// configDir = sudoUserHomePath + "/.config";
|
||||||
|
// } else {
|
||||||
|
// // 获取实际的 HOME 目录来判断是真正的 root 用户还是其他方式提权的用户
|
||||||
|
// QByteArray homeEnv = qgetenv("HOME");
|
||||||
|
// QString homePath = QString::fromLocal8Bit(homeEnv);
|
||||||
|
|
||||||
|
// if (homePath == "/root") {
|
||||||
|
// // 真正的 root 用户,使用 /root/.config
|
||||||
|
// configDir = "/root/.config";
|
||||||
|
// } else {
|
||||||
|
// // 其他方式提权的用户,使用 HOME 目录下的配置
|
||||||
|
// configDir = homePath + "/.config";
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// // 普通用户,使用标准配置目录
|
||||||
|
// configDir = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation);
|
||||||
|
// }
|
||||||
|
configDir = "/etc/";
|
||||||
|
QDir dir(configDir);
|
||||||
|
if (!dir.exists()) {
|
||||||
|
dir.mkpath(".");
|
||||||
|
}
|
||||||
|
m_configFilePath = dir.filePath("spark-store/ignored_apps.conf");
|
||||||
|
|
||||||
|
// 确保目录存在
|
||||||
|
QFileInfo fileInfo(m_configFilePath);
|
||||||
|
QDir configDirPath = fileInfo.dir();
|
||||||
|
if (!configDirPath.exists()) {
|
||||||
|
configDirPath.mkpath(".");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 加载现有配置
|
||||||
|
loadConfig();
|
||||||
|
|
||||||
|
// 输出忽略列表到 qDebug
|
||||||
|
printIgnoredApps();
|
||||||
|
}
|
||||||
|
|
||||||
|
void IgnoreConfig::addIgnoredApp(const QString &packageName, const QString &version)
|
||||||
|
{
|
||||||
|
m_ignoredApps.insert(qMakePair(packageName, version));
|
||||||
|
saveConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
void IgnoreConfig::removeIgnoredApp(const QString &packageName)
|
||||||
|
{
|
||||||
|
// 移除所有该包名的版本
|
||||||
|
auto it = m_ignoredApps.begin();
|
||||||
|
while (it != m_ignoredApps.end()) {
|
||||||
|
if (it->first == packageName) {
|
||||||
|
it = m_ignoredApps.erase(it);
|
||||||
|
} else {
|
||||||
|
++it;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
saveConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IgnoreConfig::isAppIgnored(const QString &packageName, const QString &version) const
|
||||||
|
{
|
||||||
|
return m_ignoredApps.contains(qMakePair(packageName, version));
|
||||||
|
}
|
||||||
|
|
||||||
|
QSet<QPair<QString, QString>> IgnoreConfig::getIgnoredApps() const
|
||||||
|
{
|
||||||
|
return m_ignoredApps;
|
||||||
|
}
|
||||||
|
|
||||||
|
void IgnoreConfig::printIgnoredApps() const
|
||||||
|
{
|
||||||
|
qDebug() << "=== 忽略的应用列表 ===";
|
||||||
|
qDebug() << "配置文件路径:" << m_configFilePath;
|
||||||
|
|
||||||
|
if (m_ignoredApps.isEmpty()) {
|
||||||
|
qDebug() << "没有忽略的应用";
|
||||||
|
} else {
|
||||||
|
for (const auto &app : m_ignoredApps) {
|
||||||
|
qDebug() << "忽略的应用:" << app.first << "版本:" << app.second;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
qDebug() << "====================";
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IgnoreConfig::saveConfig()
|
||||||
|
{
|
||||||
|
QFile file(m_configFilePath);
|
||||||
|
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||||
|
qDebug() << "无法打开配置文件进行写入:" << m_configFilePath;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
QTextStream out(&file);
|
||||||
|
for (const auto &app : m_ignoredApps) {
|
||||||
|
out << app.first << "|" << app.second << "\n";
|
||||||
|
}
|
||||||
|
file.close();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IgnoreConfig::loadConfig()
|
||||||
|
{
|
||||||
|
QFile file(m_configFilePath);
|
||||||
|
if (!file.exists()) {
|
||||||
|
// 配置文件不存在,这是正常的,返回true表示没有错误
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||||
|
qDebug() << "无法打开配置文件进行读取:" << m_configFilePath;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_ignoredApps.clear();
|
||||||
|
QTextStream in(&file);
|
||||||
|
while (!in.atEnd()) {
|
||||||
|
QString line = in.readLine().trimmed();
|
||||||
|
if (!line.isEmpty()) {
|
||||||
|
QStringList parts = line.split('|');
|
||||||
|
if (parts.size() == 2) {
|
||||||
|
m_ignoredApps.insert(qMakePair(parts[0], parts[1]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file.close();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
42
spark-update-tool/src/ignoreconfig.h
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
#ifndef IGNORECONFIG_H
|
||||||
|
#define IGNORECONFIG_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include <QSet>
|
||||||
|
#include <QString>
|
||||||
|
#include <QPair>
|
||||||
|
|
||||||
|
class IgnoreConfig : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit IgnoreConfig(QObject *parent = nullptr);
|
||||||
|
|
||||||
|
// 添加忽略的应用(包名和版本号)
|
||||||
|
void addIgnoredApp(const QString &packageName, const QString &version);
|
||||||
|
|
||||||
|
// 移除忽略的应用
|
||||||
|
void removeIgnoredApp(const QString &packageName);
|
||||||
|
|
||||||
|
// 检查应用是否被忽略
|
||||||
|
bool isAppIgnored(const QString &packageName, const QString &version) const;
|
||||||
|
|
||||||
|
// 获取所有被忽略的应用
|
||||||
|
QSet<QPair<QString, QString>> getIgnoredApps() const;
|
||||||
|
|
||||||
|
// 输出所有被忽略的应用到 qDebug
|
||||||
|
void printIgnoredApps() const;
|
||||||
|
|
||||||
|
// 保存配置到文件
|
||||||
|
bool saveConfig();
|
||||||
|
|
||||||
|
// 从文件加载配置
|
||||||
|
bool loadConfig();
|
||||||
|
|
||||||
|
private:
|
||||||
|
QSet<QPair<QString, QString>> m_ignoredApps;
|
||||||
|
QString m_configFilePath;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // IGNORECONFIG_H
|
||||||
@@ -16,11 +16,13 @@ bool elevateToRoot() {
|
|||||||
|
|
||||||
QByteArray display = qgetenv("DISPLAY");
|
QByteArray display = qgetenv("DISPLAY");
|
||||||
QByteArray xauthority = qgetenv("XAUTHORITY");
|
QByteArray xauthority = qgetenv("XAUTHORITY");
|
||||||
|
QByteArray home = qgetenv("HOME"); // 获取原始用户的 HOME 目境变量
|
||||||
|
|
||||||
QStringList args;
|
QStringList args;
|
||||||
args << "env"
|
args << "env"
|
||||||
<< "DISPLAY=" + display
|
<< "DISPLAY=" + display
|
||||||
<< "XAUTHORITY=" + xauthority
|
<< "XAUTHORITY=" + xauthority
|
||||||
|
<< "SUDO_USER_HOME=" + home // 传递原始用户的 HOME 路径
|
||||||
<< program;
|
<< program;
|
||||||
|
|
||||||
QProcess process;
|
QProcess process;
|
||||||
@@ -7,11 +7,13 @@
|
|||||||
#include <QFutureWatcher> // 新增
|
#include <QFutureWatcher> // 新增
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <qicon.h>
|
#include <qicon.h>
|
||||||
|
#include <unistd.h> // for geteuid
|
||||||
MainWindow::MainWindow(QWidget *parent)
|
MainWindow::MainWindow(QWidget *parent)
|
||||||
: QMainWindow(parent)
|
: QMainWindow(parent)
|
||||||
, ui(new Ui::MainWindow)
|
, ui(new Ui::MainWindow)
|
||||||
, m_model(new AppListModel(this))
|
, m_model(new AppListModel(this))
|
||||||
, m_delegate(new AppDelegate(this))
|
, m_delegate(new AppDelegate(this))
|
||||||
|
, m_ignoreConfig(new IgnoreConfig(this))
|
||||||
{
|
{
|
||||||
QIcon icon(":/resources/128*128/spark-update-tool.png");
|
QIcon icon(":/resources/128*128/spark-update-tool.png");
|
||||||
setWindowIcon(icon);
|
setWindowIcon(icon);
|
||||||
@@ -53,11 +55,26 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 连接应用委托的信号
|
||||||
|
connect(m_delegate, &AppDelegate::ignoreApp, this, &MainWindow::onIgnoreApp);
|
||||||
|
connect(m_delegate, &AppDelegate::unignoreApp, this, &MainWindow::onUnignoreApp);
|
||||||
|
|
||||||
// 新增:点击“更新全部”按钮批量下载
|
// 新增:点击“更新全部”按钮批量下载
|
||||||
connect(ui->updatePushButton, &QPushButton::clicked, this, [=](){
|
connect(ui->updatePushButton, &QPushButton::clicked, this, [=](){
|
||||||
qDebug()<<"更新全部按钮被点击";
|
qDebug()<<"更新按钮被点击";
|
||||||
m_delegate->startDownloadForAll();
|
if (m_delegate->getSelectedPackages().isEmpty()) {
|
||||||
|
// 没有选中任何应用,更新全部
|
||||||
|
m_delegate->startDownloadForAll();
|
||||||
|
} else {
|
||||||
|
// 有选中应用,更新选中
|
||||||
|
m_delegate->startDownloadForSelected();
|
||||||
|
m_delegate->clearSelection();
|
||||||
|
updateButtonText();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 新增:监听选择变化
|
||||||
|
connect(m_delegate, &AppDelegate::updateDisplay, this, &MainWindow::handleSelectionChanged);
|
||||||
|
|
||||||
checkUpdates();
|
checkUpdates();
|
||||||
// 新增:监听搜索框文本变化
|
// 新增:监听搜索框文本变化
|
||||||
@@ -75,6 +92,12 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
watcher->setFuture(QtConcurrent::run([this](){
|
watcher->setFuture(QtConcurrent::run([this](){
|
||||||
runAptssUpgrade();
|
runAptssUpgrade();
|
||||||
}));
|
}));
|
||||||
|
QScreen *screen = QGuiApplication::screenAt(QCursor::pos());
|
||||||
|
if (!screen) screen = QGuiApplication::primaryScreen();
|
||||||
|
QRect screenGeometry = screen->geometry();
|
||||||
|
int x = screenGeometry.x() + (screenGeometry.width() - this->width()) / 2;
|
||||||
|
int y = screenGeometry.y() + (screenGeometry.height() - this->height()) / 2;
|
||||||
|
this->move(x, y);
|
||||||
}
|
}
|
||||||
//初始化控件样式
|
//初始化控件样式
|
||||||
void MainWindow::initStyle()
|
void MainWindow::initStyle()
|
||||||
@@ -207,12 +230,42 @@ void MainWindow::checkUpdates()
|
|||||||
{
|
{
|
||||||
aptssUpdater updater;
|
aptssUpdater updater;
|
||||||
QJsonArray updateInfo = updater.getUpdateInfoAsJson();
|
QJsonArray updateInfo = updater.getUpdateInfoAsJson();
|
||||||
m_allApps = updateInfo; // 保存所有应用数据
|
|
||||||
m_model->setUpdateData(updateInfo);
|
// 分离正常应用和忽略应用
|
||||||
|
QJsonArray normalApps;
|
||||||
|
QJsonArray ignoredApps;
|
||||||
|
|
||||||
for (const auto &item : updateInfo) {
|
for (const auto &item : updateInfo) {
|
||||||
QJsonObject obj = item.toObject();
|
QJsonObject obj = item.toObject();
|
||||||
qDebug() << "模型设置的包名:" << obj["package"].toString();
|
QString packageName = obj["package"].toString();
|
||||||
|
QString currentVersion = obj["current_version"].toString();
|
||||||
|
|
||||||
|
// 检查应用是否被忽略
|
||||||
|
if (m_ignoreConfig->isAppIgnored(packageName, currentVersion)) {
|
||||||
|
// 标记为忽略状态
|
||||||
|
obj["ignored"] = true;
|
||||||
|
ignoredApps.append(obj);
|
||||||
|
} else {
|
||||||
|
obj["ignored"] = false;
|
||||||
|
normalApps.append(obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 合并数组:正常应用在前,忽略应用在后
|
||||||
|
QJsonArray finalApps;
|
||||||
|
for (const auto &item : normalApps) {
|
||||||
|
finalApps.append(item);
|
||||||
|
}
|
||||||
|
for (const auto &item : ignoredApps) {
|
||||||
|
finalApps.append(item);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_allApps = finalApps; // 保存所有应用数据
|
||||||
|
m_model->setUpdateData(finalApps);
|
||||||
|
|
||||||
|
for (const auto &item : finalApps) {
|
||||||
|
QJsonObject obj = item.toObject();
|
||||||
|
qDebug() << "模型设置的包名:" << obj["package"].toString() << "忽略状态:" << obj["ignored"].toBool();
|
||||||
qDebug() << "模型设置的下载 URL:" << obj["download_url"].toString(); // 检查模型数据
|
qDebug() << "模型设置的下载 URL:" << obj["download_url"].toString(); // 检查模型数据
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -224,7 +277,11 @@ void MainWindow::filterAppsByKeyword(const QString &keyword)
|
|||||||
m_model->setUpdateData(m_allApps);
|
m_model->setUpdateData(m_allApps);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QJsonArray filtered;
|
|
||||||
|
// 分离正常应用和忽略应用
|
||||||
|
QJsonArray normalApps;
|
||||||
|
QJsonArray ignoredApps;
|
||||||
|
|
||||||
for (const auto &item : m_allApps) {
|
for (const auto &item : m_allApps) {
|
||||||
QJsonObject obj = item.toObject();
|
QJsonObject obj = item.toObject();
|
||||||
// 可根据需要匹配更多字段
|
// 可根据需要匹配更多字段
|
||||||
@@ -232,31 +289,157 @@ void MainWindow::filterAppsByKeyword(const QString &keyword)
|
|||||||
QString package = obj.value("package").toString();
|
QString package = obj.value("package").toString();
|
||||||
if (name.contains(keyword, Qt::CaseInsensitive) ||
|
if (name.contains(keyword, Qt::CaseInsensitive) ||
|
||||||
package.contains(keyword, Qt::CaseInsensitive)) {
|
package.contains(keyword, Qt::CaseInsensitive)) {
|
||||||
filtered.append(item);
|
|
||||||
|
// 检查是否为忽略状态
|
||||||
|
if (obj.value("ignored").toBool()) {
|
||||||
|
ignoredApps.append(item);
|
||||||
|
} else {
|
||||||
|
normalApps.append(item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 合并数组:正常应用在前,忽略应用在后
|
||||||
|
QJsonArray filtered;
|
||||||
|
for (const auto &item : normalApps) {
|
||||||
|
filtered.append(item);
|
||||||
|
}
|
||||||
|
for (const auto &item : ignoredApps) {
|
||||||
|
filtered.append(item);
|
||||||
|
}
|
||||||
|
|
||||||
m_model->setUpdateData(filtered);
|
m_model->setUpdateData(filtered);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::runAptssUpgrade()
|
void MainWindow::runAptssUpgrade()
|
||||||
{
|
{
|
||||||
QProcess process;
|
QProcess process;
|
||||||
QStringList args;
|
|
||||||
args << "sudo" <<"aptss" << "ssupdate";
|
// 检查是否已经是root用户,如果是则直接执行命令,否则使用sudo
|
||||||
process.start("sudo", args);
|
if (geteuid() == 0) {
|
||||||
|
// root用户直接执行
|
||||||
|
process.start("aptss", QStringList() << "ssupdate");
|
||||||
|
} else {
|
||||||
|
// 非root用户使用sudo
|
||||||
|
process.start("sudo", QStringList() << "aptss" << "ssupdate");
|
||||||
|
}
|
||||||
|
|
||||||
if (!process.waitForStarted(5000)) {
|
if (!process.waitForStarted(5000)) {
|
||||||
QMessageBox::warning(this, "升级失败", "无法启动 sudo aptss ssupdate");
|
QMessageBox::warning(this, "升级失败", "无法启动 aptss ssupdate");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
process.write("n\n");
|
process.write("n\n");
|
||||||
process.closeWriteChannel();
|
process.closeWriteChannel();
|
||||||
process.waitForFinished(-1);
|
|
||||||
if (process.exitCode() != 0) {
|
// 设置超时时间,避免无限等待
|
||||||
QMessageBox::warning(this, "升级失败", "执行 sudo aptss ssupdate 失败,请检查系统环境。");
|
if (!process.waitForFinished(30000)) { // 30秒超时
|
||||||
|
qDebug() << "aptss ssupdate 执行超时";
|
||||||
|
process.kill(); // 强制终止进程
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (process.exitCode() != 0) {
|
||||||
|
QMessageBox::warning(this, "升级失败", "执行 aptss ssupdate 失败,请检查系统环境或稍后再试。");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void MainWindow::closeEvent(QCloseEvent *event)
|
||||||
|
{
|
||||||
|
// 检查是否正在进行更新
|
||||||
|
bool isUpdating = false;
|
||||||
|
|
||||||
|
// 通过AppDelegate检查是否有正在下载或安装的应用
|
||||||
|
const QHash<QString, DownloadInfo>& downloads = m_delegate->getDownloads();
|
||||||
|
for (auto it = downloads.constBegin(); it != downloads.constEnd(); ++it) {
|
||||||
|
if (it.value().isDownloading || it.value().isInstalling) {
|
||||||
|
isUpdating = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果正在更新,才显示确认对话框
|
||||||
|
if (isUpdating) {
|
||||||
|
QMessageBox::StandardButton reply = QMessageBox::question(this, "确认关闭", "正在更新,是否确认关闭窗口?", QMessageBox::Yes | QMessageBox::No);
|
||||||
|
|
||||||
|
if (reply == QMessageBox::Yes) {
|
||||||
|
event->accept();
|
||||||
|
} else {
|
||||||
|
event->ignore();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 如果没有更新,直接关闭窗口
|
||||||
|
event->accept();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void MainWindow::handleUpdateFinished(bool success)
|
||||||
|
{
|
||||||
|
if (success) {
|
||||||
|
// 更新成功时的处理逻辑
|
||||||
|
QMessageBox::information(this, "更新完成", "软件更新已成功完成!");
|
||||||
|
} else {
|
||||||
|
// 更新失败时的处理逻辑
|
||||||
|
QMessageBox::warning(this, "更新失败", "软件更新过程中出现错误,请稍后再试。");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 刷新应用列表
|
||||||
|
checkUpdates();
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 新增:更新按钮文本
|
||||||
|
void MainWindow::updateButtonText() {
|
||||||
|
int selectedCount = m_delegate->getSelectedPackages().size();
|
||||||
|
if (selectedCount > 0) {
|
||||||
|
ui->updatePushButton->setText(QString("更新选中(%1)").arg(selectedCount));
|
||||||
|
} else {
|
||||||
|
ui->updatePushButton->setText("更新全部");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增:处理选择变化
|
||||||
|
void MainWindow::handleSelectionChanged() {
|
||||||
|
updateButtonText();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增:处理忽略应用的槽函数
|
||||||
|
void MainWindow::onIgnoreApp(const QString &packageName, const QString &version) {
|
||||||
|
// 将应用添加到忽略配置中
|
||||||
|
m_ignoreConfig->addIgnoredApp(packageName, version);
|
||||||
|
|
||||||
|
// 更新模型中应用的状态,而不是移除
|
||||||
|
QJsonArray updatedApps;
|
||||||
|
for (const auto &item : m_allApps) {
|
||||||
|
QJsonObject obj = item.toObject();
|
||||||
|
if (obj["package"].toString() == packageName) {
|
||||||
|
obj["ignored"] = true; // 标记为忽略状态
|
||||||
|
}
|
||||||
|
updatedApps.append(obj);
|
||||||
|
}
|
||||||
|
m_allApps = updatedApps;
|
||||||
|
|
||||||
|
// 重新排序:正常应用在前,忽略应用在后
|
||||||
|
checkUpdates();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增:处理取消忽略应用的槽函数
|
||||||
|
void MainWindow::onUnignoreApp(const QString &packageName) {
|
||||||
|
// 从忽略配置中移除应用
|
||||||
|
m_ignoreConfig->removeIgnoredApp(packageName);
|
||||||
|
|
||||||
|
// 更新模型中应用的状态
|
||||||
|
QJsonArray updatedApps;
|
||||||
|
for (const auto &item : m_allApps) {
|
||||||
|
QJsonObject obj = item.toObject();
|
||||||
|
if (obj["package"].toString() == packageName) {
|
||||||
|
obj["ignored"] = false; // 标记为非忽略状态
|
||||||
|
}
|
||||||
|
updatedApps.append(obj);
|
||||||
|
}
|
||||||
|
m_allApps = updatedApps;
|
||||||
|
|
||||||
|
// 重新排序:正常应用在前,忽略应用在后
|
||||||
|
checkUpdates();
|
||||||
|
}
|
||||||
@@ -5,9 +5,10 @@
|
|||||||
#include "aptssupdater.h"
|
#include "aptssupdater.h"
|
||||||
#include "applistmodel.h"
|
#include "applistmodel.h"
|
||||||
#include "appdelegate.h"
|
#include "appdelegate.h"
|
||||||
|
#include "ignoreconfig.h"
|
||||||
#include <QListView>
|
#include <QListView>
|
||||||
#include <QJsonArray> // 添加头文件
|
#include <QJsonArray> // 添加头文件
|
||||||
|
#include <QScreen>
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
@@ -22,6 +23,9 @@ public:
|
|||||||
MainWindow(QWidget *parent = nullptr);
|
MainWindow(QWidget *parent = nullptr);
|
||||||
~MainWindow();
|
~MainWindow();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void closeEvent(QCloseEvent *event) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::MainWindow *ui;
|
Ui::MainWindow *ui;
|
||||||
void checkUpdates();
|
void checkUpdates();
|
||||||
@@ -29,8 +33,16 @@ private:
|
|||||||
void runAptssUpgrade();
|
void runAptssUpgrade();
|
||||||
AppListModel *m_model;
|
AppListModel *m_model;
|
||||||
AppDelegate *m_delegate;
|
AppDelegate *m_delegate;
|
||||||
|
IgnoreConfig *m_ignoreConfig; // 新增:忽略配置管理
|
||||||
QListView *listView; // 声明 QListView 指针
|
QListView *listView; // 声明 QListView 指针
|
||||||
QJsonArray m_allApps; // 新增:保存所有应用数据
|
QJsonArray m_allApps; // 新增:保存所有应用数据
|
||||||
void filterAppsByKeyword(const QString &keyword); // 新增:搜索过滤函数声明
|
void filterAppsByKeyword(const QString &keyword); // 新增:搜索过滤函数声明
|
||||||
|
void updateButtonText(); // 新增:更新按钮文本
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void handleUpdateFinished(bool success); // 新增:处理更新完成的槽函数
|
||||||
|
void handleSelectionChanged(); // 新增:处理选择变化的槽函数
|
||||||
|
void onIgnoreApp(const QString &packageName, const QString &version); // 新增:处理忽略应用的槽函数
|
||||||
|
void onUnignoreApp(const QString &packageName); // 新增:处理取消忽略应用
|
||||||
};
|
};
|
||||||
#endif // MAINWINDOW_H
|
#endif // MAINWINDOW_H
|
||||||
@@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1440</width>
|
<width>800</width>
|
||||||
<height>858</height>
|
<height>600</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@@ -253,4 +253,4 @@
|
|||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
45
src/CMakeLists.txt
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets Concurrent Network Svg WebEngineWidgets Concurrent)
|
||||||
|
find_package(Dtk6 REQUIRED COMPONENTS Core Gui Widget)
|
||||||
|
|
||||||
|
# 添加构建时间宏
|
||||||
|
string(TIMESTAMP BUILD_DATE "%Y.%m.%d" UTC)
|
||||||
|
string(TIMESTAMP BUILD_TIME "%H:%M:%S" UTC)
|
||||||
|
add_definitions(-DBUILD_DATE="${BUILD_DATE}")
|
||||||
|
add_definitions(-DBUILD_TIME="${BUILD_TIME}")
|
||||||
|
|
||||||
|
include(src.cmake)
|
||||||
|
|
||||||
|
add_executable(${PROJECT_NAME} ${HEADERS} ${SOURCES} ${QRC_FILE})
|
||||||
|
|
||||||
|
target_include_directories(${PROJECT_NAME} PUBLIC
|
||||||
|
Qt6::Core
|
||||||
|
Qt6::Gui
|
||||||
|
Qt6::Widgets
|
||||||
|
Qt6::Concurrent
|
||||||
|
Qt6::Network
|
||||||
|
Qt6::Svg
|
||||||
|
Qt6::WebEngineWidgets
|
||||||
|
Dtk6::Core
|
||||||
|
Dtk6::Gui
|
||||||
|
Dtk6::Widget
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||||
|
Qt6::Core
|
||||||
|
Qt6::Gui
|
||||||
|
Qt6::Widgets
|
||||||
|
Qt6::Concurrent
|
||||||
|
Qt6::Network
|
||||||
|
Qt6::Svg
|
||||||
|
Qt6::WebEngineWidgets
|
||||||
|
Dtk6::Core
|
||||||
|
Dtk6::Gui
|
||||||
|
Dtk6::Widget
|
||||||
|
)
|
||||||
|
|
||||||
|
install(TARGETS ${PROJECT_NAME} DESTINATION /opt/durapps/${PROJECT_NAME}/bin)
|
||||||
|
|
||||||
|
install(DIRECTORY ${CMAKE_SOURCE_DIR}/tool/ DESTINATION /opt/durapps/${PROJECT_NAME}/bin USE_SOURCE_PERMISSIONS)
|
||||||
|
install(DIRECTORY ${CMAKE_SOURCE_DIR}/pkg/lib/ DESTINATION /lib USE_SOURCE_PERMISSIONS)
|
||||||
|
install(DIRECTORY ${CMAKE_SOURCE_DIR}/pkg/tmp/ DESTINATION /tmp USE_SOURCE_PERMISSIONS)
|
||||||
|
install(DIRECTORY ${CMAKE_SOURCE_DIR}/pkg/usr/ DESTINATION ${CMAKE_INSTALL_PREFIX} USE_SOURCE_PERMISSIONS)
|
||||||
@@ -25,7 +25,6 @@ Application::Application(int &argc, char **argv)
|
|||||||
if (!DPlatformWindowHandle::pluginVersion().isEmpty()) {
|
if (!DPlatformWindowHandle::pluginVersion().isEmpty()) {
|
||||||
setAttribute(Qt::AA_DontCreateNativeWidgetSiblings, true);
|
setAttribute(Qt::AA_DontCreateNativeWidgetSiblings, true);
|
||||||
}
|
}
|
||||||
setAttribute(Qt::AA_UseHighDpiPixmaps);
|
|
||||||
|
|
||||||
setQuitOnLastWindowClosed(false); // 启用托盘图标时,关闭窗口程序仍然运行
|
setQuitOnLastWindowClosed(false); // 启用托盘图标时,关闭窗口程序仍然运行
|
||||||
|
|
||||||
@@ -89,12 +88,25 @@ void Application::checkAppConfigLocation()
|
|||||||
void Application::setBuildDateTime(const QString &buildDateTime)
|
void Application::setBuildDateTime(const QString &buildDateTime)
|
||||||
{
|
{
|
||||||
QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat);
|
QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat);
|
||||||
|
|
||||||
|
// 确保 UUID 存在
|
||||||
|
if (!config.contains("info/uuid")) {
|
||||||
|
QUuid uuid = QUuid::createUuid();
|
||||||
|
config.setValue("info/uuid", uuid.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
QString currentUuid = config.value("info/uuid").toString();
|
||||||
|
|
||||||
if (config.value("build/version").toString() != QString(APP_VERSION)) {
|
if (config.value("build/version").toString() != QString(APP_VERSION)) {
|
||||||
qDebug() << "Spark Store has been updated!";
|
qDebug() << "Spark Store has been updated!";
|
||||||
|
|
||||||
config.setValue("build/version", QString(APP_VERSION));
|
config.setValue("build/version", QString(APP_VERSION));
|
||||||
config.setValue("build/branch", QString(APP_BRANCH));
|
config.setValue("build/branch", QString(APP_BRANCH));
|
||||||
config.setValue("build/time", buildDateTime);
|
config.setValue("build/time", buildDateTime);
|
||||||
|
|
||||||
|
// 恢复原有的 UUID
|
||||||
|
config.setValue("info/uuid", currentUuid);
|
||||||
|
|
||||||
config.sync();
|
config.sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,7 +176,10 @@ void Application::loadTranslator()
|
|||||||
|
|
||||||
if (QLocale::system().language() == QLocale::Chinese) {
|
if (QLocale::system().language() == QLocale::Chinese) {
|
||||||
QTranslator *webengineTranslator = new QTranslator(this);
|
QTranslator *webengineTranslator = new QTranslator(this);
|
||||||
webengineTranslator->load(QLocale(QLocale::Chinese), "qtwebengine", "_", ":/translations");
|
bool loaded = webengineTranslator->load(QLocale(QLocale::Chinese), "qtwebengine", "_", ":/translations");
|
||||||
|
if (!loaded) {
|
||||||
|
qWarning() << "Failed to load webengine translator";
|
||||||
|
}
|
||||||
installTranslator(webengineTranslator);
|
installTranslator(webengineTranslator);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 34 KiB |
@@ -10,6 +10,7 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
#include <QCoreApplication>
|
||||||
|
|
||||||
DataCollectorAndUploader::DataCollectorAndUploader(QObject *parent) : QObject(parent)
|
DataCollectorAndUploader::DataCollectorAndUploader(QObject *parent) : QObject(parent)
|
||||||
{
|
{
|
||||||
@@ -27,11 +28,17 @@ void DataCollectorAndUploader::collectData()
|
|||||||
QString architecture;
|
QString architecture;
|
||||||
|
|
||||||
QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat);
|
QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat);
|
||||||
QString version = config.value("build/version").toString();
|
QString version = QString(APP_VERSION); // 使用编译时定义的版本号
|
||||||
QString uuid = config.value("info/uuid").toString();
|
QString uuid = config.value("info/uuid").toString();
|
||||||
|
|
||||||
// Read /etc/os-release file
|
// 根据环境变量选择 os-release 文件路径
|
||||||
QFile osReleaseFile("/etc/os-release");
|
QString osReleasePath = "/etc/os-release";
|
||||||
|
if (qEnvironmentVariableIsSet("IS_ACE_ENV") && qgetenv("IS_ACE_ENV") == "1") {
|
||||||
|
osReleasePath = "/host/etc/os-release";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read os-release file
|
||||||
|
QFile osReleaseFile(osReleasePath);
|
||||||
if (osReleaseFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
if (osReleaseFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||||
QTextStream in(&osReleaseFile);
|
QTextStream in(&osReleaseFile);
|
||||||
while (!in.atEnd()) {
|
while (!in.atEnd()) {
|
||||||
@@ -44,7 +51,7 @@ void DataCollectorAndUploader::collectData()
|
|||||||
}
|
}
|
||||||
osReleaseFile.close();
|
osReleaseFile.close();
|
||||||
} else {
|
} else {
|
||||||
qWarning() << "Could not open /etc/os-release file";
|
qWarning() << "Could not open os-release file:" << osReleasePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute uname -m to get the architecture
|
// Execute uname -m to get the architecture
|
||||||
@@ -83,4 +90,4 @@ void DataCollectorAndUploader::collectData()
|
|||||||
}
|
}
|
||||||
reply->deleteLater();
|
reply->deleteLater();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -41,7 +41,7 @@ bool checkMeatlink(QString metaUrl)
|
|||||||
metaStatus.remove();
|
metaStatus.remove();
|
||||||
}
|
}
|
||||||
QString cmd = QString("curl -I -s --connect-timeout 5 %1 -w %{http_code} |tail -n1 > /tmp/spark-store/metaStatus.txt").arg(metaUrl);
|
QString cmd = QString("curl -I -s --connect-timeout 5 %1 -w %{http_code} |tail -n1 > /tmp/spark-store/metaStatus.txt").arg(metaUrl);
|
||||||
system(cmd.toUtf8().data());
|
[[maybe_unused]] int ret = system(cmd.toUtf8().data());//不这样写就会-Wunused-variable 警告导致无法打包
|
||||||
if (metaStatus.open(QFile::ReadOnly) && QString(metaStatus.readAll()).toUtf8() == "200")
|
if (metaStatus.open(QFile::ReadOnly) && QString(metaStatus.readAll()).toUtf8() == "200")
|
||||||
{
|
{
|
||||||
metaStatus.remove();
|
metaStatus.remove();
|
||||||
@@ -94,7 +94,7 @@ void DownloadController::startDownload(const QString &url)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QtConcurrent::run([=]()
|
auto future = QtConcurrent::run([=]()
|
||||||
{
|
{
|
||||||
QString metaUrl = url + ".metalink";
|
QString metaUrl = url + ".metalink";
|
||||||
qDebug() << "metalink" << metaUrl;
|
qDebug() << "metalink" << metaUrl;
|
||||||
@@ -272,7 +272,7 @@ void DownloadController::stopDownload()
|
|||||||
|
|
||||||
// 实现下载进程退出
|
// 实现下载进程退出
|
||||||
QString killCmd = QString("kill -9 %1").arg(pidNumber);
|
QString killCmd = QString("kill -9 %1").arg(pidNumber);
|
||||||
system(killCmd.toUtf8());
|
[[maybe_unused]] int ret = system(killCmd.toUtf8());
|
||||||
qDebug() << "kill aria2!";
|
qDebug() << "kill aria2!";
|
||||||
pidNumber = -1;
|
pidNumber = -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ void SparkAPI::get(QUrl url)
|
|||||||
QNetworkRequest request;
|
QNetworkRequest request;
|
||||||
HttpRequest *httprequest = new HttpRequest;
|
HttpRequest *httprequest = new HttpRequest;
|
||||||
request.setUrl(QUrl(url.toString().replace("+", "%2B")));
|
request.setUrl(QUrl(url.toString().replace("+", "%2B")));
|
||||||
request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
|
||||||
connect(httprequest, &HttpRequest::finished, [=](QString data)
|
connect(httprequest, &HttpRequest::finished, [=](QString data)
|
||||||
{
|
{
|
||||||
QByteArray arr = data.toUtf8();
|
QByteArray arr = data.toUtf8();
|
||||||
@@ -54,7 +53,6 @@ void SparkAPI::getRAW(QUrl url)
|
|||||||
QNetworkRequest request;
|
QNetworkRequest request;
|
||||||
HttpRequest *httprequest = new HttpRequest;
|
HttpRequest *httprequest = new HttpRequest;
|
||||||
request.setUrl(QUrl(url.toString().replace("+", "%2B")));
|
request.setUrl(QUrl(url.toString().replace("+", "%2B")));
|
||||||
request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
|
||||||
connect(httprequest, &HttpRequest::finished, [=](QString data)
|
connect(httprequest, &HttpRequest::finished, [=](QString data)
|
||||||
{
|
{
|
||||||
emit finishedRAW(data);
|
emit finishedRAW(data);
|
||||||
|
|||||||
42
src/main.cpp
@@ -12,7 +12,6 @@
|
|||||||
#include <execinfo.h>
|
#include <execinfo.h>
|
||||||
|
|
||||||
#include <DSysInfo>
|
#include <DSysInfo>
|
||||||
#include <DApplicationSettings>
|
|
||||||
|
|
||||||
#include <QDate>
|
#include <QDate>
|
||||||
#include <QProcessEnvironment>
|
#include <QProcessEnvironment>
|
||||||
@@ -109,17 +108,18 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
// 崩溃处理
|
// 崩溃处理
|
||||||
signal(SIGSEGV, crashHandler); // 注册SIGSEGV处理函数
|
signal(SIGSEGV, crashHandler); // 注册SIGSEGV处理函数
|
||||||
|
|
||||||
|
// 初始化日志系统
|
||||||
|
Utils::initLogger();
|
||||||
|
Utils::writeLog("INFO", "Application starting...");
|
||||||
|
|
||||||
|
// // Get build time
|
||||||
// Get build time
|
// static const QDate buildDate = QLocale(QLocale::English).toDate(QString(__DATE__).replace(" ", " 0"), "MMM dd yyyy");
|
||||||
static const QDate buildDate = QLocale(QLocale::English).toDate(QString(__DATE__).replace(" ", " 0"), "MMM dd yyyy");
|
// static const QTime buildTime = QTime::fromString(__TIME__, "hh:mm:ss");
|
||||||
static const QTime buildTime = QTime::fromString(__TIME__, "hh:mm:ss");
|
// buildDateTime = buildDate.toString("yyyy.MM.dd") + "-" + buildTime.toString("hh:mm:ss");
|
||||||
buildDateTime = buildDate.toString("yyyy.MM.dd") + "-" + buildTime.toString("hh:mm:ss");
|
|
||||||
|
//在cmakelist.txt中设置 buildDateTime
|
||||||
|
QString buildDateTime = QString("%1-%2").arg(QString(BUILD_DATE)).arg(QString(BUILD_TIME));
|
||||||
// NOTE: 提前设置组织名称和应用名称,避免配置文件位置错误
|
|
||||||
DApplication::setOrganizationName("spark-union");
|
|
||||||
DApplication::setApplicationName("spark-store");
|
|
||||||
Application::checkAppConfigLocation(); // 检查 ~/.config/spark-union/spark-store 文件夹是否存在
|
Application::checkAppConfigLocation(); // 检查 ~/.config/spark-union/spark-store 文件夹是否存在
|
||||||
|
|
||||||
// 初始化 config.ini 配置文件
|
// 初始化 config.ini 配置文件
|
||||||
@@ -129,9 +129,11 @@ int main(int argc, char *argv[])
|
|||||||
DataCollectorAndUploader uploader;
|
DataCollectorAndUploader uploader;
|
||||||
QObject::connect(&uploader, &DataCollectorAndUploader::uploadSuccessful, [](){
|
QObject::connect(&uploader, &DataCollectorAndUploader::uploadSuccessful, [](){
|
||||||
qDebug() << "Data uploaded successfully";
|
qDebug() << "Data uploaded successfully";
|
||||||
|
Utils::writeLog("INFO", "Data uploaded successfully");
|
||||||
});
|
});
|
||||||
QObject::connect(&uploader, &DataCollectorAndUploader::uploadFailed, [](QString error){
|
QObject::connect(&uploader, &DataCollectorAndUploader::uploadFailed, [](QString error){
|
||||||
qDebug() << "Upload failed with error: " << error;
|
qDebug() << "Upload failed with error: " << error;
|
||||||
|
Utils::writeLog("ERROR", QString("Upload failed with error: %1").arg(error));
|
||||||
});
|
});
|
||||||
|
|
||||||
uploader.collectAndUploadData();
|
uploader.collectAndUploadData();
|
||||||
@@ -152,6 +154,10 @@ int main(int argc, char *argv[])
|
|||||||
#if defined __sw_64__ || __loongarch__
|
#if defined __sw_64__ || __loongarch__
|
||||||
chromium_flags.append("--no-sandbox");
|
chromium_flags.append("--no-sandbox");
|
||||||
#endif
|
#endif
|
||||||
|
// 如果配置文件中设置了关闭沙箱,则添加no-sandbox标志
|
||||||
|
if (Utils::shouldDisableWebEngineSandbox()) {
|
||||||
|
chromium_flags.append("--no-sandbox");
|
||||||
|
}
|
||||||
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", chromium_flags.join(" ").toUtf8());
|
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", chromium_flags.join(" ").toUtf8());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -163,13 +169,6 @@ int main(int argc, char *argv[])
|
|||||||
DApplication::setAttribute(Qt::AA_UseSoftwareOpenGL);
|
DApplication::setAttribute(Qt::AA_UseSoftwareOpenGL);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
|
|
||||||
// 开启 Hidpi 支持
|
|
||||||
qDebug() << "Enable HiDPI Support.";
|
|
||||||
DApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
|
||||||
DApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// 强制使用 DTK 平台插件
|
// 强制使用 DTK 平台插件
|
||||||
QVector<char *> fakeArgs(argc + 2);
|
QVector<char *> fakeArgs(argc + 2);
|
||||||
fakeArgs[0] = argv[0];
|
fakeArgs[0] = argv[0];
|
||||||
@@ -191,8 +190,6 @@ int main(int argc, char *argv[])
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
DApplicationSettings settings; // 定义 DApplicationSettings,自动保存主题设置
|
|
||||||
|
|
||||||
MainWindow w;
|
MainWindow w;
|
||||||
a.setMainWindow(&w); // 设置应用程序主窗口,用于初始化关于对话框
|
a.setMainWindow(&w); // 设置应用程序主窗口,用于初始化关于对话框
|
||||||
|
|
||||||
@@ -206,5 +203,10 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
w.show();
|
w.show();
|
||||||
|
|
||||||
|
// 在程序结束前关闭日志文件 - 修复变量名并移到return前
|
||||||
|
QObject::connect(&a, &QApplication::aboutToQuit, []() {
|
||||||
|
Utils::writeLog("INFO", "Application shutting down");
|
||||||
|
});
|
||||||
|
|
||||||
return a.exec();
|
return a.exec();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,9 @@
|
|||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QAbstractButton>
|
#include <QAbstractButton>
|
||||||
#include <QtConcurrent>
|
#include <QtConcurrent>
|
||||||
|
#include <qlogging.h>
|
||||||
|
#include <qprocess.h>
|
||||||
|
#include <system_error>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <backend/ThemeChecker.h>
|
#include <backend/ThemeChecker.h>
|
||||||
@@ -345,7 +348,7 @@ void MainWindow::refreshTheme(bool isDarkMode)
|
|||||||
ui->applistpage->setTheme(isDarkMode);
|
ui->applistpage->setTheme(isDarkMode);
|
||||||
ui->applistpage_1->setTheme(isDarkMode);
|
ui->applistpage_1->setTheme(isDarkMode);
|
||||||
ui->appintopage->setTheme(isDarkMode);
|
ui->appintopage->setTheme(isDarkMode);
|
||||||
ui->settingspage->setTheme(isDarkMode);
|
ui->settingspage->setTheme(isDarkMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::initConnections()
|
void MainWindow::initConnections()
|
||||||
@@ -434,7 +437,7 @@ void MainWindow::initTmpDir()
|
|||||||
|
|
||||||
if (info.isWritable() == false)
|
if (info.isWritable() == false)
|
||||||
{
|
{
|
||||||
QtConcurrent::run([=]
|
auto future = QtConcurrent::run([=]
|
||||||
{
|
{
|
||||||
sleep(3);
|
sleep(3);
|
||||||
auto upgradeP = new QProcess();
|
auto upgradeP = new QProcess();
|
||||||
@@ -522,72 +525,36 @@ void MainWindow::notify(QObject *receiver, QEvent *event)
|
|||||||
|
|
||||||
void MainWindow::on_pushButton_14_clicked()
|
void MainWindow::on_pushButton_14_clicked()
|
||||||
{
|
{
|
||||||
/**
|
QString appPath;
|
||||||
* NOTE: No need to judget developmode status
|
// #ifdef QT_DEBUG
|
||||||
*/
|
// appPath = QCoreApplication::applicationDirPath() ;
|
||||||
// Check UOS
|
// QDir dir(appPath);
|
||||||
// QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat);
|
// dir.cdUp();
|
||||||
// if (config.contains("UOS/EnableDeveloperMode") && !config.value("UOS/EnableDeveloperMode").toBool())
|
// appPath = dir.absolutePath()+"/spark-update-tool/spark-update-tool";
|
||||||
if (false)
|
// qDebug() << "Spark Update Tool Path: " << appPath;
|
||||||
{
|
// if(appPath.isEmpty())
|
||||||
qDebug() << "UOS Developer Mode has not been enabled!";
|
// {
|
||||||
QtConcurrent::run([=]
|
// qWarning() << "Spark Update Tool not found!";
|
||||||
{
|
// return;
|
||||||
auto upgradeP = new QProcess();
|
// }
|
||||||
upgradeP->startDetached("zenity", QStringList() << "--info"
|
// QProcess *process = new QProcess(this);
|
||||||
<< "--text"
|
// QStringList arguments;
|
||||||
<< "UOS开发者模式未开启,相关功能被禁用"
|
// arguments << appPath <<"--silent";
|
||||||
<< "--title"
|
// process->start(appPath, {"--silent"});
|
||||||
<< "功能禁用提示"
|
// #else
|
||||||
<< "--width"
|
// appPath = QStandardPaths::findExecutable("spark-update-tool");
|
||||||
<< "360"
|
// QString program = "pkexec";
|
||||||
);
|
// QStringList arguments;
|
||||||
upgradeP->waitForStarted();
|
// arguments << appPath;
|
||||||
upgradeP->waitForFinished(30);
|
// QProcess *process = new QProcess(this);
|
||||||
upgradeP->deleteLater(); });
|
// process->start(program, arguments);
|
||||||
}
|
// #endif
|
||||||
else
|
appPath = QStandardPaths::findExecutable("spark-update-tool");
|
||||||
{
|
qDebug() << "Spark Update Tool Path: " << appPath;
|
||||||
QFile upgradeStatus("/tmp/spark-store/upgradeStatus.txt");
|
QString program = "pkexec";
|
||||||
if (!upgradeStatus.exists())
|
QStringList arguments;
|
||||||
{
|
arguments << appPath;
|
||||||
QString appPath;
|
QProcess *process = new QProcess(this);
|
||||||
|
process->start(program, arguments);
|
||||||
|
|
||||||
// 判断路径:开发环境 vs 安装后
|
}
|
||||||
#ifdef QT_DEBUG
|
|
||||||
appPath = QCoreApplication::applicationDirPath() +
|
|
||||||
"/spark-update-tool/spark-update-tool";
|
|
||||||
#else
|
|
||||||
appPath = QStandardPaths::findExecutable("spark-update-tool");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (appPath.isEmpty()) {
|
|
||||||
qWarning() << "spark-update-tool not found!";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QProcess *process = new QProcess(this);
|
|
||||||
|
|
||||||
#ifdef QT_DEBUG
|
|
||||||
// 开发模式:直接运行本地构建的更新器
|
|
||||||
process->start(appPath, {"--silent"});
|
|
||||||
#else
|
|
||||||
// 安装模式:使用 pkexec 提权运行系统路径下的 spark-update-tool
|
|
||||||
QString program = "pkexec";
|
|
||||||
QStringList arguments;
|
|
||||||
arguments << appPath << "--silent";
|
|
||||||
process->start(program, arguments);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QObject::connect(process, QOverload<int>::of(&QProcess::finished),
|
|
||||||
[process](int exitCode) {
|
|
||||||
if (exitCode == 0) {
|
|
||||||
qDebug() << "Update check successful";
|
|
||||||
} else {
|
|
||||||
qWarning() << "Update check failed with exit code:" << exitCode;
|
|
||||||
}
|
|
||||||
process->deleteLater();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -73,7 +73,7 @@ void AppIntoPage::openUrl(const QUrl &url)
|
|||||||
iconRequest.setUrl(QUrl(pkgUrlBase + "/icon.png"));
|
iconRequest.setUrl(QUrl(pkgUrlBase + "/icon.png"));
|
||||||
iconRequest.setHeader(QNetworkRequest::UserAgentHeader, m_userAgent);
|
iconRequest.setHeader(QNetworkRequest::UserAgentHeader, m_userAgent);
|
||||||
iconRequest.setHeader(QNetworkRequest::ContentTypeHeader, "charset='utf-8'");
|
iconRequest.setHeader(QNetworkRequest::ContentTypeHeader, "charset='utf-8'");
|
||||||
iconRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
|
||||||
|
|
||||||
iconManager->get(iconRequest);
|
iconManager->get(iconRequest);
|
||||||
QObject::connect(iconManager, &QNetworkAccessManager::finished, [=](QNetworkReply *reply)
|
QObject::connect(iconManager, &QNetworkAccessManager::finished, [=](QNetworkReply *reply)
|
||||||
@@ -97,7 +97,6 @@ void AppIntoPage::openUrl(const QUrl &url)
|
|||||||
request.setUrl(QUrl(imgUrl));
|
request.setUrl(QUrl(imgUrl));
|
||||||
request.setHeader(QNetworkRequest::UserAgentHeader, m_userAgent);
|
request.setHeader(QNetworkRequest::UserAgentHeader, m_userAgent);
|
||||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "charset='utf-8'");
|
request.setHeader(QNetworkRequest::ContentTypeHeader, "charset='utf-8'");
|
||||||
request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
|
||||||
manager->get(request);
|
manager->get(request);
|
||||||
QObject::connect(manager, &QNetworkAccessManager::finished, [=](QNetworkReply *reply)
|
QObject::connect(manager, &QNetworkAccessManager::finished, [=](QNetworkReply *reply)
|
||||||
{
|
{
|
||||||
@@ -617,7 +616,7 @@ void AppIntoPage::on_downloadButton_clicked()
|
|||||||
|
|
||||||
void AppIntoPage::on_pushButton_3_clicked()
|
void AppIntoPage::on_pushButton_3_clicked()
|
||||||
{
|
{
|
||||||
QtConcurrent::run([=]()
|
auto future = QtConcurrent::run([=]()
|
||||||
{
|
{
|
||||||
ui->downloadButton->setEnabled(false);
|
ui->downloadButton->setEnabled(false);
|
||||||
ui->pushButton_3->setEnabled(false);
|
ui->pushButton_3->setEnabled(false);
|
||||||
@@ -659,3 +658,4 @@ void AppIntoPage::on_updateButton_clicked()
|
|||||||
QString feedbackURL = "https://bbs.spark-app.store/";
|
QString feedbackURL = "https://bbs.spark-app.store/";
|
||||||
QProcess::startDetached("xdg-open", QStringList{feedbackURL});
|
QProcess::startDetached("xdg-open", QStringList{feedbackURL});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QtConcurrent>
|
#include <QtConcurrent>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
#define TMP_PATH "/tmp/spark-store"
|
#define TMP_PATH "/tmp/spark-store"
|
||||||
#define DEFAULT_SERVER_URL "https://cdn-d.spark-app.store/"
|
#define DEFAULT_SERVER_URL "https://cdn-d.spark-app.store/"
|
||||||
@@ -22,6 +23,9 @@ SettingsPage::SettingsPage(QWidget *parent)
|
|||||||
|
|
||||||
configCanSave = false;
|
configCanSave = false;
|
||||||
initConfig();
|
initConfig();
|
||||||
|
|
||||||
|
// 移除了手动连接导出日志按钮的点击信号
|
||||||
|
// connect(ui->pushButton_exportLog, &QPushButton::clicked, this, &SettingsPage::on_pushButton_exportLog_clicked);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsPage::setTheme(bool dark)
|
void SettingsPage::setTheme(bool dark)
|
||||||
@@ -32,7 +36,7 @@ void SettingsPage::setTheme(bool dark)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// 亮色模式
|
// <EFBFBD><EFBFBD><EFBFBD>色模式
|
||||||
this->setStyleSheet("#frame{background-color: #ffffff;border-radius:14px;border:1px solid rgb(229,229,229);}");
|
this->setStyleSheet("#frame{background-color: #ffffff;border-radius:14px;border:1px solid rgb(229,229,229);}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -98,8 +102,14 @@ void SettingsPage::initConfig()
|
|||||||
}
|
}
|
||||||
configCanSave = true; // 防止触发保存配置信号
|
configCanSave = true; // 防止触发保存配置信号
|
||||||
|
|
||||||
|
// 在现有代码后添加初始化checkBox_disableSandbox的状态
|
||||||
needUncompatibleNotification = config.value("other/uncompatibleNotification", needUncompatibleNotification).toBool();
|
needUncompatibleNotification = config.value("other/uncompatibleNotification", needUncompatibleNotification).toBool();
|
||||||
ui->checkBox->setChecked(needUncompatibleNotification);
|
ui->checkBox->setChecked(needUncompatibleNotification);
|
||||||
|
|
||||||
|
// 新增:从config.ini读取webengine/noSandbox配置并设置复选框状态
|
||||||
|
bool disableSandbox = config.value("webengine/noSandbox", false).toBool();
|
||||||
|
ui->checkBox_disableSandbox->setChecked(disableSandbox);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsPage::~SettingsPage()
|
SettingsPage::~SettingsPage()
|
||||||
@@ -109,7 +119,7 @@ SettingsPage::~SettingsPage()
|
|||||||
|
|
||||||
void SettingsPage::on_pushButton_updateServer_clicked()
|
void SettingsPage::on_pushButton_updateServer_clicked()
|
||||||
{
|
{
|
||||||
QtConcurrent::run([=]()
|
auto future = QtConcurrent::run([=]()
|
||||||
{
|
{
|
||||||
ui->pushButton_updateServer->setEnabled(false);
|
ui->pushButton_updateServer->setEnabled(false);
|
||||||
|
|
||||||
@@ -134,7 +144,7 @@ void SettingsPage::on_pushButton_updateServer_clicked()
|
|||||||
ui->comboBox_server->setCurrentIndex(0); });
|
ui->comboBox_server->setCurrentIndex(0); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsPage::on_comboBox_server_currentIndexChanged(const QString &arg1)
|
void SettingsPage::on_comboBox_server_currentTextChanged(const QString &arg1)
|
||||||
{
|
{
|
||||||
SparkAPI::setServerUrl(arg1); // 服务器信息更新
|
SparkAPI::setServerUrl(arg1); // 服务器信息更新
|
||||||
qDebug() << arg1;
|
qDebug() << arg1;
|
||||||
@@ -208,7 +218,7 @@ quint64 SettingsPage::dirFileSize(const QString &path)
|
|||||||
|
|
||||||
void SettingsPage::on_pushButton_updateApt_clicked()
|
void SettingsPage::on_pushButton_updateApt_clicked()
|
||||||
{
|
{
|
||||||
QtConcurrent::run([=]()
|
auto future = QtConcurrent::run([=]()
|
||||||
{
|
{
|
||||||
ui->pushButton_updateApt->setEnabled(false);
|
ui->pushButton_updateApt->setEnabled(false);
|
||||||
ui->label_aptserver->setText(tr("Updating, please wait..."));
|
ui->label_aptserver->setText(tr("Updating, please wait..."));
|
||||||
@@ -222,7 +232,7 @@ void SettingsPage::on_pushButton_updateApt_clicked()
|
|||||||
|
|
||||||
void SettingsPage::on_pushButton_clear_clicked()
|
void SettingsPage::on_pushButton_clear_clicked()
|
||||||
{
|
{
|
||||||
QtConcurrent::run([=]()
|
auto future = QtConcurrent::run([=]()
|
||||||
{
|
{
|
||||||
ui->pushButton_clear->setEnabled(false);
|
ui->pushButton_clear->setEnabled(false);
|
||||||
|
|
||||||
@@ -240,7 +250,7 @@ void SettingsPage::on_pushButton_clear_clicked()
|
|||||||
|
|
||||||
void SettingsPage::on_pushButton_clearWebCache_clicked()
|
void SettingsPage::on_pushButton_clearWebCache_clicked()
|
||||||
{
|
{
|
||||||
QtConcurrent::run([=]()
|
auto future = QtConcurrent::run([=]()
|
||||||
{
|
{
|
||||||
QString localDataLocation = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + "/QtWebEngine";
|
QString localDataLocation = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + "/QtWebEngine";
|
||||||
qDebug() << localDataLocation;
|
qDebug() << localDataLocation;
|
||||||
@@ -261,3 +271,37 @@ void SettingsPage::on_checkBox_clicked(bool checked)
|
|||||||
config.setValue("other/uncompatibleNotification", needUncompatibleNotification);
|
config.setValue("other/uncompatibleNotification", needUncompatibleNotification);
|
||||||
config.sync();
|
config.sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 添加checkBox_disableSandbox的点击事件处理函数
|
||||||
|
void SettingsPage::on_checkBox_disableSandbox_clicked(bool checked)
|
||||||
|
{
|
||||||
|
QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat);
|
||||||
|
config.setValue("webengine/noSandbox", checked);
|
||||||
|
config.sync();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改导出日志按钮的点击事件处理函数
|
||||||
|
void SettingsPage::on_pushButton_exportLog_clicked()
|
||||||
|
{
|
||||||
|
// 禁用按钮防止重复点击
|
||||||
|
ui->pushButton_exportLog->setEnabled(false);
|
||||||
|
|
||||||
|
QString targetPath = QString::fromUtf8(TMP_PATH);
|
||||||
|
bool success = Utils::exportLogs(targetPath);
|
||||||
|
|
||||||
|
// 显示导出结果通知
|
||||||
|
QString message;
|
||||||
|
if (success) {
|
||||||
|
message = tr("Logs exported successfully to: %1").arg(targetPath);
|
||||||
|
Utils::writeLog("INFO", "User exported logs via settings page");
|
||||||
|
} else {
|
||||||
|
message = tr("Failed to export logs");
|
||||||
|
Utils::writeLog("ERROR", "User failed to export logs via settings page");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 只发送一次系统通知
|
||||||
|
Utils::sendNotification("spark-store", tr("Export Logs"), message);
|
||||||
|
|
||||||
|
// 重新启用按钮
|
||||||
|
ui->pushButton_exportLog->setEnabled(true);
|
||||||
|
}
|
||||||
@@ -22,7 +22,7 @@ public:
|
|||||||
private slots:
|
private slots:
|
||||||
void on_pushButton_updateServer_clicked();
|
void on_pushButton_updateServer_clicked();
|
||||||
|
|
||||||
void on_comboBox_server_currentIndexChanged(const QString &arg1);
|
void on_comboBox_server_currentTextChanged(const QString &arg1);
|
||||||
|
|
||||||
void on_pushButton_updateApt_clicked();
|
void on_pushButton_updateApt_clicked();
|
||||||
|
|
||||||
@@ -32,6 +32,11 @@ private slots:
|
|||||||
|
|
||||||
void on_checkBox_clicked(bool checked);
|
void on_checkBox_clicked(bool checked);
|
||||||
|
|
||||||
|
void on_checkBox_disableSandbox_clicked(bool checked);
|
||||||
|
|
||||||
|
// 添加导出日志按钮的槽函数声明
|
||||||
|
void on_pushButton_exportLog_clicked();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static bool needUncompatibleNotification;
|
static bool needUncompatibleNotification;
|
||||||
|
|
||||||
@@ -47,4 +52,4 @@ signals:
|
|||||||
void openUrl(QUrl spk);
|
void openUrl(QUrl spk);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SETTINGSPAGE_H
|
#endif // SETTINGSPAGE_H
|
||||||
@@ -32,10 +32,10 @@
|
|||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QFrame" name="frame">
|
<widget class="QFrame" name="frame">
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::StyledPanel</enum>
|
<enum>QFrame::Shape::StyledPanel</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShadow">
|
<property name="frameShadow">
|
||||||
<enum>QFrame::Raised</enum>
|
<enum>QFrame::Shadow::Raised</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
<string notr="true"/>
|
<string notr="true"/>
|
||||||
</property>
|
</property>
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::NoFrame</enum>
|
<enum>QFrame::Shape::NoFrame</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="lineWidth">
|
<property name="lineWidth">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
@@ -71,9 +71,9 @@
|
|||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>-434</y>
|
||||||
<width>688</width>
|
<width>666</width>
|
||||||
<height>940</height>
|
<height>1270</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_23">
|
<layout class="QVBoxLayout" name="verticalLayout_23">
|
||||||
@@ -147,7 +147,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer">
|
<spacer name="horizontalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
@@ -166,7 +166,7 @@
|
|||||||
<item row="0" column="3">
|
<item row="0" column="3">
|
||||||
<spacer name="horizontalSpacer_2">
|
<spacer name="horizontalSpacer_2">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
@@ -295,7 +295,7 @@
|
|||||||
<item row="0" column="4">
|
<item row="0" column="4">
|
||||||
<spacer name="horizontalSpacer_3">
|
<spacer name="horizontalSpacer_3">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
@@ -338,6 +338,109 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="widget_9" native="true">
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label_12">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>18</pointsize>
|
||||||
|
<bold>false</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Log</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QWidget" name="widget_10" native="true">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_13">
|
||||||
|
<property name="text">
|
||||||
|
<string>Export Logs:/tmp/spark-store</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="pushButton_exportLog">
|
||||||
|
<property name="text">
|
||||||
|
<string>Export</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_4">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>351</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="widget_11" native="true">
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_14">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>18</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Disable Safe Mode</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="widget_12" native="true">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_15">
|
||||||
|
<property name="text">
|
||||||
|
<string>Disable the webEngine sandbox feature.</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBox_disableSandbox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Disable</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_5">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>424</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QWidget" name="widget_6" native="true">
|
<widget class="QWidget" name="widget_6" native="true">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_25">
|
<layout class="QVBoxLayout" name="verticalLayout_25">
|
||||||
@@ -372,7 +475,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Orientation::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ VERSION = $$BUILD_VERSION
|
|||||||
isEmpty(VERSION): VERSION = 4.0.0
|
isEmpty(VERSION): VERSION = 4.0.0
|
||||||
DEFINES += APP_VERSION=\\\"'$${VERSION}'\\\"
|
DEFINES += APP_VERSION=\\\"'$${VERSION}'\\\"
|
||||||
DEFINES += APP_BRANCH=\\\"'$$system(git symbolic-ref --short -q HEAD)'\\\"
|
DEFINES += APP_BRANCH=\\\"'$$system(git symbolic-ref --short -q HEAD)'\\\"
|
||||||
# Disable qWarning / qDebug output in Release
|
# Enable all log outputs in both Debug and Release modes
|
||||||
#CONFIG(release, debug | release): DEFINES += QT_NO_WARNING_OUTPUT QT_NO_DEBUG_OUTPUT
|
# We want to capture all logs (INFO, DEBUG, WARNING, ERROR) for export to /tmp/spark-store
|
||||||
|
|
||||||
CONFIG += c++11 link_pkgconfig
|
CONFIG += c++11 link_pkgconfig
|
||||||
PKGCONFIG += dtkcore dtkgui dtkwidget
|
PKGCONFIG += dtkcore dtkgui dtkwidget
|
||||||
@@ -47,7 +47,6 @@ SOURCES += \
|
|||||||
utils/utils.cpp \
|
utils/utils.cpp \
|
||||||
utils/widgetanimation.cpp \
|
utils/widgetanimation.cpp \
|
||||||
widgets/base/basewidgetopacity.cpp \
|
widgets/base/basewidgetopacity.cpp \
|
||||||
widgets/common/customlabel.cpp \
|
|
||||||
widgets/common/downloaditem.cpp \
|
widgets/common/downloaditem.cpp \
|
||||||
widgets/common/progressbutton.cpp \
|
widgets/common/progressbutton.cpp \
|
||||||
widgets/common/smoothlistwidget.cpp \
|
widgets/common/smoothlistwidget.cpp \
|
||||||
@@ -74,7 +73,6 @@ HEADERS += \
|
|||||||
utils/utils.h \
|
utils/utils.h \
|
||||||
utils/widgetanimation.h \
|
utils/widgetanimation.h \
|
||||||
widgets/base/basewidgetopacity.h \
|
widgets/base/basewidgetopacity.h \
|
||||||
widgets/common/customlabel.h \
|
|
||||||
widgets/common/downloaditem.h \
|
widgets/common/downloaditem.h \
|
||||||
widgets/common/progressbutton.h \
|
widgets/common/progressbutton.h \
|
||||||
widgets/common/smoothlistwidget.h \
|
widgets/common/smoothlistwidget.h \
|
||||||
@@ -109,4 +107,4 @@ qnx: target.path = /tmp/$${TARGET}/bin
|
|||||||
else: unix:!android: target.path = /opt/durapps/$${TARGET}/bin
|
else: unix:!android: target.path = /opt/durapps/$${TARGET}/bin
|
||||||
!isEmpty(target.path): INSTALLS += target
|
!isEmpty(target.path): INSTALLS += target
|
||||||
|
|
||||||
DISTFILES +=
|
DISTFILES +=
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
|
||||||
|
|
||||||
project(spark-update-tool VERSION 0.1 LANGUAGES CXX)
|
|
||||||
|
|
||||||
set(CMAKE_AUTOUIC ON)
|
|
||||||
set(CMAKE_AUTOMOC ON)
|
|
||||||
set(CMAKE_AUTORCC ON)
|
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
||||||
|
|
||||||
|
|
||||||
find_package(Qt5 REQUIRED COMPONENTS Widgets Network Concurrent)
|
|
||||||
|
|
||||||
|
|
||||||
find_package(Qt5 REQUIRED COMPONENTS Widgets Network Concurrent Core Gui)
|
|
||||||
|
|
||||||
# 定义所有项目源文件,现在无需条件判断
|
|
||||||
set(PROJECT_SOURCES
|
|
||||||
src/main.cpp
|
|
||||||
src/mainwindow.cpp
|
|
||||||
src/mainwindow.h
|
|
||||||
src/mainwindow.ui
|
|
||||||
src/aptssupdater.h src/aptssupdater.cpp
|
|
||||||
src/icons.qrc
|
|
||||||
src/appdelegate.h src/appdelegate.cpp
|
|
||||||
src/applistmodel.h src/applistmodel.cpp
|
|
||||||
src/downloadmanager.h src/downloadmanager.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
add_executable(spark-update-tool
|
|
||||||
${PROJECT_SOURCES}
|
|
||||||
)
|
|
||||||
|
|
||||||
target_link_libraries(spark-update-tool PRIVATE
|
|
||||||
Qt5::Widgets
|
|
||||||
Qt5::Network
|
|
||||||
Qt5::Concurrent
|
|
||||||
Qt5::Core
|
|
||||||
Qt5::Gui
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
set_target_properties(spark-update-tool PROPERTIES
|
|
||||||
# ${BUNDLE_ID_OPTION} # 如果上面取消注释,这里也取消注释
|
|
||||||
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
|
|
||||||
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
|
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
|
||||||
install(TARGETS spark-update-tool
|
|
||||||
BUNDLE DESTINATION .
|
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
### Spark Software Updater
|
|
||||||
|
|
||||||
#### Introduction
|
|
||||||
|
|
||||||
Welcome to Spark Software Updater! This tool helps you conveniently update various applications on your Linux system.
|
|
||||||
|
|
||||||
This version is specifically designed for Linux distributions with Qt5 support.
|
|
||||||
**Please run with root privileges (recommended to use `sudo`).**
|
|
||||||
|
|
||||||
#### Currently Supported Linux Distributions
|
|
||||||
|
|
||||||
- [x] GXDE OS
|
|
||||||
- [x] Ubuntu
|
|
||||||
- [x] deepin
|
|
||||||
- [ ] Kylin
|
|
||||||
|
|
||||||
// ... existing Chinese feature table ...
|
|
||||||
|
|
||||||
#### Contact & Feedback
|
|
||||||
|
|
||||||
For any issues or suggestions, please contact: momen@momen.world
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
spark-update-tool (1.0.0) unstable; urgency=low
|
|
||||||
|
|
||||||
* Initial release.
|
|
||||||
|
|
||||||
-- momen <vmomenv@gmail.com> Wed, 18 Jun 2025 00:00:00 +0000
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
9
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#!/usr/bin/make -f
|
|
||||||
|
|
||||||
%:
|
|
||||||
dh $@
|
|
||||||
|
|
||||||
override_dh_auto_configure:
|
|
||||||
dh_auto_configure -- -DCMAKE_INSTALL_PREFIX=/usr
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
# spark-update-tool.pro
|
|
||||||
QT += core gui widgets network concurrent
|
|
||||||
TARGET = spark-update-tool
|
|
||||||
TEMPLATE = app
|
|
||||||
|
|
||||||
# Set C++ standard to C++17
|
|
||||||
CONFIG += c++17
|
|
||||||
|
|
||||||
# Enable auto features (uic, moc, rcc)
|
|
||||||
CONFIG += qt warn_on release
|
|
||||||
QT_CONFIG += no-pkg-config
|
|
||||||
|
|
||||||
# Version info (replace with your actual version)
|
|
||||||
VERSION = 0.1.0
|
|
||||||
DEFINES += APP_VERSION=\\\"$$VERSION\\\"
|
|
||||||
|
|
||||||
# Source files
|
|
||||||
SOURCES += \
|
|
||||||
src/main.cpp \
|
|
||||||
src/mainwindow.cpp \
|
|
||||||
src/aptssupdater.cpp \
|
|
||||||
src/appdelegate.cpp \
|
|
||||||
src/applistmodel.cpp \
|
|
||||||
src/downloadmanager.cpp
|
|
||||||
|
|
||||||
HEADERS += \
|
|
||||||
src/mainwindow.h \
|
|
||||||
src/aptssupdater.h \
|
|
||||||
src/appdelegate.h \
|
|
||||||
src/applistmodel.h \
|
|
||||||
src/downloadmanager.h
|
|
||||||
|
|
||||||
FORMS += \
|
|
||||||
src/mainwindow.ui
|
|
||||||
|
|
||||||
RESOURCES += \
|
|
||||||
src/icons.qrc
|
|
||||||
|
|
||||||
# macOS bundle properties (optional)
|
|
||||||
macx {
|
|
||||||
QMAKE_INFO_PLIST = Info.plist
|
|
||||||
ICON = resources/spark-update-tool.icns
|
|
||||||
BUNDLE_IDENTIFIER = org.spark.store.update-tool
|
|
||||||
}
|
|
||||||
|
|
||||||
# Installation paths (matches CMake install)
|
|
||||||
target.path = $$[QT_INSTALL_BINS]
|
|
||||||
INSTALLS += target
|
|
||||||
@@ -1,322 +0,0 @@
|
|||||||
#include "appdelegate.h"
|
|
||||||
#include <QIcon>
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QApplication>
|
|
||||||
#include <QDir>
|
|
||||||
#include <QProgressBar>
|
|
||||||
#include <QPushButton>
|
|
||||||
#include <QPainter>
|
|
||||||
#include <QMouseEvent>
|
|
||||||
|
|
||||||
AppDelegate::AppDelegate(QObject *parent)
|
|
||||||
: QStyledItemDelegate(parent), m_downloadManager(new DownloadManager(this)), m_installProcess(nullptr) {
|
|
||||||
connect(m_downloadManager, &DownloadManager::downloadFinished, this,
|
|
||||||
[this](const QString &packageName, bool success) {
|
|
||||||
if (m_downloads.contains(packageName)) {
|
|
||||||
m_downloads[packageName].isDownloading = false;
|
|
||||||
emit updateDisplay(packageName);
|
|
||||||
qDebug() << (success ? "下载完成:" : "下载失败:") << packageName;
|
|
||||||
if (success) {
|
|
||||||
enqueueInstall(packageName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
connect(m_downloadManager, &DownloadManager::downloadProgress, this,
|
|
||||||
[this](const QString &packageName, int progress) {
|
|
||||||
if (m_downloads.contains(packageName)) {
|
|
||||||
m_downloads[packageName].progress = progress;
|
|
||||||
qDebug()<<progress;
|
|
||||||
emit updateDisplay(packageName); // 实时刷新进度条
|
|
||||||
}
|
|
||||||
});
|
|
||||||
m_spinnerTimer.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
void AppDelegate::setModel(QAbstractItemModel *model) {
|
|
||||||
m_model = model;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AppDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const {
|
|
||||||
painter->save();
|
|
||||||
|
|
||||||
if (option.state & QStyle::State_Selected)
|
|
||||||
painter->fillRect(option.rect, option.palette.highlight());
|
|
||||||
else
|
|
||||||
painter->fillRect(option.rect, QColor("#F3F4F6"));
|
|
||||||
|
|
||||||
QFont boldFont = option.font;
|
|
||||||
boldFont.setBold(true);
|
|
||||||
QFont normalFont = option.font;
|
|
||||||
|
|
||||||
QString name = index.data(Qt::DisplayRole).toString();
|
|
||||||
QString currentVersion = index.data(Qt::UserRole + 2).toString();
|
|
||||||
QString newVersion = index.data(Qt::UserRole + 3).toString();
|
|
||||||
QString iconPath = index.data(Qt::UserRole + 4).toString();
|
|
||||||
QString size = index.data(Qt::UserRole + 5).toString();
|
|
||||||
QString description = index.data(Qt::UserRole + 6).toString();
|
|
||||||
|
|
||||||
QRect rect = option.rect;
|
|
||||||
int margin = 10, spacing = 6, iconSize = 40;
|
|
||||||
|
|
||||||
QRect iconRect(rect.left() + margin, rect.top() + (rect.height() - iconSize) / 2, iconSize, iconSize);
|
|
||||||
QIcon(iconPath).paint(painter, iconRect);
|
|
||||||
|
|
||||||
int textX = iconRect.right() + margin;
|
|
||||||
int textWidth = rect.width() - textX - 100;
|
|
||||||
|
|
||||||
QRect nameRect(textX, rect.top() + margin, textWidth, 20);
|
|
||||||
painter->setFont(boldFont);
|
|
||||||
painter->setPen(QColor("#333333"));
|
|
||||||
painter->drawText(nameRect, Qt::AlignLeft | Qt::AlignVCenter, name);
|
|
||||||
|
|
||||||
QRect versionRect(textX, nameRect.bottom() + spacing, textWidth, 20);
|
|
||||||
painter->setFont(normalFont);
|
|
||||||
painter->setPen(QColor("#888888"));
|
|
||||||
painter->drawText(versionRect, Qt::AlignLeft | Qt::AlignVCenter,
|
|
||||||
QString("当前版本: %1 → 新版本: %2").arg(currentVersion, newVersion));
|
|
||||||
|
|
||||||
QRect descRect(textX, versionRect.bottom() + spacing, textWidth, 40);
|
|
||||||
painter->setFont(normalFont);
|
|
||||||
painter->setPen(QColor("#AAAAAA"));
|
|
||||||
painter->drawText(descRect, Qt::TextWordWrap,
|
|
||||||
QString("包大小:%1 MB").arg(QString::number(size.toDouble() / (1024 * 1024), 'f', 2)));
|
|
||||||
|
|
||||||
QString packageName = index.data(Qt::UserRole + 1).toString();
|
|
||||||
bool isDownloading = m_downloads.contains(packageName) && m_downloads[packageName].isDownloading;
|
|
||||||
int progress = m_downloads.value(packageName, DownloadInfo{0, false}).progress;
|
|
||||||
bool isInstalled = m_downloads.value(packageName).isInstalled;
|
|
||||||
bool isInstalling = m_downloads.value(packageName).isInstalling;
|
|
||||||
|
|
||||||
if (isDownloading) {
|
|
||||||
QRect progressRect(rect.right() - 270, rect.top() + (rect.height() - 20) / 2, 150, 20);
|
|
||||||
QStyleOptionProgressBar progressBarOption;
|
|
||||||
progressBarOption.rect = progressRect;
|
|
||||||
progressBarOption.minimum = 0;
|
|
||||||
progressBarOption.maximum = 100;
|
|
||||||
progressBarOption.progress = progress;
|
|
||||||
progressBarOption.text = QString("%1%").arg(progress);
|
|
||||||
progressBarOption.textVisible = true;
|
|
||||||
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &progressBarOption, painter);
|
|
||||||
|
|
||||||
// 修改后的取消按钮绘制代码
|
|
||||||
QRect buttonRect(rect.right() - 80, rect.top() + (rect.height() - 30) / 2, 70, 30);
|
|
||||||
painter->setPen(Qt::NoPen);
|
|
||||||
painter->setBrush(QColor("#ff4444")); // 红色背景
|
|
||||||
painter->drawRoundedRect(buttonRect, 4, 4); // 圆角矩形
|
|
||||||
|
|
||||||
painter->setPen(Qt::white); // 白色文字
|
|
||||||
painter->setFont(option.font);
|
|
||||||
painter->drawText(buttonRect, Qt::AlignCenter, "取消");
|
|
||||||
} else if (isInstalling) {
|
|
||||||
// 安装中:显示转圈和文字
|
|
||||||
QRect spinnerRect(option.rect.right() - 80, option.rect.top() + (option.rect.height() - 30) / 2, 30, 30);
|
|
||||||
int angle = (m_spinnerTimer.elapsed() / 10) % 360;
|
|
||||||
QPen pen(QColor("#2563EB"), 3);
|
|
||||||
painter->setPen(pen);
|
|
||||||
painter->setRenderHint(QPainter::Antialiasing, true);
|
|
||||||
QRectF arcRect = spinnerRect.adjusted(3, 3, -3, -3);
|
|
||||||
painter->drawArc(arcRect, angle * 16, 120 * 16); // 120度弧
|
|
||||||
|
|
||||||
QRect textRect(option.rect.right() - 120, option.rect.top() + (option.rect.height() - 30) / 2, 110, 30);
|
|
||||||
painter->setPen(QColor("#2563EB"));
|
|
||||||
painter->setFont(option.font);
|
|
||||||
painter->drawText(textRect, Qt::AlignLeft | Qt::AlignVCenter, "正在安装中");
|
|
||||||
} else {
|
|
||||||
QRect buttonRect(option.rect.right() - 80, option.rect.top() + (option.rect.height() - 30) / 2, 70, 30);
|
|
||||||
painter->setPen(Qt::NoPen);
|
|
||||||
if (isInstalled) {
|
|
||||||
painter->setBrush(QColor("#10B981"));
|
|
||||||
painter->drawRoundedRect(buttonRect, 4, 4);
|
|
||||||
painter->setPen(Qt::white);
|
|
||||||
painter->drawText(buttonRect, Qt::AlignCenter, "已安装");
|
|
||||||
} else if (m_downloads.contains(packageName) && !m_downloads[packageName].isDownloading) {
|
|
||||||
// 下载完成,按钮绿色,样式不变
|
|
||||||
painter->setBrush(QColor("#10B981"));
|
|
||||||
painter->drawRoundedRect(buttonRect, 4, 4);
|
|
||||||
painter->setPen(Qt::white);
|
|
||||||
painter->drawText(buttonRect, Qt::AlignCenter, "下载完成");
|
|
||||||
// 不需要特殊处理样式,交互在 editorEvent 控制
|
|
||||||
} else {
|
|
||||||
painter->setBrush(QColor("#e9effd"));
|
|
||||||
painter->drawRoundedRect(buttonRect, 4, 4);
|
|
||||||
painter->setPen(QColor("#2563EB"));
|
|
||||||
painter->drawText(buttonRect, Qt::AlignCenter, "更新");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
painter->restore();
|
|
||||||
}
|
|
||||||
|
|
||||||
QSize AppDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const {
|
|
||||||
return QSize(option.rect.width(), 110);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AppDelegate::editorEvent(QEvent *event, QAbstractItemModel *model,
|
|
||||||
const QStyleOptionViewItem &option, const QModelIndex &index) {
|
|
||||||
if (event->type() == QEvent::MouseButtonRelease) {
|
|
||||||
QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
|
|
||||||
QRect rect = option.rect;
|
|
||||||
QString packageName = index.data(Qt::UserRole + 1).toString();
|
|
||||||
|
|
||||||
if (m_downloads.contains(packageName) && m_downloads[packageName].isDownloading) {
|
|
||||||
QRect cancelButtonRect(rect.right() - 70, rect.top() + (rect.height() - 20) / 2, 60, 20);
|
|
||||||
if (cancelButtonRect.contains(mouseEvent->pos())) {
|
|
||||||
m_downloadManager->cancelDownload(packageName);
|
|
||||||
m_downloads.remove(packageName);
|
|
||||||
emit updateDisplay(packageName);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
QRect buttonRect(rect.right() - 80, rect.top() + (rect.height() - 30) / 2, 70, 30);
|
|
||||||
if (buttonRect.contains(mouseEvent->pos())) {
|
|
||||||
// 判断是否为“下载完成”状态,如果是则不响应点击
|
|
||||||
if (m_downloads.contains(packageName) && !m_downloads[packageName].isDownloading) {
|
|
||||||
// “下载完成”状态,按钮失效,点击无效
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
QString downloadUrl = index.data(Qt::UserRole + 7).toString();
|
|
||||||
QString outputPath = QString("%1/%2.metalink").arg(QDir::tempPath(), packageName);
|
|
||||||
|
|
||||||
m_downloads[packageName] = {0, true};
|
|
||||||
m_downloadManager->startDownload(packageName, downloadUrl, outputPath);
|
|
||||||
emit updateDisplay(packageName);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return QStyledItemDelegate::editorEvent(event, model, option, index);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AppDelegate::startDownloadForAll() {
|
|
||||||
if (!m_model) return;
|
|
||||||
for (int row = 0; row < m_model->rowCount(); ++row) {
|
|
||||||
QModelIndex index = m_model->index(row, 0);
|
|
||||||
QString packageName = index.data(Qt::UserRole + 1).toString();
|
|
||||||
if (m_downloads.contains(packageName) && (m_downloads[packageName].isDownloading || m_downloads[packageName].isInstalled))
|
|
||||||
continue; // 跳过正在下载或已安装的
|
|
||||||
QString downloadUrl = index.data(Qt::UserRole + 7).toString();
|
|
||||||
QString outputPath = QString("%1/%2.metalink").arg(QDir::tempPath(), packageName);
|
|
||||||
m_downloads[packageName] = {0, true, false};
|
|
||||||
m_downloadManager->startDownload(packageName, downloadUrl, outputPath);
|
|
||||||
emit updateDisplay(packageName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增:安装队列相关实现
|
|
||||||
void AppDelegate::enqueueInstall(const QString &packageName) {
|
|
||||||
m_installQueue.enqueue(packageName);
|
|
||||||
if (!m_isInstalling) {
|
|
||||||
startNextInstall();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void AppDelegate::startNextInstall() {
|
|
||||||
if (m_installQueue.isEmpty()) {
|
|
||||||
m_isInstalling = false;
|
|
||||||
m_installingPackage.clear();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
m_isInstalling = true;
|
|
||||||
QString packageName = m_installQueue.dequeue();
|
|
||||||
m_installingPackage = packageName;
|
|
||||||
m_downloads[packageName].isInstalling = true;
|
|
||||||
emit updateDisplay(packageName);
|
|
||||||
|
|
||||||
// 查找 /tmp 下以包名开头的 .deb 文件
|
|
||||||
QDir tempDir(QDir::tempPath());
|
|
||||||
QStringList debs = tempDir.entryList(QStringList() << QString("%1_*.deb").arg(packageName), QDir::Files);
|
|
||||||
QString debPath;
|
|
||||||
if (!debs.isEmpty()) {
|
|
||||||
debPath = tempDir.absoluteFilePath(debs.first());
|
|
||||||
} else {
|
|
||||||
debs = tempDir.entryList(QStringList() << QString("%1*.deb").arg(packageName), QDir::Files);
|
|
||||||
if (!debs.isEmpty()) {
|
|
||||||
debPath = tempDir.absoluteFilePath(debs.first());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (debPath.isEmpty()) {
|
|
||||||
qWarning() << "未找到deb文件,包名:" << packageName;
|
|
||||||
m_downloads[packageName].isInstalling = false;
|
|
||||||
emit updateDisplay(packageName);
|
|
||||||
m_installingPackage.clear();
|
|
||||||
startNextInstall();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_installProcess = new QProcess(this);
|
|
||||||
|
|
||||||
// 新增:准备安装日志文件
|
|
||||||
QString logPath = QString("/tmp/%1_install.log").arg(packageName);
|
|
||||||
QFile *logFile = new QFile(logPath, m_installProcess);
|
|
||||||
if (logFile->open(QIODevice::Append | QIODevice::Text)) {
|
|
||||||
// 设置权限为777
|
|
||||||
QFile::setPermissions(logPath, QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner |
|
|
||||||
QFile::ReadGroup | QFile::WriteGroup | QFile::ExeGroup |
|
|
||||||
QFile::ReadOther | QFile::WriteOther | QFile::ExeOther);
|
|
||||||
connect(m_installProcess, &QProcess::readyReadStandardOutput, this, [this, packageName, logFile]() {
|
|
||||||
QByteArray out = m_installProcess->readAllStandardOutput();
|
|
||||||
logFile->write(out);
|
|
||||||
logFile->flush();
|
|
||||||
QString text = QString::fromLocal8Bit(out);
|
|
||||||
qDebug().noquote() << text;
|
|
||||||
// 检查“软件包已安装”关键字
|
|
||||||
if (text.contains(QStringLiteral("软件包已安装"))) {
|
|
||||||
m_downloads[packageName].isInstalling = false;
|
|
||||||
m_downloads[packageName].isInstalled = true;
|
|
||||||
emit updateDisplay(packageName);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
connect(m_installProcess, &QProcess::readyReadStandardError, this, [this, logFile]() {
|
|
||||||
QByteArray err = m_installProcess->readAllStandardError();
|
|
||||||
logFile->write(err);
|
|
||||||
logFile->flush();
|
|
||||||
qDebug().noquote() << QString::fromLocal8Bit(err);
|
|
||||||
});
|
|
||||||
connect(m_installProcess, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
|
||||||
this, [this, packageName, logFile](int exitCode, QProcess::ExitStatus status) {
|
|
||||||
if (logFile) logFile->close();
|
|
||||||
m_downloads[packageName].isInstalling = false;
|
|
||||||
if (exitCode == 0) {
|
|
||||||
m_downloads[packageName].isInstalled = true; // 安装成功
|
|
||||||
}
|
|
||||||
emit updateDisplay(packageName);
|
|
||||||
m_installProcess->deleteLater();
|
|
||||||
m_installProcess = nullptr;
|
|
||||||
m_installingPackage.clear();
|
|
||||||
startNextInstall();
|
|
||||||
});
|
|
||||||
|
|
||||||
} else {
|
|
||||||
// 日志文件无法打开时,仍然要连接原有信号
|
|
||||||
connect(m_installProcess, &QProcess::readyReadStandardOutput, this, [this, packageName]() {
|
|
||||||
QByteArray out = m_installProcess->readAllStandardOutput();
|
|
||||||
QString text = QString::fromLocal8Bit(out);
|
|
||||||
qDebug().noquote() << text;
|
|
||||||
if (text.contains(QStringLiteral("软件包已安装"))) {
|
|
||||||
m_downloads[packageName].isInstalling = false;
|
|
||||||
m_downloads[packageName].isInstalled = true;
|
|
||||||
emit updateDisplay(packageName);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
connect(m_installProcess, &QProcess::readyReadStandardError, this, [this]() {
|
|
||||||
QByteArray err = m_installProcess->readAllStandardError();
|
|
||||||
qDebug().noquote() << QString::fromLocal8Bit(err);
|
|
||||||
});
|
|
||||||
connect(m_installProcess, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
|
||||||
this, [this, packageName](int /*exitCode*/, QProcess::ExitStatus /*status*/) {
|
|
||||||
emit updateDisplay(packageName);
|
|
||||||
m_installProcess->deleteLater();
|
|
||||||
m_installProcess = nullptr;
|
|
||||||
m_installingPackage.clear();
|
|
||||||
startNextInstall();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 注意参数顺序:deb路径在前,--no-create-desktop-entry在后
|
|
||||||
QStringList args;
|
|
||||||
args << debPath << "--no-create-desktop-entry";
|
|
||||||
m_installProcess->start("ssinstall", args);
|
|
||||||
}
|
|
||||||
18
src/src.cmake
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
include_directories(backend)
|
||||||
|
include_directories(dbus)
|
||||||
|
include_directories(pages)
|
||||||
|
include_directories(utils)
|
||||||
|
include_directories(widgets)
|
||||||
|
|
||||||
|
# https://cmake.org/cmake/help/v3.12/command/file.html#glob-recurse
|
||||||
|
file(GLOB_RECURSE HEADERS CONFIGURE_DEPENDS
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/*.h"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/*.hpp"
|
||||||
|
)
|
||||||
|
|
||||||
|
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/*.ui"
|
||||||
|
)
|
||||||
|
|
||||||
|
qt6_add_resources(QRC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/assets/assets.qrc)
|
||||||
@@ -41,8 +41,7 @@ QString HttpRequest::postRequest(QString url, QString jsondata)
|
|||||||
QEventLoop eventLoop;
|
QEventLoop eventLoop;
|
||||||
connect(naManager, SIGNAL(finished(QNetworkReply *)), &eventLoop, SLOT(quit()));
|
connect(naManager, SIGNAL(finished(QNetworkReply *)), &eventLoop, SLOT(quit()));
|
||||||
eventLoop.exec();
|
eventLoop.exec();
|
||||||
QTextCodec *codec = QTextCodec::codecForName("utf8");
|
QString strReply(reply->readAll());
|
||||||
QString strReply = codec->toUnicode(reply->readAll());
|
|
||||||
reply->deleteLater();
|
reply->deleteLater();
|
||||||
return strReply;
|
return strReply;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
#include <QNetworkRequest>
|
#include <QNetworkRequest>
|
||||||
#include <QEventLoop>
|
#include <QEventLoop>
|
||||||
#include <QTextCodec>
|
|
||||||
class HttpRequest : public QObject
|
class HttpRequest : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|||||||
@@ -10,6 +10,10 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QUuid>
|
#include <QUuid>
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
|
#include <QDateTime>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QFile>
|
||||||
|
#include <QTextStream>
|
||||||
|
|
||||||
#define UOSDeveloperModeFile "/var/lib/deepin/developer-mode/enabled"
|
#define UOSDeveloperModeFile "/var/lib/deepin/developer-mode/enabled"
|
||||||
|
|
||||||
@@ -261,3 +265,183 @@ QJsonObject Utils::parseFeatureJsonFile()
|
|||||||
|
|
||||||
return jsonDoc.object();
|
return jsonDoc.object();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Utils::shouldDisableWebEngineSandbox 检查是否应关闭webengine沙箱
|
||||||
|
* @return bool true: 配置文件中设置了关闭沙箱 false: 未设置或设置为false
|
||||||
|
*/
|
||||||
|
bool Utils::shouldDisableWebEngineSandbox()
|
||||||
|
{
|
||||||
|
// WARNING: 请在 组织名称 和 应用程序名称 初始化完成后调用
|
||||||
|
QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat);
|
||||||
|
|
||||||
|
// 检查配置文件中[webengine]部分的noSandbox配置项
|
||||||
|
// 如果配置存在且值为true,则返回true;否则返回false
|
||||||
|
qDebug()<<"sandbox is set to"<<config.value("webengine/noSandbox", false).toBool();
|
||||||
|
return config.value("webengine/noSandbox", false).toBool();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 日志相关静态变量
|
||||||
|
static QFile *logFile = nullptr;
|
||||||
|
static QString logFilePath;
|
||||||
|
|
||||||
|
// 自定义消息处理器,捕获所有Qt日志输出
|
||||||
|
void customMessageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg)
|
||||||
|
{
|
||||||
|
QByteArray localMsg = msg.toLocal8Bit();
|
||||||
|
QString level;
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case QtDebugMsg:
|
||||||
|
level = "DEBUG";
|
||||||
|
fprintf(stderr, "DEBUG: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
|
||||||
|
break;
|
||||||
|
case QtInfoMsg:
|
||||||
|
level = "INFO";
|
||||||
|
fprintf(stderr, "INFO: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
|
||||||
|
break;
|
||||||
|
case QtWarningMsg:
|
||||||
|
level = "WARNING";
|
||||||
|
fprintf(stderr, "WARNING: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
|
||||||
|
break;
|
||||||
|
case QtCriticalMsg:
|
||||||
|
level = "ERROR";
|
||||||
|
fprintf(stderr, "ERROR: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
|
||||||
|
break;
|
||||||
|
case QtFatalMsg:
|
||||||
|
level = "FATAL";
|
||||||
|
fprintf(stderr, "FATAL: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function);
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 写入到日志文件
|
||||||
|
Utils::writeLog(level, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化日志系统
|
||||||
|
void Utils::initLogger()
|
||||||
|
{
|
||||||
|
// 确保日志目录存在
|
||||||
|
QString logDir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
|
||||||
|
QDir dir;
|
||||||
|
if (!dir.exists(logDir)) {
|
||||||
|
dir.mkpath(logDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置日志文件路径
|
||||||
|
QString timestamp = QDateTime::currentDateTime().toString("yyyyMMdd_HHmmss");
|
||||||
|
logFilePath = logDir + QString("/spark-store_%1.log").arg(timestamp);
|
||||||
|
|
||||||
|
// 打开日志文件
|
||||||
|
logFile = new QFile(logFilePath);
|
||||||
|
if (!logFile->open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text)) {
|
||||||
|
qWarning() << "Failed to open log file:" << logFilePath;
|
||||||
|
delete logFile;
|
||||||
|
logFile = nullptr;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 安装自定义消息处理器,捕获所有Qt日志输出
|
||||||
|
qInstallMessageHandler(customMessageHandler);
|
||||||
|
|
||||||
|
// 写入日志头信息
|
||||||
|
writeLog("INFO", "Logger initialized");
|
||||||
|
writeLog("INFO", QString("Application started at %1").arg(
|
||||||
|
QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss")));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 写入日志
|
||||||
|
void Utils::writeLog(const QString &level, const QString &message)
|
||||||
|
{
|
||||||
|
if (!logFile || !logFile->isOpen()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString timestamp = QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz");
|
||||||
|
QString logEntry = QString("[%1] [%2] %3\n").arg(timestamp).arg(level).arg(message);
|
||||||
|
|
||||||
|
QTextStream out(logFile);
|
||||||
|
out << logEntry;
|
||||||
|
logFile->flush();
|
||||||
|
|
||||||
|
// 同时输出到控制台,便于调试
|
||||||
|
if (level == "ERROR") {
|
||||||
|
qCritical() << logEntry.trimmed();
|
||||||
|
} else if (level == "WARNING") {
|
||||||
|
qWarning() << logEntry.trimmed();
|
||||||
|
} else {
|
||||||
|
qDebug() << logEntry.trimmed();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出日志
|
||||||
|
bool Utils::exportLogs(const QString &targetPath)
|
||||||
|
{
|
||||||
|
QString exportPath = targetPath;
|
||||||
|
if (exportPath.isEmpty()) {
|
||||||
|
exportPath = "/tmp/spark-store";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 确保目标目录存在
|
||||||
|
QDir dir;
|
||||||
|
if (!dir.exists(exportPath)) {
|
||||||
|
if (!dir.mkpath(exportPath)) {
|
||||||
|
writeLog("ERROR", QString("Failed to create target directory: %1").arg(exportPath));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭当前日志文件,便于复制
|
||||||
|
if (logFile && logFile->isOpen()) {
|
||||||
|
logFile->close();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 复制日志文件到目标位置
|
||||||
|
QString timestamp = QDateTime::currentDateTime().toString("yyyyMMdd_HHmmss");
|
||||||
|
QString targetLogPath = exportPath + QString("/spark-store_full_log_%1.log").arg(timestamp);
|
||||||
|
|
||||||
|
bool success = QFile::copy(logFilePath, targetLogPath);
|
||||||
|
|
||||||
|
// 额外检查:即使QFile::copy返回false,也要检查目标文件是否实际存在且大小合理
|
||||||
|
if (!success) {
|
||||||
|
QFileInfo targetFileInfo(targetLogPath);
|
||||||
|
if (targetFileInfo.exists() && targetFileInfo.size() > 0) {
|
||||||
|
success = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (success) {
|
||||||
|
writeLog("INFO", QString("All logs (INFO, DEBUG, WARNING, ERROR) exported to: %1").arg(targetLogPath));
|
||||||
|
|
||||||
|
// 同时创建一个简单的导出报告
|
||||||
|
QString reportPath = exportPath + QString("/export_report_%1.txt").arg(timestamp);
|
||||||
|
QFile reportFile(reportPath);
|
||||||
|
if (reportFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||||
|
QTextStream out(&reportFile);
|
||||||
|
out << "Spark Store Log Export Report\n";
|
||||||
|
out << "================================\n";
|
||||||
|
out << "Export Time: " << QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss") << "\n";
|
||||||
|
out << "Target Directory: " << exportPath << "\n";
|
||||||
|
out << "Log File: " << targetLogPath << "\n";
|
||||||
|
out << "Original Log: " << logFilePath << "\n";
|
||||||
|
out << "Log Levels: INFO, DEBUG, WARNING, ERROR, FATAL\n";
|
||||||
|
out << "Status: SUCCESS\n";
|
||||||
|
reportFile.close();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
writeLog("ERROR", QString("Failed to export logs to: %1").arg(targetLogPath));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 重新打开日志文件继续记录
|
||||||
|
if (logFile && !logFile->isOpen()) {
|
||||||
|
logFile->open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text);
|
||||||
|
}
|
||||||
|
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取日志文件路径
|
||||||
|
QString Utils::getLogFilePath()
|
||||||
|
{
|
||||||
|
return logFilePath;
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
|
#include <QString>
|
||||||
|
#include <QMessageLogContext>
|
||||||
|
#include <QtGlobal>
|
||||||
|
|
||||||
class Utils
|
class Utils
|
||||||
{
|
{
|
||||||
@@ -18,6 +21,13 @@ public:
|
|||||||
static void setQPAPlatform();
|
static void setQPAPlatform();
|
||||||
static void checkUOSDeveloperMode();
|
static void checkUOSDeveloperMode();
|
||||||
static QJsonObject parseFeatureJsonFile();
|
static QJsonObject parseFeatureJsonFile();
|
||||||
|
static bool shouldDisableWebEngineSandbox(); // 新增函数声明
|
||||||
|
|
||||||
|
// 日志相关函数
|
||||||
|
static void initLogger(); // 初始化日志系统
|
||||||
|
static void writeLog(const QString &level, const QString &message); // 写入日志
|
||||||
|
static bool exportLogs(const QString &targetPath = "/tmp/spark-store"); // 导出日志
|
||||||
|
static QString getLogFilePath(); // 获取日志文件路径
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // UTILS_H
|
#endif // UTILS_H
|
||||||
@@ -17,7 +17,7 @@ big_image::big_image(DBlurEffectWidget *parent) : DBlurEffectWidget(parent),
|
|||||||
QHBoxLayout *layout = new QHBoxLayout;
|
QHBoxLayout *layout = new QHBoxLayout;
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
layout->addWidget(m_image);
|
layout->addWidget(m_image);
|
||||||
layout->setMargin(0);
|
layout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
// Make sure the image has a parent so that it will be freed.
|
// Make sure the image has a parent so that it will be freed.
|
||||||
m_image->setParent(this);
|
m_image->setParent(this);
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
#include "customlabel.h"
|
#include "customlabel.h"
|
||||||
|
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
|
|
||||||
CustomLabel::CustomLabel(QWidget *parent, Qt::WindowFlags f)
|
CustomLabel::CustomLabel(QWidget *parent,
|
||||||
|
Qt::WindowFlags f)
|
||||||
: QLabel(parent, f)
|
: QLabel(parent, f)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QPixmap CustomLabel::pixmap() const
|
QPixmap CustomLabel::pixmap() const
|
||||||
{
|
{
|
||||||
const QPixmap *p = QLabel::pixmap();
|
return QLabel::pixmap();
|
||||||
return p ? *p : QPixmap();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CustomLabel::setPixmap(const QPixmap &pixmap)
|
void CustomLabel::setPixmap(const QPixmap &pixmap)
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ void DownloadItem::install(int t)
|
|||||||
ui->label_2->setText(tr("Installing"));
|
ui->label_2->setText(tr("Installing"));
|
||||||
ui->label_2->setToolTip(tr("Installing"));
|
ui->label_2->setToolTip(tr("Installing"));
|
||||||
|
|
||||||
QtConcurrent::run([=]()
|
auto future = QtConcurrent::run([=]()
|
||||||
{
|
{
|
||||||
slotAsyncInstall(t);
|
slotAsyncInstall(t);
|
||||||
});
|
});
|
||||||
@@ -158,7 +158,7 @@ void DownloadItem::on_pushButton_3_clicked()
|
|||||||
output_w->setMinimumHeight(600);
|
output_w->setMinimumHeight(600);
|
||||||
output_w->setAttribute(Qt::WA_TranslucentBackground);
|
output_w->setAttribute(Qt::WA_TranslucentBackground);
|
||||||
output_w->setTitle(ui->label->text());
|
output_w->setTitle(ui->label->text());
|
||||||
output_w->layout()->setMargin(20);
|
output_w->layout()->setContentsMargins(20, 20, 20, 20);
|
||||||
output_w->layout()->addWidget(textbrowser);
|
output_w->layout()->addWidget(textbrowser);
|
||||||
output_w->show();
|
output_w->show();
|
||||||
}
|
}
|
||||||
@@ -216,7 +216,7 @@ void DownloadItem::slotAsyncInstall(int t)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// QProcess isInstall;
|
QProcess isInstall;
|
||||||
// isInstall.start("dpkg", QStringList() << "-s" << pkgName);
|
// isInstall.start("dpkg", QStringList() << "-s" << pkgName);
|
||||||
// isInstall.waitForFinished(180 * 1000); // 默认超时 3 分钟
|
// isInstall.waitForFinished(180 * 1000); // 默认超时 3 分钟
|
||||||
// int error = QString::fromStdString(isInstall.readAllStandardError().toStdString()).length();
|
// int error = QString::fromStdString(isInstall.readAllStandardError().toStdString()).length();
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ void DownloadListWidget::httpFinished() // 完成下载
|
|||||||
isdownload = false;
|
isdownload = false;
|
||||||
isBusy = false;
|
isBusy = false;
|
||||||
|
|
||||||
QtConcurrent::run([=]()
|
auto future = QtConcurrent::run([=]()
|
||||||
{
|
{
|
||||||
while (downloaditemlist[nowDownload - 1]->readyInstall() == -1) // 安装当前应用,堵塞安装,后面的下载suspend
|
while (downloaditemlist[nowDownload - 1]->readyInstall() == -1) // 安装当前应用,堵塞安装,后面的下载suspend
|
||||||
{
|
{
|
||||||
|
|||||||
169
tool/apt-fast-conf/apt-fast.conf
Normal file
@@ -0,0 +1,169 @@
|
|||||||
|
###################################################################
|
||||||
|
# CONFIGURATION OPTIONS
|
||||||
|
###################################################################
|
||||||
|
# Every item has a default value besides MIRRORS (which is unset).
|
||||||
|
|
||||||
|
# Use aptitude, apt-get, or apt?
|
||||||
|
# Note that apt-get is used as a fallback for outputting the
|
||||||
|
# package URI list for e.g. aptitude, which can't do this
|
||||||
|
# Optionally add the FULLPATH to apt-get or apt-rpm or aptitude
|
||||||
|
# e.g. /usr/bin/aptitude
|
||||||
|
#
|
||||||
|
# Default: apt-get
|
||||||
|
#
|
||||||
|
_APTMGR=apt-get
|
||||||
|
|
||||||
|
if [ -x "$(command -v apt)" ]; then
|
||||||
|
_APTMGR=apt
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if grep -Eqi "linuxmint" /etc/os-release;then
|
||||||
|
_APTMGR=apt-get
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -x "$(command -v oyo)" ]; then
|
||||||
|
_APTMGR=/usr/bin/apt
|
||||||
|
fi
|
||||||
|
|
||||||
|
####
|
||||||
|
#
|
||||||
|
# UOS sources auth config
|
||||||
|
#
|
||||||
|
#
|
||||||
|
if grep -Eqi "UnionTech" /etc/issue || grep -Eq "UnionTech" /etc/*-release;then
|
||||||
|
AUTH_UOS_USER="uos-https://license.chinauos.com-apt"
|
||||||
|
AUTH_UOS_PASSWD="`cat /etc/apt/auth.conf.d/uos.conf | grep home-packages.chinauos.com`"
|
||||||
|
AUTH_UOS_PASSWD=`echo ${AUTH_UOS_PASSWD#*password }`
|
||||||
|
|
||||||
|
fi
|
||||||
|
##### UOS自动读取账号密码以实现使用aptss来加速下载
|
||||||
|
|
||||||
|
# Enable DOWNLOADBEFORE to suppress apt-fast confirmation dialog and download
|
||||||
|
# packages directly.
|
||||||
|
#
|
||||||
|
# Default: dialog enabled
|
||||||
|
#
|
||||||
|
DOWNLOADBEFORE=true
|
||||||
|
|
||||||
|
|
||||||
|
# Choose mirror list to speed up downloads from same archive. To select some
|
||||||
|
# mirrors take a look at your distribution's archive mirror lists.
|
||||||
|
# Debian: http://www.debian.org/mirror/list
|
||||||
|
# Ubuntu: https://launchpad.net/ubuntu/+archivemirrors
|
||||||
|
#
|
||||||
|
# It is required to add mirrors in the sources.list to this array as well, so
|
||||||
|
# apt-fast can destinguish between different distributions.
|
||||||
|
#
|
||||||
|
# Examples:
|
||||||
|
#
|
||||||
|
# Different distributions (as in operating systems):
|
||||||
|
#
|
||||||
|
# sources.list:
|
||||||
|
# deb http://deb.debian.org/debian/ unstable main non-free contrib
|
||||||
|
# deb http://de.archive.ubuntu.com/ubuntu/ bionic main universe
|
||||||
|
#
|
||||||
|
# apt-fast.conf:
|
||||||
|
# MIRRORS=( 'http://deb.debian.org/debian','http://ftp.debian.org/debian,http://ftp2.de.debian.org/debian,http://ftp.de.debian.org/debian,ftp://ftp.uni-kl.de/debian'
|
||||||
|
# 'http://archive.ubuntu.com/ubuntu,http://de.archive.ubuntu.com/ubuntu,http://ftp.halifax.rwth-aachen.de/ubuntu,http://ftp.uni-kl.de/pub/linux/ubuntu,http://mirror.informatik.uni-mannheim.de/pub/linux/distributions/ubuntu/' )
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Single distribution:
|
||||||
|
#
|
||||||
|
# sources.list:
|
||||||
|
# deb http://fr.archive.ubuntu.com/ubuntu/ bionic main
|
||||||
|
# deb http://fr.archive.ubuntu.com/ubuntu/ artful main
|
||||||
|
#
|
||||||
|
# apt-fast.conf:
|
||||||
|
# MIRRORS=( 'http://fr.archive.ubuntu.com/ubuntu,http://bouyguestelecom.ubuntu.lafibre.info/ubuntu,http://mirror.ovh.net/ubuntu,http://ubuntu-archive.mirrors.proxad.net/ubuntu' )
|
||||||
|
#
|
||||||
|
# Default: disabled
|
||||||
|
#
|
||||||
|
MIRRORS=( 'https://d.store.deepinos.org.cn/,https://zunyun01.store.deepinos.org.cn/,https://mirrors.sdu.edu.cn/spark-store-repository/,http://cdn.dl.uniartisan.com:9000/deepinos/,https://d1.store.deepinos.org.cn/,https://d2.store.deepinos.org.cn/,https://d3.store.deepinos.org.cn/,https://d4.store.deepinos.org.cn/,https://d5.store.deepinos.org.cn/' )
|
||||||
|
|
||||||
|
|
||||||
|
# Maximum number of connections
|
||||||
|
# You can use this value in _DOWNLOADER command. Escape with ${}: ${_MAXNUM}
|
||||||
|
#
|
||||||
|
# Default: 5
|
||||||
|
#
|
||||||
|
_MAXNUM=16
|
||||||
|
|
||||||
|
|
||||||
|
# Maximum number of connections per server
|
||||||
|
# Default: 10
|
||||||
|
#
|
||||||
|
_MAXCONPERSRV=1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Split size i.e. size of each piece
|
||||||
|
# Possible Values: 1M-1024M
|
||||||
|
#
|
||||||
|
_MINSPLITSZ=1M
|
||||||
|
|
||||||
|
|
||||||
|
# Piece selection algorithm to use
|
||||||
|
# Available values are: default, inorder, geom
|
||||||
|
# default: selects piece so that it reduces the number of establishing connection, reasonable for most cases
|
||||||
|
# inorder: selects pieces in sequential order starting from first piece
|
||||||
|
# geom: selects piece which has minimum index like inorder, but it exponentially increasingly keeps space from previously selected pieces
|
||||||
|
#
|
||||||
|
_PIECEALGO=default
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Downloadmanager listfile
|
||||||
|
# You can use this value in _DOWNLOADER command. Escape with ${}: ${DLLIST}
|
||||||
|
#
|
||||||
|
# Default: /tmp/apt-fast.list
|
||||||
|
#
|
||||||
|
DLLIST='/tmp/apt-fast.list'
|
||||||
|
|
||||||
|
|
||||||
|
# Download command to use. Temporary download list is designed for aria2. But
|
||||||
|
# you can choose another download command or download manager. It has to
|
||||||
|
# support following input file syntax (\t is tab character):
|
||||||
|
#
|
||||||
|
# # Comment
|
||||||
|
# MIRROR1\tMIRROR2\tMIRROR3...
|
||||||
|
# out=FILENAME1
|
||||||
|
# MIRROR1\tMIRROR2\tMIRROR3...
|
||||||
|
# out=FILENAME2
|
||||||
|
# ...
|
||||||
|
#
|
||||||
|
# Examples:
|
||||||
|
# aria2c with a proxy (set username, proxy, ip and password!)
|
||||||
|
# _DOWNLOADER='aria2c --no-conf -c -j ${_MAXNUM} -x ${_MAXCONPERSRV} -s ${_SPLITCON} --min-split-size=${_MINSPLITSZ} --stream-piece-selector=${_PIECEALGO} --http-proxy=http://username:password@proxy_ip:proxy_port -i ${DLLIST}'
|
||||||
|
#
|
||||||
|
# Default: _DOWNLOADER='aria2c --no-conf -c -j ${_MAXNUM} -x ${_MAXCONPERSRV} -s ${_SPLITCON} --min-split-size=${_MINSPLITSZ} --stream-piece-selector=${_PIECEALGO} -i ${DLLIST} --connect-timeout=600 --timeout=600 -m0'
|
||||||
|
#
|
||||||
|
_DOWNLOADER='aria2c --no-conf -c -j ${_MAXNUM} -x ${_MAXCONPERSRV} --min-split-size=${_MINSPLITSZ} --stream-piece-selector=${_PIECEALGO} -i ${DLLIST} --connect-timeout=600 --timeout=600 -m0 --http-user ${AUTH_UOS_USER} --http-passwd ${AUTH_UOS_PASSWD}'
|
||||||
|
|
||||||
|
|
||||||
|
# Download temp folder for Downloadmanager
|
||||||
|
# example /tmp/apt-fast. Standard is /var/cache/apt-fast
|
||||||
|
#
|
||||||
|
# Default: /var/cache/apt/apt-fast
|
||||||
|
#
|
||||||
|
DLDIR='/var/cache/apt/apt-fast'
|
||||||
|
|
||||||
|
|
||||||
|
# APT archives cache directory
|
||||||
|
#
|
||||||
|
# Default /var/cache/apt/archives
|
||||||
|
# (APT configuration items Dir::Cache and Dir::Cache::archives)
|
||||||
|
#
|
||||||
|
APTCACHE='/var/cache/apt/archives'
|
||||||
|
|
||||||
|
|
||||||
|
# apt-fast colors
|
||||||
|
# Colors are disabled when not using a terminal.
|
||||||
|
#
|
||||||
|
# Default colors are:
|
||||||
|
# cGreen='\e[0;32m'
|
||||||
|
# cRed='\e[0;31m'
|
||||||
|
# cBlue='\e[0;34m'
|
||||||
|
# endColor='\e[0m'
|
||||||
@@ -55,6 +55,41 @@ msg_already_running()
|
|||||||
# exit 1
|
# exit 1
|
||||||
#fi
|
#fi
|
||||||
|
|
||||||
|
# Move download file away so missing permissions won't stop usage.
|
||||||
|
CLEANUP_STATE=0
|
||||||
|
cleanup_dllist()
|
||||||
|
{
|
||||||
|
if [ -f "$DLLIST" ]
|
||||||
|
then
|
||||||
|
if ! mv -- "$DLLIST{,.old}" 2>/dev/null
|
||||||
|
then
|
||||||
|
if ! rm -fr -- "${LISTTEMP}" 2>/dev/null
|
||||||
|
then
|
||||||
|
msg "Could not clean up download list file." "warning"
|
||||||
|
msg "无法清除下载列表文件." "warning"
|
||||||
|
CLEANUP_STATE=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
cleanup_aptfast()
|
||||||
|
{
|
||||||
|
local last_exit_code=$?
|
||||||
|
[ "$CLEANUP_STATE" -eq 0 ] && CLEANUP_STATE=$last_exit_code
|
||||||
|
cleanup_dllist
|
||||||
|
_remove_lock
|
||||||
|
# 添加删除临时目录的逻辑
|
||||||
|
if [ -n "$LISTTEMP" ] && [ -d "$LISTTEMP" ]; then
|
||||||
|
rm -rf "$LISTTEMP"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
exit_cleanup_state()
|
||||||
|
{
|
||||||
|
cleanup_aptfast
|
||||||
|
exit $CLEANUP_STATE
|
||||||
|
}
|
||||||
|
|
||||||
LCK_FD=99
|
LCK_FD=99
|
||||||
# create the lock file and lock it, die on failure
|
# create the lock file and lock it, die on failure
|
||||||
_create_lock()
|
_create_lock()
|
||||||
@@ -289,36 +324,6 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Move download file away so missing permissions won't stop usage.
|
|
||||||
CLEANUP_STATE=0
|
|
||||||
cleanup_dllist()
|
|
||||||
{
|
|
||||||
if [ -f "$DLLIST" ]
|
|
||||||
then
|
|
||||||
if ! mv -- "$DLLIST{,.old}" 2>/dev/null
|
|
||||||
then
|
|
||||||
if ! rm -fr -- "${LISTTEMP}" 2>/dev/null
|
|
||||||
then
|
|
||||||
msg "Could not clean up download list file." "warning"
|
|
||||||
msg "无法清除下载列表文件." "warning"
|
|
||||||
CLEANUP_STATE=1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
cleanup_aptfast()
|
|
||||||
{
|
|
||||||
local last_exit_code=$?
|
|
||||||
[ "$CLEANUP_STATE" -eq 0 ] && CLEANUP_STATE=$last_exit_code
|
|
||||||
cleanup_dllist
|
|
||||||
_remove_lock
|
|
||||||
}
|
|
||||||
|
|
||||||
exit_cleanup_state()
|
|
||||||
{
|
|
||||||
exit $CLEANUP_STATE
|
|
||||||
}
|
|
||||||
|
|
||||||
# decode url string
|
# decode url string
|
||||||
# translates %xx but must not convert '+' in spaces
|
# translates %xx but must not convert '+' in spaces
|
||||||
@@ -453,7 +458,17 @@ get_uris(){
|
|||||||
msg "Failed to create tmp dir" "warning"
|
msg "Failed to create tmp dir" "warning"
|
||||||
msg "无法创建临时目录" "warning"
|
msg "无法创建临时目录" "warning"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cleanup_tmpdir() {
|
||||||
|
if [ -n "$tmpdir" ] && [ -d "$tmpdir" ]; then
|
||||||
|
rm -rf "$tmpdir"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
trap cleanup_tmpdir EXIT
|
||||||
|
|
||||||
## --print-uris format is:
|
## --print-uris format is:
|
||||||
# 'fileurl' filename filesize checksum_hint:filechecksum
|
# 'fileurl' filename filesize checksum_hint:filechecksum
|
||||||
# 修改:process_package函数增加第二个参数表示当前线程的临时输出文件
|
# 修改:process_package函数增加第二个参数表示当前线程的临时输出文件
|
||||||
@@ -575,7 +590,6 @@ get_uris(){
|
|||||||
rm -f "$thread_file"
|
rm -f "$thread_file"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# 合并显示信息
|
# 合并显示信息
|
||||||
if [ -f "$tmpdir/display" ]; then
|
if [ -f "$tmpdir/display" ]; then
|
||||||
DOWNLOAD_DISPLAY+="\n$(cat "$tmpdir/display")"
|
DOWNLOAD_DISPLAY+="\n$(cat "$tmpdir/display")"
|
||||||
|
|||||||
40
tool/aptss
@@ -2,11 +2,19 @@
|
|||||||
|
|
||||||
SPARK_DOWNLOAD_SERVER_URL="https://d.spark-app.store/"
|
SPARK_DOWNLOAD_SERVER_URL="https://d.spark-app.store/"
|
||||||
SPARK_DOWNLOAD_SERVER_URL_NO_PROTOCOL="d.spark-app.store"
|
SPARK_DOWNLOAD_SERVER_URL_NO_PROTOCOL="d.spark-app.store"
|
||||||
|
|
||||||
|
if [[ "$IS_APM_ENV" = "" ]] ;then
|
||||||
|
UPSTREAM_CATOGARY="sparkstore"
|
||||||
|
else
|
||||||
|
UPSTREAM_CATOGARY="apm"
|
||||||
|
fi
|
||||||
|
|
||||||
source /opt/durapps/spark-store/bin/bashimport/transhell.amber
|
source /opt/durapps/spark-store/bin/bashimport/transhell.amber
|
||||||
source /opt/durapps/spark-store/bin/bashimport/log.amber
|
source /opt/durapps/spark-store/bin/bashimport/log.amber
|
||||||
load_transhell
|
load_transhell
|
||||||
|
|
||||||
case `arch` in
|
if [[ "$IS_APM_ENV" = "" ]] ;then
|
||||||
|
case $(arch) in
|
||||||
x86_64 | i686 | i386)
|
x86_64 | i686 | i386)
|
||||||
STORE_URL="store"
|
STORE_URL="store"
|
||||||
STORE_LIST_URL=""
|
STORE_LIST_URL=""
|
||||||
@@ -24,6 +32,28 @@ case `arch` in
|
|||||||
STORE_LIST_URL="-riscv64"
|
STORE_LIST_URL="-riscv64"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
else
|
||||||
|
case $(arch) in
|
||||||
|
x86_64 | i686 | i386)
|
||||||
|
STORE_URL="amd64-apm"
|
||||||
|
STORE_LIST_URL="-amd64"
|
||||||
|
;;
|
||||||
|
aarch64)
|
||||||
|
STORE_URL="arm64-apm"
|
||||||
|
STORE_LIST_URL="-arm64"
|
||||||
|
;;
|
||||||
|
loongarch64)
|
||||||
|
STORE_URL="loong64-apm"
|
||||||
|
STORE_LIST_URL="-loong64"
|
||||||
|
;;
|
||||||
|
riscv64)
|
||||||
|
STORE_URL="riscv64-apm"
|
||||||
|
STORE_LIST_URL="-riscv64"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
SS_APT_FAST="/opt/durapps/spark-store/bin/apt-fast/ss-apt-fast"
|
SS_APT_FAST="/opt/durapps/spark-store/bin/apt-fast/ss-apt-fast"
|
||||||
|
|
||||||
|
|
||||||
@@ -32,8 +62,8 @@ is_empty_dir(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function update_list(){
|
function update_list(){
|
||||||
curl --progress-bar -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "${SPARK_DOWNLOAD_SERVER_URL}/sparkstore${STORE_LIST_URL}.list"
|
curl --progress-bar -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/aptss.list "${SPARK_DOWNLOAD_SERVER_URL}/${UPSTREAM_CATOGARY}${STORE_LIST_URL}.list"
|
||||||
log.info "sparkstore${STORE_LIST_URL}.list update done"
|
log.info "${UPSTREAM_CATOGARY}${STORE_LIST_URL}.list update done"
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_conf(){
|
function update_conf(){
|
||||||
@@ -84,7 +114,7 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if [ "$1" = "install" ] || [ "$1" = "upgrade" ] || [ "$1" = "full-upgrade" ] || [ "$1" = "dist-upgrade" ]; then
|
if [ "$1" = "install" ] || [ "$1" = "upgrade" ] || [ "$1" = "full-upgrade" ] || [ "$1" = "reinstall" ] || [ "$1" = "dist-upgrade" ]; then
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -110,7 +140,7 @@ echo
|
|||||||
update_list
|
update_list
|
||||||
update_conf
|
update_conf
|
||||||
|
|
||||||
/usr/bin/apt update -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" -o Dir::Etc::sourcelist="/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list"
|
/usr/bin/apt update -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" -o Dir::Etc::sourcelist="/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/aptss.list"
|
||||||
|
|
||||||
#只更新星火源
|
#只更新星火源
|
||||||
|
|
||||||
|
|||||||
43
tool/ssaudit
@@ -59,14 +59,48 @@ FORCE_CREATE_DESKTOP="0"
|
|||||||
load_transhell_debug
|
load_transhell_debug
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
# 根据架构设置仓库URL
|
# 根据架构设置仓库URL
|
||||||
|
if [[ "$IS_APM_ENV" = "" ]] ;then
|
||||||
case $(arch) in
|
case $(arch) in
|
||||||
x86_64) STORE_URL="store" ;;
|
x86_64 | i686 | i386)
|
||||||
aarch64) STORE_URL="aarch64-store" ;;
|
STORE_URL="store"
|
||||||
loongarch64) STORE_URL="loong64-store" ;;
|
STORE_LIST_URL=""
|
||||||
|
;;
|
||||||
|
aarch64)
|
||||||
|
STORE_URL="aarch64-store"
|
||||||
|
STORE_LIST_URL="-aarch64"
|
||||||
|
;;
|
||||||
|
loongarch64)
|
||||||
|
STORE_URL="loong64-store"
|
||||||
|
STORE_LIST_URL="-loong64"
|
||||||
|
;;
|
||||||
|
riscv64)
|
||||||
|
STORE_URL="riscv64-store"
|
||||||
|
STORE_LIST_URL="-riscv64"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
else
|
||||||
|
case $(arch) in
|
||||||
|
x86_64 | i686 | i386)
|
||||||
|
STORE_URL="amd64-apm"
|
||||||
|
STORE_LIST_URL=""
|
||||||
|
;;
|
||||||
|
aarch64)
|
||||||
|
STORE_URL="aarch64-apm"
|
||||||
|
STORE_LIST_URL="-aarch64"
|
||||||
|
;;
|
||||||
|
loongarch64)
|
||||||
|
STORE_URL="loong64-apm"
|
||||||
|
STORE_LIST_URL="-loong64"
|
||||||
|
;;
|
||||||
|
riscv64)
|
||||||
|
STORE_URL="riscv64-apm"
|
||||||
|
STORE_LIST_URL="-riscv64"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
# 帮助函数
|
# 帮助函数
|
||||||
function show_help() {
|
function show_help() {
|
||||||
echo "Spark Store Anstall script. 星火商店审核脚本"
|
echo "Spark Store Audit script. 星火商店审核脚本"
|
||||||
echo "用法: $0 [选项] <deb路径>"
|
echo "用法: $0 [选项] <deb路径>"
|
||||||
echo "选项:"
|
echo "选项:"
|
||||||
echo " -h, --help 显示帮助信息"
|
echo " -h, --help 显示帮助信息"
|
||||||
@@ -178,6 +212,7 @@ function hash_check() {
|
|||||||
# 确保aptss存在
|
# 确保aptss存在
|
||||||
function ensure_aptss_exist() {
|
function ensure_aptss_exist() {
|
||||||
if ! command -v aptss &>/dev/null; then
|
if ! command -v aptss &>/dev/null; then
|
||||||
|
apt update
|
||||||
local deb_file="/tmp/spark-store-console-in-container_latest_all.deb"
|
local deb_file="/tmp/spark-store-console-in-container_latest_all.deb"
|
||||||
|
|
||||||
if ! wget -O "$deb_file" "https://amber-ce-resource.spark-app.store/store/depends/spark-store-console-in-container_latest_all.deb"; then
|
if ! wget -O "$deb_file" "https://amber-ce-resource.spark-app.store/store/depends/spark-store-console-in-container_latest_all.deb"; then
|
||||||
|
|||||||
@@ -59,11 +59,45 @@ FORCE_CREATE_DESKTOP="0"
|
|||||||
load_transhell_debug
|
load_transhell_debug
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
# 根据架构设置仓库URL
|
# 根据架构设置仓库URL
|
||||||
|
if [[ "$IS_APM_ENV" = "" ]] ;then
|
||||||
case $(arch) in
|
case $(arch) in
|
||||||
x86_64) STORE_URL="store" ;;
|
x86_64 | i686 | i386)
|
||||||
aarch64) STORE_URL="aarch64-store" ;;
|
STORE_URL="store"
|
||||||
loongarch64) STORE_URL="loong64-store" ;;
|
STORE_LIST_URL=""
|
||||||
|
;;
|
||||||
|
aarch64)
|
||||||
|
STORE_URL="aarch64-store"
|
||||||
|
STORE_LIST_URL="-aarch64"
|
||||||
|
;;
|
||||||
|
loongarch64)
|
||||||
|
STORE_URL="loong64-store"
|
||||||
|
STORE_LIST_URL="-loong64"
|
||||||
|
;;
|
||||||
|
riscv64)
|
||||||
|
STORE_URL="riscv64-store"
|
||||||
|
STORE_LIST_URL="-riscv64"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
else
|
||||||
|
case $(arch) in
|
||||||
|
x86_64 | i686 | i386)
|
||||||
|
STORE_URL="amd64-apm"
|
||||||
|
STORE_LIST_URL=""
|
||||||
|
;;
|
||||||
|
aarch64)
|
||||||
|
STORE_URL="aarch64-apm"
|
||||||
|
STORE_LIST_URL="-aarch64"
|
||||||
|
;;
|
||||||
|
loongarch64)
|
||||||
|
STORE_URL="loong64-apm"
|
||||||
|
STORE_LIST_URL="-loong64"
|
||||||
|
;;
|
||||||
|
riscv64)
|
||||||
|
STORE_URL="riscv64-apm"
|
||||||
|
STORE_LIST_URL="-riscv64"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
# 帮助函数
|
# 帮助函数
|
||||||
function show_help() {
|
function show_help() {
|
||||||
echo "Spark Store Install script. 星火商店安装脚本"
|
echo "Spark Store Install script. 星火商店安装脚本"
|
||||||
@@ -178,6 +212,7 @@ function hash_check() {
|
|||||||
# 确保aptss存在
|
# 确保aptss存在
|
||||||
function ensure_aptss_exist() {
|
function ensure_aptss_exist() {
|
||||||
if ! command -v aptss &>/dev/null; then
|
if ! command -v aptss &>/dev/null; then
|
||||||
|
apt update
|
||||||
local deb_file="/tmp/spark-store-console-in-container_latest_all.deb"
|
local deb_file="/tmp/spark-store-console-in-container_latest_all.deb"
|
||||||
|
|
||||||
if ! wget -O "$deb_file" "https://amber-ce-resource.spark-app.store/store/depends/spark-store-console-in-container_latest_all.deb"; then
|
if ! wget -O "$deb_file" "https://amber-ce-resource.spark-app.store/store/depends/spark-store-console-in-container_latest_all.deb"; then
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
#!/bin/bash
|
|
||||||
# We use sudo twice to avoid ACE bug here
|
|
||||||
# https://gitee.com/amber-ce/amber-ce-bookworm/commit/43e1a1599ede474b37e41aa10c53fd8afc4d35a1
|
|
||||||
|
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# We use sudo twice to avoid ACE bug here
|
# We use sudo twice to avoid ACE bug here
|
||||||
@@ -14,6 +11,12 @@ function zenity_prompt() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [ "${IS_ACE_ENV}" = "" ]; then
|
||||||
|
echo "检测为非ACE环境,直接提权"
|
||||||
|
pkexec "$@"
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
|
||||||
# 检查sudo是否需要密码
|
# 检查sudo是否需要密码
|
||||||
if sudo -n true 2>/dev/null; then
|
if sudo -n true 2>/dev/null; then
|
||||||
echo "sudo 无需密码,继续执行"
|
echo "sudo 无需密码,继续执行"
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ fi
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
upgradable-list)
|
upgradable-list)
|
||||||
output=$(env LANGUAGE=en_US /usr/bin/apt -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf list --upgradable -o Dir::Etc::sourcelist="/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="/dev/null" -o APT::Get::List-Cleanup="0" | awk NR\>1)
|
output=$(env LANGUAGE=en_US /usr/bin/apt -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf list --upgradable -o Dir::Etc::sourcelist="/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/aptss.list" -o Dir::Etc::sourceparts="/dev/null" -o APT::Get::List-Cleanup="0" | awk NR\>1)
|
||||||
|
|
||||||
IFS_OLD="$IFS"
|
IFS_OLD="$IFS"
|
||||||
IFS=$'\n'
|
IFS=$'\n'
|
||||||
|
|||||||
@@ -74,12 +74,24 @@ until ! echo $updatetext | grep -q "E:"; do
|
|||||||
retry_count=$((retry_count + 1))
|
retry_count=$((retry_count + 1))
|
||||||
done
|
done
|
||||||
|
|
||||||
update_app_number=$(env LANGUAGE=en_US /usr/bin/apt -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf list --upgradable -o Dir::Etc::sourcelist="/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="/dev/null" -o APT::Get::List-Cleanup="0" 2>/dev/null | grep -c upgradable)
|
update_app_number=$(env LANGUAGE=en_US /usr/bin/apt -c /opt/durapps/spark-store/bin/apt-fast-conf/aptss-apt.conf list --upgradable -o Dir::Etc::sourcelist="/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/aptss.list" -o Dir::Etc::sourceparts="/dev/null" -o APT::Get::List-Cleanup="0" 2>/dev/null | grep -c upgradable)
|
||||||
|
|
||||||
if [ "$update_app_number" -le 0 ]; then
|
if [ "$update_app_number" -le 0 ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# 读取忽略列表到数组
|
||||||
|
declare -A ignored_apps
|
||||||
|
if [ -f "/etc/spark-store/ignored_apps.conf" ]; then
|
||||||
|
while IFS='|' read -r pkg_name pkg_version || [ -n "$pkg_name" ]; do
|
||||||
|
# 去除前后空白字符
|
||||||
|
pkg_name=$(echo "$pkg_name" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
||||||
|
if [ -n "$pkg_name" ]; then
|
||||||
|
ignored_apps["$pkg_name"]=1
|
||||||
|
fi
|
||||||
|
done < "/etc/spark-store/ignored_apps.conf"
|
||||||
|
fi
|
||||||
|
|
||||||
# 获取用户选择的要更新的应用
|
# 获取用户选择的要更新的应用
|
||||||
PKG_LIST="$(/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh upgradable-list)"
|
PKG_LIST="$(/opt/durapps/spark-store/bin/update-upgrade/ss-do-upgrade-worker.sh upgradable-list)"
|
||||||
# 指定分隔符为 \n
|
# 指定分隔符为 \n
|
||||||
@@ -102,6 +114,13 @@ for line in $PKG_LIST; do
|
|||||||
PKG_STA=$(dpkg-query -W -f='${db:Status-Want}' $PKG_NAME)
|
PKG_STA=$(dpkg-query -W -f='${db:Status-Want}' $PKG_NAME)
|
||||||
if [ "$PKG_STA" = "hold" ]; then
|
if [ "$PKG_STA" = "hold" ]; then
|
||||||
let update_app_number=$update_app_number-1
|
let update_app_number=$update_app_number-1
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 检测是否在忽略列表中
|
||||||
|
if [ -n "${ignored_apps[$PKG_NAME]}" ]; then
|
||||||
|
let update_app_number=$update_app_number-1
|
||||||
|
continue
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
TRANSHELL_CONTENT_UPDATE_CHEKING_PLEASE_WAIT="Checking for update, please wait..."
|
TRANSHELL_CONTENT_UPDATE_CHEKING_PLEASE_WAIT="Checking for updates, please wait..."
|
||||||
TRANSHELL_CONTENT_SPARK_STORE_UPGRADE_MODEL="Spark Store APP Upgrade module"
|
TRANSHELL_CONTENT_SPARK_STORE_UPGRADE_MODEL="Spark Store Update Module"
|
||||||
TRANSHELL_CONTENT_CHECK_UPDATE_PROCESS_ERROR_PRESS_CONFIRM_TO_CHECK="Error occured in checking for update! Press Confirm to get the error log (Can be useful when feedback)"
|
TRANSHELL_CONTENT_CHECK_UPDATE_PROCESS_ERROR_PRESS_CONFIRM_TO_CHECK="An error occurred during the update check process. Click Confirm to view the error log, which can be used for issue reporting."
|
||||||
TRANSHELL_CONTENT_I_ALREDY_COPIED_THE_LOG_HERE_AND_WILL_USE_IT_TO_FEEDBACK="I already copied the log in the text box and I will attach it when feeding back. You can find feedback entry in the settings which is located in the top right of the store."
|
TRANSHELL_CONTENT_I_ALREDY_COPIED_THE_LOG_HERE_AND_WILL_USE_IT_TO_FEEDBACK="I have copied the log in this text box and will attach it when submitting feedback. The feedback option can be found in the Settings menu at the top-right corner of the main interface."
|
||||||
TRANSHELL_CONTENT_FEEDBACK_CAN_BE_FOUND_IN_THE_SETTINGS="Feedback entry in the settings which is located in the top right of the store"
|
TRANSHELL_CONTENT_FEEDBACK_CAN_BE_FOUND_IN_THE_SETTINGS="The feedback option can be found in the Settings menu at the top-right corner of the main interface."
|
||||||
TRANSHELL_CONTENT_NO_NEED_TO_UPGRADE="All APPs are up to date."
|
TRANSHELL_CONTENT_NO_NEED_TO_UPGRADE="All packages are already up to date."
|
||||||
TRANSHELL_CONTENT_CAN_NOT_UPGRADE_FOR_BEING_HOLD="(Unable to upgrade: Being marked as hold)"
|
TRANSHELL_CONTENT_CAN_NOT_UPGRADE_FOR_BEING_HOLD="Unable to update: the current package status is marked as Hold."
|
||||||
TRANSHELL_CONTENT_CHOOSE_APP_TO_UPGRADE="Choose the app you want to upgrade"
|
TRANSHELL_CONTENT_CHOOSE_APP_TO_UPGRADE="Please select the application you want to update."
|
||||||
TRANSHELL_CONTENT_CHOOSE="Choose"
|
TRANSHELL_CONTENT_CHOOSE="Select"
|
||||||
TRANSHELL_CONTENT_APP_NAME="APP name"
|
TRANSHELL_CONTENT_APP_NAME="Application Name"
|
||||||
TRANSHELL_CONTENT_PKG_NAME="Package Name"
|
TRANSHELL_CONTENT_PKG_NAME="Package Name"
|
||||||
TRANSHELL_CONTENT_NEW_VERSION="New version"
|
TRANSHELL_CONTENT_NEW_VERSION="New Version"
|
||||||
TRANSHELL_CONTENT_UPGRADE_FROM="Upgrade from"
|
TRANSHELL_CONTENT_UPGRADE_FROM="Updating from this version"
|
||||||
TRANSHELL_CONTENT_NO_APP_IS_CHOSEN="No app is chosen"
|
TRANSHELL_CONTENT_NO_APP_IS_CHOSEN="You have not selected any application."
|
||||||
TRANSHELL_CONTENT_UPGRADING_PLEASE_WAIT="Upgrading $APP_UPGRADE , please wait..."
|
TRANSHELL_CONTENT_UPGRADING_PLEASE_WAIT="Updating $APP_UPGRADE, please wait..."
|
||||||
TRANSHELL_CONTENT_CHOSEN_APP_UPGRADE_FINISHED="The chosen app is upgraded"
|
TRANSHELL_CONTENT_CHOSEN_APP_UPGRADE_FINISHED="The selected application has been successfully updated."
|
||||||
TRANSHELL_CONTENT_APP_UGRADE_PROCESS_ERROR_PRESS_CONFIRM_TO_CHECK="Error occured when upgrading! Press Confirm to get the error log (Can be useful when feedback)"
|
TRANSHELL_CONTENT_APP_UGRADE_PROCESS_ERROR_PRESS_CONFIRM_TO_CHECK="An error occurred during the update process. Click Confirm to view the error log, which can be used for issue reporting."
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
TRANSHELL_CONTENT_UPDATE_CHEKING_PLEASE_WAIT="正在检查更新,请稍候..."
|
TRANSHELL_CONTENT_UPDATE_CHEKING_PLEASE_WAIT="正在检查更新,请稍候……"
|
||||||
TRANSHELL_CONTENT_SPARK_STORE_UPGRADE_MODEL="星火商店更新模块"
|
TRANSHELL_CONTENT_SPARK_STORE_UPGRADE_MODEL="星火应用商店更新模块"
|
||||||
TRANSHELL_CONTENT_CHECK_UPDATE_PROCESS_ERROR_PRESS_CONFIRM_TO_CHECK="检查更新进程出现错误!按确定查看报错,可用于反馈"
|
TRANSHELL_CONTENT_CHECK_UPDATE_PROCESS_ERROR_PRESS_CONFIRM_TO_CHECK="检查更新进程出现错误。单击“确定”查看错误日志,可用于问题反馈。"
|
||||||
TRANSHELL_CONTENT_I_ALREDY_COPIED_THE_LOG_HERE_AND_WILL_USE_IT_TO_FEEDBACK="我已复制了此文本框中的日志,且将会在反馈时附上。反馈渠道可以在右上角菜单的设置中找到"
|
TRANSHELL_CONTENT_I_ALREDY_COPIED_THE_LOG_HERE_AND_WILL_USE_IT_TO_FEEDBACK="我已复制且将会在反馈时附上此文本框中的日志,反馈渠道位于软件主界面右上角菜单的设置中。"
|
||||||
TRANSHELL_CONTENT_FEEDBACK_CAN_BE_FOUND_IN_THE_SETTINGS="反馈渠道在商店右上角的设置里"
|
TRANSHELL_CONTENT_FEEDBACK_CAN_BE_FOUND_IN_THE_SETTINGS="反馈渠道位于软件主界面右上角菜单的设置中。"
|
||||||
TRANSHELL_CONTENT_NO_NEED_TO_UPGRADE="没有软件需要更新"
|
TRANSHELL_CONTENT_NO_NEED_TO_UPGRADE="所有软件包版本已是最新。"
|
||||||
TRANSHELL_CONTENT_CAN_NOT_UPGRADE_FOR_BEING_HOLD="(无法更新:已被标记为保留)"
|
TRANSHELL_CONTENT_CAN_NOT_UPGRADE_FOR_BEING_HOLD="无法更新:当前软件包状态已被标记为“保留”。"
|
||||||
TRANSHELL_CONTENT_CHOOSE_APP_TO_UPGRADE="选择你想更新的应用"
|
TRANSHELL_CONTENT_CHOOSE_APP_TO_UPGRADE="请选择您需要更新的软件。"
|
||||||
TRANSHELL_CONTENT_CHOOSE="选择"
|
TRANSHELL_CONTENT_CHOOSE="选择"
|
||||||
TRANSHELL_CONTENT_APP_NAME="应用名"
|
TRANSHELL_CONTENT_APP_NAME="应用名"
|
||||||
TRANSHELL_CONTENT_PKG_NAME="包名"
|
TRANSHELL_CONTENT_PKG_NAME="软件包名"
|
||||||
TRANSHELL_CONTENT_NEW_VERSION="新版本"
|
TRANSHELL_CONTENT_NEW_VERSION="新版本"
|
||||||
TRANSHELL_CONTENT_UPGRADE_FROM="从该版本更新"
|
TRANSHELL_CONTENT_UPGRADE_FROM="将从该版本更新"
|
||||||
TRANSHELL_CONTENT_NO_APP_IS_CHOSEN="没有选中任何软件"
|
TRANSHELL_CONTENT_NO_APP_IS_CHOSEN="您没有选中任何软件。"
|
||||||
TRANSHELL_CONTENT_UPGRADING_PLEASE_WAIT="正在更新 $APP_UPGRADE ,请稍候..."
|
TRANSHELL_CONTENT_UPGRADING_PLEASE_WAIT="正在更新 $APP_UPGRADE,请稍候……"
|
||||||
TRANSHELL_CONTENT_CHOSEN_APP_UPGRADE_FINISHED="选中的软件已经更新完毕"
|
TRANSHELL_CONTENT_CHOSEN_APP_UPGRADE_FINISHED="选中的软件已更新完毕。"
|
||||||
TRANSHELL_CONTENT_APP_UGRADE_PROCESS_ERROR_PRESS_CONFIRM_TO_CHECK="更新出现错误!按确定查看报错,可用于反馈"
|
TRANSHELL_CONTENT_APP_UGRADE_PROCESS_ERROR_PRESS_CONFIRM_TO_CHECK="更新进程出现错误。单击“确定”查看错误日志,可用于问题反馈。"
|
||||||
@@ -1,18 +1,18 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
TRANSHELL_CONTENT_UPDATE_CHEKING_PLEASE_WAIT="正在檢查更新,請稍候…"
|
TRANSHELL_CONTENT_UPDATE_CHEKING_PLEASE_WAIT="正在檢查更新,請稍候……"
|
||||||
TRANSHELL_CONTENT_SPARK_STORE_UPGRADE_MODEL="星火商店更新模塊"
|
TRANSHELL_CONTENT_SPARK_STORE_UPGRADE_MODEL="星火應用商店更新模組"
|
||||||
TRANSHELL_CONTENT_CHECK_UPDATE_PROCESS_ERROR_PRESS_CONFIRM_TO_CHECK="檢查更新行程出現錯誤! 按確定查看報錯,可用於回報"
|
TRANSHELL_CONTENT_CHECK_UPDATE_PROCESS_ERROR_PRESS_CONFIRM_TO_CHECK="檢查更新行程出現錯誤。點擊「確定」查看錯誤日誌,可用於問題回饋。"
|
||||||
TRANSHELL_CONTENT_I_ALREDY_COPIED_THE_LOG_HERE_AND_WILL_USE_IT_TO_FEEDBACK="我已複製了此文字方塊中的日誌,且將會在回報時附上。 迴響通路可以在右上角選單的設定中找到 "
|
TRANSHELL_CONTENT_I_ALREDY_COPIED_THE_LOG_HERE_AND_WILL_USE_IT_TO_FEEDBACK="我已複製且將會在回饋時附上此文字框中的日誌,回饋渠道位於軟體主介面右上角選單的設定中。"
|
||||||
TRANSHELL_CONTENT_FEEDBACK_CAN_BE_FOUND_IN_THE_SETTINGS="回報入口在商店右上角的設定裏"
|
TRANSHELL_CONTENT_FEEDBACK_CAN_BE_FOUND_IN_THE_SETTINGS="回饋渠道位於軟體主介面右上角選單的設定中。"
|
||||||
TRANSHELL_CONTENT_NO_NEED_TO_UPGRADE="沒有軟體需要更新"
|
TRANSHELL_CONTENT_NO_NEED_TO_UPGRADE="所有軟體包版本已是最新。"
|
||||||
TRANSHELL_CONTENT_CAN_NOT_UPGRADE_FOR_BEING_HOLD="(无法更新:已被标记为保留)"
|
TRANSHELL_CONTENT_CAN_NOT_UPGRADE_FOR_BEING_HOLD="無法更新:當前軟體包狀態已被標記為「保留」。"
|
||||||
TRANSHELL_CONTENT_CHOOSE_APP_TO_UPGRADE="选择你想更新的应用"
|
TRANSHELL_CONTENT_CHOOSE_APP_TO_UPGRADE="請選擇您需要更新的軟體。"
|
||||||
TRANSHELL_CONTENT_CHOOSE="选择"
|
TRANSHELL_CONTENT_CHOOSE="選擇"
|
||||||
TRANSHELL_CONTENT_APP_NAME="应用名"
|
TRANSHELL_CONTENT_APP_NAME="應用名稱"
|
||||||
TRANSHELL_CONTENT_PKG_NAME="包名"
|
TRANSHELL_CONTENT_PKG_NAME="軟體包名稱"
|
||||||
TRANSHELL_CONTENT_NEW_VERSION="新版本"
|
TRANSHELL_CONTENT_NEW_VERSION="新版本"
|
||||||
TRANSHELL_CONTENT_UPGRADE_FROM="从该版本更新"
|
TRANSHELL_CONTENT_UPGRADE_FROM="將從該版本更新"
|
||||||
TRANSHELL_CONTENT_NO_APP_IS_CHOSEN="没有选中任何軟體"
|
TRANSHELL_CONTENT_NO_APP_IS_CHOSEN="您沒有選中任何軟體。"
|
||||||
TRANSHELL_CONTENT_UPGRADING_PLEASE_WAIT="正在更新 $APP_UPGRADE ,请稍候..."
|
TRANSHELL_CONTENT_UPGRADING_PLEASE_WAIT="正在更新 $APP_UPGRADE,請稍候……"
|
||||||
TRANSHELL_CONTENT_CHOSEN_APP_UPGRADE_FINISHED="选中的軟體已经更新完毕"
|
TRANSHELL_CONTENT_CHOSEN_APP_UPGRADE_FINISHED="選中的軟體已更新完畢。"
|
||||||
TRANSHELL_CONTENT_APP_UGRADE_PROCESS_ERROR_PRESS_CONFIRM_TO_CHECK="更新出现错误!按确定查看报错,可用于反馈"
|
TRANSHELL_CONTENT_APP_UGRADE_PROCESS_ERROR_PRESS_CONFIRM_TO_CHECK="更新行程出現錯誤。點擊「確定」查看錯誤日誌,可用於問題回饋。"
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
TRANSHELL_CONTENT_CLOSE="Disable"
|
TRANSHELL_CONTENT_CLOSE="Disable"
|
||||||
TRANSHELL_CONTENT_OPEN="Enable"
|
TRANSHELL_CONTENT_OPEN="Enable"
|
||||||
TRANSHELL_CONTENT_WELCOME_AND_CHOOSE_ONE_TO_RUN="Welcome to Spark Store APP Upgrade Settings\nPlease choose one option to run"
|
TRANSHELL_CONTENT_WELCOME_AND_CHOOSE_ONE_TO_RUN="Welcome to the Spark App Store update and installation settings tool. Please choose one of the following options to continue."
|
||||||
TRANSHELL_CONTENT_OPTIONS="Options"
|
TRANSHELL_CONTENT_OPTIONS="Options"
|
||||||
TRANSHELL_CONTENT_OPEN_OR_CLOSE_UPGRADE_CHECK="$text_update_open Spark Store APP upgrade check. (Will notify APP upgrade at start up if opened.)"
|
TRANSHELL_CONTENT_OPEN_OR_CLOSE_UPGRADE_CHECK="$text_update_open Spark Store Update Check Tool (When enabled, this tool will automatically check for updates after system startup and display a notification if updates are available)"
|
||||||
TRANSHELL_CONTENT_CHECK_FOR_UPDATE="Check Upgradable app list."
|
TRANSHELL_CONTENT_CHECK_FOR_UPDATE="View the list of upgradable packages"
|
||||||
TRANSHELL_CONTENT_EXIT="Exit"
|
TRANSHELL_CONTENT_EXIT="Exit"
|
||||||
TRANSHELL_CONTENT_CLOSING_UPGRADE_CHECK="Please authorize to close APP upgrade check"
|
TRANSHELL_CONTENT_CLOSING_UPGRADE_CHECK="Please authorize to disable automatic update check."
|
||||||
TRANSHELL_CONTENT_CLOSED="Disabled"
|
TRANSHELL_CONTENT_CLOSED="Disabled"
|
||||||
TRANSHELL_CONTENT_OPENING_UPGRADE_CHECK="Please authorize to open APP upgrade check"
|
TRANSHELL_CONTENT_OPENING_UPGRADE_CHECK="Please authorize to enable automatic update check."
|
||||||
TRANSHELL_CONTENT_OPENED="Enabled"
|
TRANSHELL_CONTENT_OPENED="Enabled"
|
||||||
TRANSHELL_CONTENT_CLOSE_CREATE_DESKTOP="Disable auto create desktop shortcut"
|
TRANSHELL_CONTENT_CLOSE_CREATE_DESKTOP="Disable automatic creation of desktop launcher"
|
||||||
TRANSHELL_CONTENT_OPEN_CREATE_DESKTOP="Enable auto create desktop shortcut"
|
TRANSHELL_CONTENT_OPEN_CREATE_DESKTOP="Enable automatic creation of desktop launcher"
|
||||||