From 1fe6980a80e85b6dfc1a59b855003c88061748cb Mon Sep 17 00:00:00 2001
From: shenmo <jifengshenmo@outlook.com>
Date: Mon, 24 Jun 2024 09:51:23 +0000
Subject: [PATCH 01/11] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20pk?=
 =?UTF-8?q?g/etc/aptss/sources.list.d/sparkstore.list?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 pkg/etc/aptss/sources.list.d/sparkstore.list | 1 -
 1 file changed, 1 deletion(-)
 delete mode 100644 pkg/etc/aptss/sources.list.d/sparkstore.list

diff --git a/pkg/etc/aptss/sources.list.d/sparkstore.list b/pkg/etc/aptss/sources.list.d/sparkstore.list
deleted file mode 100644
index 0563772..0000000
--- a/pkg/etc/aptss/sources.list.d/sparkstore.list
+++ /dev/null
@@ -1 +0,0 @@
-deb [by-hash=force] https://d.store.deepinos.org.cn / 

From ddcac0cf18ae75c719c75929b3cb08977a63c679 Mon Sep 17 00:00:00 2001
From: shenmo <jifengshenmo@outlook.com>
Date: Tue, 25 Jun 2024 07:42:52 +0000
Subject: [PATCH 02/11] adjust:v23 does not this patch anymore

Signed-off-by: shenmo <jifengshenmo@outlook.com>
---
 tool/spark-dstore-patch | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tool/spark-dstore-patch b/tool/spark-dstore-patch
index e0292ab..b637ce5 100755
--- a/tool/spark-dstore-patch
+++ b/tool/spark-dstore-patch
@@ -121,8 +121,8 @@ if [ ! -e /usr/bin/deepin-app-store-tool ];then
 exec_uos_package_link
 
 fi
-exec_v23_icon_link
-exec_link_clean
+#exec_v23_icon_link
+#exec_link_clean
 wait
 exec_uos_package_update
 echo "----------------Finished----------------"

From 2ffd360df7ca8209846f482712ccb0b281150366 Mon Sep 17 00:00:00 2001
From: shenmo <jifengshenmo@outlook.com>
Date: Wed, 26 Jun 2024 15:27:58 +0800
Subject: [PATCH 03/11] adjust:remove link

---
 README.zh.md | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/README.zh.md b/README.zh.md
index b4a2d46..f7c046c 100644
--- a/README.zh.md
+++ b/README.zh.md
@@ -1,11 +1,7 @@
 #  星火应用商店
 [![star](https://gitee.com/spark-store-project/spark-store/badge/star.svg?theme=gvp)](https://gitee.com/spark-store-project/spark-store/stargazers)  [![fork](https://gitee.com/spark-store-project/spark-store/badge/fork.svg?theme=gvp)](https://gitee.com/spark-store-project/spark-store/members)
 
-https://gitee.com/spark-store-project/spark-store/
 
-https://gitcode.com/spark-store-project/spark-store/
-
-https://github.com/spark-store-project/spark-store/
 
 ## 简介
 
@@ -88,7 +84,7 @@ Linux 应用的数量相对有限,Wine 软件的可获得性也颇为困难。
     > appstore://deepin-home-appstore-client?app_detail_info/spark-store
 
 
-    若要使用最新版本,请访问[星火应用商店的Release页面](https://gitee.com/spark-store-project/spark-store/releases)或[从Gitcode下载](https://gitcode.com/spark-store-project/spark-store/releases)并下载适用于Deepin的最新版本。安装后即可使用。
+    若要使用最新版本,请访问[星火应用商店的Release页面](https://gitee.com/spark-store-project/spark-store/releases)并下载适用于Deepin的最新版本。安装后即可使用。
 
     假设您下载到用户目录下的 Downloads 文件夹, 我们推荐您使用 APT 工具安装:
 
@@ -109,7 +105,7 @@ Linux 应用的数量相对有限,Wine 软件的可获得性也颇为困难。
 
 2. **下载并安装**
 
-    请访问[星火应用商店的Release页面](https://gitee.com/spark-store-project/spark-store/releases)或[从Gitcode下载](https://gitcode.com/spark-store-project/spark-store/releases),下载和您电脑相同架构的安装包并安装。
+    请访问[星火应用商店的Release页面](https://gitee.com/spark-store-project/spark-store/releases),下载和您电脑相同架构的安装包并安装。
 
     假设您下载到用户目录下的 Downloads 文件夹, 我们推荐您使用 APT 工具安装:
 
@@ -124,7 +120,7 @@ Linux 应用的数量相对有限,Wine 软件的可获得性也颇为困难。
 
 2. **下载并安装**
 
-    请访问[星火应用商店的Release页面](https://gitee.com/spark-store-project/spark-store/releases)或[从Gitcode下载](https://gitcode.com/spark-store-project/spark-store/releases),下载和您电脑相同架构的安装包并安装。
+    请访问[星火应用商店的Release页面](https://gitee.com/spark-store-project/spark-store/releases),下载和您电脑相同架构的安装包并安装。
 
     假设您下载到用户目录下的 Downloads 文件夹, 我们推荐您使用 APT 工具安装:
 
@@ -144,7 +140,7 @@ Linux 应用的数量相对有限,Wine 软件的可获得性也颇为困难。
 
 2. **下载并安装**
 
-    请访问[星火应用商店的Release页面](https://gitee.com/spark-store-project/spark-store/releases)或[从Gitcode下载](https://gitcode.com/spark-store-project/spark-store/releases)并下载,安装后即可使用。
+    请访问[星火应用商店的Release页面](https://gitee.com/spark-store-project/spark-store/releases)并下载,安装后即可使用。
 
 
 #### 对于 Debian 12+ 用户

From a92c22f2055e00db7cce78300ea5ed84be1c4f14 Mon Sep 17 00:00:00 2001
From: shenmo <jifengshenmo@outlook.com>
Date: Fri, 5 Jul 2024 11:10:26 +0000
Subject: [PATCH 04/11] fix: broken link fix

Signed-off-by: shenmo <jifengshenmo@outlook.com>
---
 README.zh.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.zh.md b/README.zh.md
index f7c046c..a46c283 100644
--- a/README.zh.md
+++ b/README.zh.md
@@ -32,7 +32,7 @@ Linux 应用的数量相对有限,Wine 软件的可获得性也颇为困难。
 
 您可以通过以下链接,实时跟踪我们的Issue处理状态:[Gitee Issue看板](https://gitee.com/spark-store-project/spark-store/board)。
 
-若您有软件包想要提交,敬请 [点击此处进行投稿](https://spark-store-project.gitee.io/spark-wiki/#/Submit/Submit)。
+若您有软件包想要提交,敬请 [点击此处进行投稿](https://wiki.spark-app.store/#/Submit/Submit)。
 
 
 

From c5e2ea040d9de74ef0bc6d43573daa4f84fc20fc Mon Sep 17 00:00:00 2001
From: shenmo <jifengshenmo@outlook.com>
Date: Tue, 16 Jul 2024 06:34:20 +0000
Subject: [PATCH 05/11] Adjust: Lock the deb file before the install begin to
 secure

Signed-off-by: shenmo <jifengshenmo@outlook.com>
---
 tool/ssinstall | 35 +++++++++++++++++++++++++++++------
 1 file changed, 29 insertions(+), 6 deletions(-)

diff --git a/tool/ssinstall b/tool/ssinstall
index 35f6b24..558bc64 100755
--- a/tool/ssinstall
+++ b/tool/ssinstall
@@ -83,7 +83,13 @@ function hash_check() {
     IS_SHA512SUM_CHECKED=$(cat "$PACKAGES_DATA_PATH" | grep "$DEB_SHA512SUM")
 }
 
+function lock_file(){
+chattr +i "$1"
+}
 
+function unlock_file(){
+chattr -i "$1"
+}
 
 ####################################
 
@@ -94,11 +100,7 @@ if [ $# -eq 0 ]; then
     exit
 fi
 
-if [ ! -f "$1" ]; then
-    echo "${TRANSHELL_CONTENT_FILE_NOT_EXIST}"
-    echo "OMG-IT-GOES-WRONG"
-    exit 1
-fi
+
 
 if [ "$(id -u)" != "0" ]; then
     echo "${TRANSHELL_CONTENT_PLEASE_RUN_AS_ROOT}"
@@ -106,7 +108,26 @@ if [ "$(id -u)" != "0" ]; then
     exit 1
 fi
 
-DEBPATH=$(realpath "$1")
+if [ ! -f "$1" ]; then
+    echo "${TRANSHELL_CONTENT_FILE_NOT_EXIST},Trying to redownload"
+    FILEPATH=$(dirname "$1")
+    FILENAME=$(basename "$1")
+    PACKAGE_NAME=$(echo "$FILENAME" | sed -r 's/^([^_]+)_.*$/\1/')
+    VERSION=$(echo "$FILENAME" | sed -r 's/^[^_]+_([^_]+)_.*$/\1/')
+    pushd ${FILEPATH}
+    aptss download ${PACKAGE_NAME}=${VERSION}
+    popd
+    if [ ! -f "$1" ]; then
+    	echo "OMG-IT-GOES-WRONG"
+    	exit 1
+    else
+    	DEBPATH=$(realpath "$1")
+    fi
+    else
+    DEBPATH=$(realpath "$1")
+fi
+
+lock_file "$DEBPATH"
 
 hash_check "$DEBPATH"
 
@@ -144,6 +165,8 @@ if [ ! -z "$IS_SHA512SUM_CHECKED" ]; then
 
     dpkg -i "$DEBPATH" || aptss install -yf
 
+unlock_file "$DEBPATH"
+
     if [ "$?" = "0" ] && [ "$2" = "--delete-after-install" ]; then
         if dpkg -s "$package_name" >/dev/null 2>&1; then
             echo "软件包已安装:$package_name"

From d03b0474928c175f85761eaa3d2fdd59ff456edc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?AAA=20Elysia=20=E7=8C=AB=E7=8C=AB=E4=BE=A0=20=E2=81=A7=7E?=
 =?UTF-8?q?=E5=96=B5?= <c.elysia@foxmail.com>
Date: Tue, 16 Jul 2024 09:36:15 +0000
Subject: [PATCH 06/11] =?UTF-8?q?!276=20=E4=BF=AE=E5=A4=8D=EF=BC=9ADebian?=
 =?UTF-8?q?=2013=E4=B8=8A=E7=9A=84=E4=BE=9D=E8=B5=96=E9=97=AE=E9=A2=98=20M?=
 =?UTF-8?q?erge=20pull=20request=20!276=20from=20AAA=20Elysia=20=E7=8C=AB?=
 =?UTF-8?q?=E7=8C=AB=E4=BE=A0=20=E2=81=A7~=E5=96=B5/dev?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 debian/control | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/control b/debian/control
index 3c3d1e6..1d3b2ae 100644
--- a/debian/control
+++ b/debian/control
@@ -44,7 +44,7 @@ Depends:${shlibs:Depends}, ${misc:Depends},
  aria2,
  gnupg,
  zenity,
- policykit-1,
+ policykit-1 | pkexec,
  libnotify-bin,
  desktop-file-utils,
  dpkg-dev

From fa488c0a9d1104ef9edfe58e01bb998e1bec460c Mon Sep 17 00:00:00 2001
From: zty199 <46324746+zty199@users.noreply.github.com>
Date: Tue, 13 Aug 2024 14:16:37 +0800
Subject: [PATCH 07/11] chore: delete unused dependencies in debian/control

delete unused dependencies in debian/control

Log: delete unused dependencies in debian/control
---
 debian/control          | 32 +++++++-------------------------
 spark-store-project.pro |  3 +--
 2 files changed, 8 insertions(+), 27 deletions(-)

diff --git a/debian/control b/debian/control
index 1d3b2ae..f6d24c5 100644
--- a/debian/control
+++ b/debian/control
@@ -7,40 +7,22 @@ Build-Depends:
  pkg-config,
  qtchooser (>= 55-gc9562a1-1~) | qt5-default,
  qtbase5-dev,
- libqt5core5a,
- libqt5gui5,
- libqt5widgets5,
- libqt5network5,
- libqt5concurrent5,
- libdtkcore-dev(>=5.0),
- libdtkgui-dev(>=5.0),
- libdtkwidget-dev(>=5.0),
  libqt5svg5-dev,
- qttools5-private-dev,
+ qttools5-dev-tools,
  qtwebengine5-dev,
- qtwayland5,
- qtwayland5-dev-tools,
- gcc,
- g++
-Standards-Version: 4.0.0
+ libdtkcore-dev (>= 5.0),
+ libdtkgui-dev (>= 5.0),
+ libdtkwidget-dev (>= 5.0)
+Standards-Version: 4.1.7
 Homepage: https://www.spark-app.store/
 
 Package: spark-store
 Architecture: any
 Provides: spark-store-console-in-container
-Depends:${shlibs:Depends}, ${misc:Depends},
- libqt5core5a,
- libqt5gui5,
- libqt5widgets5,
- libqt5network5,
- libqt5concurrent5,
- qtwayland5,
- libdtkcore5,
- libdtkgui5,
- libdtkwidget5,
+Depends: ${shlibs:Depends}, ${misc:Depends},
+ dde-qt5integration,
  curl,
  openssl,
- dde-qt5integration,
  aria2,
  gnupg,
  zenity,
diff --git a/spark-store-project.pro b/spark-store-project.pro
index 8cd67ff..c1fac77 100644
--- a/spark-store-project.pro
+++ b/spark-store-project.pro
@@ -7,8 +7,7 @@
 TARGET = spark-store
 TEMPLATE = subdirs
 
-#CONFIG += ordered
-CONFIG += wayland-compositor
+CONFIG += ordered
 
 SUBDIRS += \
         src/spark-store.pro

From 92fa8e552dc7219185ef35d6c2bbbf2531c25dde Mon Sep 17 00:00:00 2001
From: zty199 <46324746+zty199@users.noreply.github.com>
Date: Tue, 13 Aug 2024 15:13:47 +0800
Subject: [PATCH 08/11] feat: #IAJDMD restore window size when last closed on
 startup

record window size in ~MainWindow() to config.ini; in MainWindow::initUI restore window size

Log: restore window size when last closed on startup
---
 src/main.cpp           |  3 ---
 src/mainwindow-dtk.cpp | 16 ++++++++++++++++
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/src/main.cpp b/src/main.cpp
index b40cfe8..32f686e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -13,7 +13,6 @@
 
 #include <DSysInfo>
 #include <DApplicationSettings>
-#include <DWidgetUtil>
 
 #include <QDate>
 #include <QProcessEnvironment>
@@ -196,8 +195,6 @@ int main(int argc, char *argv[])
 
     MainWindow w;
     a.setMainWindow(&w); // 设置应用程序主窗口,用于初始化关于对话框
-    // 让打开时界面显示在正中
-    Dtk::Widget::moveToCenter(&w);
 
     if (argc > 1)
     {
diff --git a/src/mainwindow-dtk.cpp b/src/mainwindow-dtk.cpp
index b278b1d..c5f328b 100755
--- a/src/mainwindow-dtk.cpp
+++ b/src/mainwindow-dtk.cpp
@@ -48,6 +48,11 @@ MainWindow::~MainWindow()
     delete ui;
 
     downloadlistwidget->deleteLater();
+
+    QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat);
+    config.setValue("window/width", width());
+    config.setValue("window/height", height());
+    config.sync();
 }
 
 void MainWindow::initDbus()
@@ -123,6 +128,17 @@ void MainWindow::closeEvent(QCloseEvent *event)
 
 void MainWindow::initUI()
 {
+    QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat);
+    QSize size;
+    size.rwidth() = config.value("window/width").toInt();
+    size.rheight() = config.value("window/height").toInt();
+    if (!size.isEmpty()) {
+        resize(size);
+    }
+
+    // 让打开时界面显示在正中
+    moveToCenter(this);
+
     setWindowTitle(QObject::tr("Spark Store"));
     setMaskAlpha(250);
 

From bc410f33d7f9a9a834ac7edb74130df319201c8b Mon Sep 17 00:00:00 2001
From: zty199 <46324746+zty199@users.noreply.github.com>
Date: Tue, 13 Aug 2024 23:39:05 +0800
Subject: [PATCH 09/11] fix: #IAEC2O developmode status judgment error in part
 of UOS 1060 iso

after entering developmode, /var/lib/deepin/developer-mode/enabled is not created or its content is not '1'

Log: remove developmode judgment temporarily
---
 src/mainwindow-dtk.cpp    | 8 ++++++--
 src/pages/appintopage.cpp | 8 ++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/mainwindow-dtk.cpp b/src/mainwindow-dtk.cpp
index c5f328b..1341d9d 100755
--- a/src/mainwindow-dtk.cpp
+++ b/src/mainwindow-dtk.cpp
@@ -511,9 +511,13 @@ void MainWindow::notify(QObject *receiver, QEvent *event)
 
 void MainWindow::on_pushButton_14_clicked()
 {
+    /**
+     * NOTE: No need to judget developmode status
+     */
     // Check UOS
-    QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat);
-    if (config.contains("UOS/EnableDeveloperMode") && !config.value("UOS/EnableDeveloperMode").toBool())
+    // QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat);
+    // if (config.contains("UOS/EnableDeveloperMode") && !config.value("UOS/EnableDeveloperMode").toBool())
+    if (false)
     {
         qDebug() << "UOS Developer Mode has not been enabled!";
         QtConcurrent::run([=]
diff --git a/src/pages/appintopage.cpp b/src/pages/appintopage.cpp
index bbc476a..2d4fdd3 100644
--- a/src/pages/appintopage.cpp
+++ b/src/pages/appintopage.cpp
@@ -119,9 +119,13 @@ void AppIntoPage::openUrl(const QUrl &url)
         }
         
 
+        /**
+         * NOTE: No need to judget developmode status
+         */
         // Check UOS
-        QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat);
-        if (config.contains("UOS/EnableDeveloperMode") && !config.value("UOS/EnableDeveloperMode").toBool()){
+        // QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat);
+        // if (config.contains("UOS/EnableDeveloperMode") && !config.value("UOS/EnableDeveloperMode").toBool()){
+        if (false) {
             qDebug() << "UOS Developer Mode has not been enabled!";
             ui->downloadButton->setText(tr("Developer Mode Disabled"));
             ui->downloadButton->setEnabled(false);

From a26d1d8ffdbdaa81a84cb5de847373c5ce419596 Mon Sep 17 00:00:00 2001
From: Zhiyuan Li <uniartisan2017@gmail.com>
Date: Sat, 17 Aug 2024 14:20:58 +1000
Subject: [PATCH 10/11] enhance: Internal requests follow 301 redirects

---
 src/backend/sparkapi.cpp  | 2 ++
 src/pages/appintopage.cpp | 6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/backend/sparkapi.cpp b/src/backend/sparkapi.cpp
index 8c64d1c..2947108 100644
--- a/src/backend/sparkapi.cpp
+++ b/src/backend/sparkapi.cpp
@@ -28,6 +28,7 @@ void SparkAPI::get(QUrl url)
     QNetworkRequest request;
     HttpRequest *httprequest = new HttpRequest;
     request.setUrl(QUrl(url.toString().replace("+", "%2B")));
+    request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
     connect(httprequest, &HttpRequest::finished, [=](QString data)
     {
         QByteArray arr = data.toUtf8();
@@ -53,6 +54,7 @@ void SparkAPI::getRAW(QUrl url)
     QNetworkRequest request;
     HttpRequest *httprequest = new HttpRequest;
     request.setUrl(QUrl(url.toString().replace("+", "%2B")));
+    request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
     connect(httprequest, &HttpRequest::finished, [=](QString data)
             {
             emit finishedRAW(data);
diff --git a/src/pages/appintopage.cpp b/src/pages/appintopage.cpp
index 2d4fdd3..ccf3303 100644
--- a/src/pages/appintopage.cpp
+++ b/src/pages/appintopage.cpp
@@ -73,6 +73,7 @@ void AppIntoPage::openUrl(const QUrl &url)
         iconRequest.setUrl(QUrl(pkgUrlBase + "/icon.png"));
         iconRequest.setHeader(QNetworkRequest::UserAgentHeader, m_userAgent);
         iconRequest.setHeader(QNetworkRequest::ContentTypeHeader, "charset='utf-8'");
+        iconRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
 
         iconManager->get(iconRequest);
         QObject::connect(iconManager, &QNetworkAccessManager::finished, [=](QNetworkReply *reply)
@@ -96,6 +97,7 @@ void AppIntoPage::openUrl(const QUrl &url)
             request.setUrl(QUrl(imgUrl));
             request.setHeader(QNetworkRequest::UserAgentHeader, m_userAgent);
             request.setHeader(QNetworkRequest::ContentTypeHeader, "charset='utf-8'");
+            request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
             manager->get(request);
             QObject::connect(manager, &QNetworkAccessManager::finished, [=](QNetworkReply *reply)
                 {
@@ -114,10 +116,10 @@ void AppIntoPage::openUrl(const QUrl &url)
                         qDebug() << imgUrl;
                     }
 
-                    manager->deleteLater(); 
+                    manager->deleteLater();
                 });
         }
-        
+
 
         /**
          * NOTE: No need to judget developmode status

From 4fd14584712847b1cd8d84b550d1e3f9bc173de1 Mon Sep 17 00:00:00 2001
From: shenmo <jifengshenmo@outlook.com>
Date: Sat, 17 Aug 2024 06:14:20 +0000
Subject: [PATCH 11/11] update debian/changelog.

Signed-off-by: shenmo <jifengshenmo@outlook.com>
---
 debian/changelog | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 7729633..18fb2cc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+
+spark-store (4.3) stable; urgency=medium
+
+* 修复客户端不支持301跳转的问题
+* 修复UOS下错误地提示开发者模式未启动
+* 现在会记住上次的窗口大小
+* 删除无用依赖,修复Debian 13依赖问题
+
+  
+ -- shenmo <shenmo@spark-app.store>  Sun, 5 Mar 2022 11:45:14 +0800
 spark-store (4.2.13) stable; urgency=medium
 
 * 未经测试文案修改