From c22f13a271c944eaa525b044ce759692d7aad53e Mon Sep 17 00:00:00 2001
From: shenmo <jifengshenmo@outlook.com>
Date: Thu, 18 Apr 2024 07:29:40 +0000
Subject: [PATCH 1/9] update debian/spark-store.postinst.

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

diff --git a/debian/spark-store.postinst b/debian/spark-store.postinst
index 0e22c2d..9298834 100755
--- a/debian/spark-store.postinst
+++ b/debian/spark-store.postinst
@@ -13,8 +13,8 @@ case "$1" in
         			echo "Will not enable armhf since 4271"
 			;;
             loongarch64)
-				echo "Enabling ABI1(OldWorld) arch..."
-				dpkg --add-architecture loongarch64
+				echo "Nope we DO NOT WANT ABI1 now"
+				dpkg --remove-architecture loongarch64
 			;;
 
  			*)

From 7484ee8438c0a312bae708f1701c8e6d40d1e681 Mon Sep 17 00:00:00 2001
From: shenmo <jifengshenmo@outlook.com>
Date: Thu, 25 Apr 2024 17:23:22 +0000
Subject: [PATCH 2/9] sync: fix: Phytium can not use gles makes white screen

Signed-off-by: shenmo <jifengshenmo@outlook.com>
---
 src/main.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/main.cpp b/src/main.cpp
index 172291c..65c2ffa 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -191,6 +191,8 @@ int main(int argc, char *argv[])
     }
 #endif
 
+
+
     /**
      * NOTE: https://zhuanlan.zhihu.com/p/550285855
      * 避免 wayland 环境下从 QtWebEngine 后退回到 QWidget 时黑屏闪烁

From 4c565cda6cc68aa2a21e10f34f90dff516a1ff7a Mon Sep 17 00:00:00 2001
From: shenmo <jifengshenmo@outlook.com>
Date: Thu, 25 Apr 2024 17:26:28 +0000
Subject: [PATCH 3/9] update debian/changelog.

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

diff --git a/debian/changelog b/debian/changelog
index 8eca23a..025e1c8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+spark-store (4.2.12) stable; urgency=medium
+
+  * 修复:飞腾部分设备上白屏的问题
+  
+  
+ -- shenmo <shenmo@spark-app.store>  Sun, 5 Mar 2022 11:45:14 +0800
+
 spark-store (4.2.11) stable; urgency=medium
 
   * 修复:判断是否安装状态错误

From 0bd8bab7eb78230f040260c77f3a5c8fa9e9c1f4 Mon Sep 17 00:00:00 2001
From: shenmo <jifengshenmo@outlook.com>
Date: Thu, 25 Apr 2024 17:35:03 +0000
Subject: [PATCH 4/9] sync: retryfix: Phytium can not use gles makes white
 screen

Signed-off-by: shenmo <jifengshenmo@outlook.com>
---
 src/main.cpp | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/src/main.cpp b/src/main.cpp
index 65c2ffa..eb5dff0 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -177,9 +177,6 @@ int main(int argc, char *argv[])
         }
 
     }
-    QSurfaceFormat format;
-    format.setRenderableType(QSurfaceFormat::OpenGLES);
-    QSurfaceFormat::setDefaultFormat(format);
 
     /**
      * NOTE: https://zhuanlan.zhihu.com/p/550285855
@@ -191,8 +188,6 @@ int main(int argc, char *argv[])
     }
 #endif
 
-
-
     /**
      * NOTE: https://zhuanlan.zhihu.com/p/550285855
      * 避免 wayland 环境下从 QtWebEngine 后退回到 QWidget 时黑屏闪烁

From 3664a80c5516dfa09e9e57ac6abc1adcfa87f78f Mon Sep 17 00:00:00 2001
From: shenmo <jifengshenmo@outlook.com>
Date: Thu, 25 Apr 2024 17:45:57 +0000
Subject: [PATCH 5/9] De-Magic Operation: Delete arm64 magic

Signed-off-by: shenmo <jifengshenmo@outlook.com>
---
 src/main.cpp | 39 +--------------------------------------
 1 file changed, 1 insertion(+), 38 deletions(-)

diff --git a/src/main.cpp b/src/main.cpp
index eb5dff0..a224011 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -148,46 +148,9 @@ int main(int argc, char *argv[])
     // qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--disable-web-security");
 #ifdef __sw_64__
     qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--no-sandbox");
-#elif __aarch64__
-    QString env = QString::fromUtf8(qgetenv("QTWEBENGINE_CHROMIUM_FLAGS"));
-    env = env.trimmed();
-    /**
-     * NOTE: 参考帮助手册代码,对于部分 ARM CPU 设备,
-     * --disable-gpu 保证网页正常显示
-     * --single-process 避免 QtWebEngine 崩溃(可选)
-     */
-    env += " --disable-gpu";
-    if (Utils::isPhytium()) {
-        env += " --single-process";
-    }
-    qputenv("QTWEBENGINE_CHROMIUM_FLAGS", env.trimmed().toUtf8());
-
-    if (Utils::isWayland()) {
-        /**
-         * WARNING: DDM TreeLand 混合器下,设置
-         * QT_WAYLAND_SHELL_INTEGRATION 环境变量
-         * 会导致崩溃 By justforlxz
-         */
-        if (!Utils::isTreeLand()) {
-            /**
-             * NOTE: 参考帮助手册代码,对于麒麟 CPU 设备,
-             * 避免 wayland 环境下 QtWebEngine 崩溃
-             */
-            qputenv("QT_WAYLAND_SHELL_INTEGRATION", "kwayland-shell");
-        }
-
-    }
-
-    /**
-     * NOTE: https://zhuanlan.zhihu.com/p/550285855
-     * 避免 X11 环境下从 QtWebEngine 后退回到 QWidget 时黑屏闪烁
-     */
-    if (!Utils::isWayland()) {
-        qputenv("QMLSCENE_DEVICE", "softwarecontext");
-        DApplication::setAttribute(Qt::AA_UseSoftwareOpenGL);
-    }
 #endif
 
+
     /**
      * NOTE: https://zhuanlan.zhihu.com/p/550285855
      * 避免 wayland 环境下从 QtWebEngine 后退回到 QWidget 时黑屏闪烁

From 74513723e96d6f4d631d3505df5a3968b4da202f Mon Sep 17 00:00:00 2001
From: zinface <zinface@163.com>
Date: Fri, 26 Apr 2024 13:53:59 +0800
Subject: [PATCH 6/9] aria2c: Fixed aria2c download never timed out

---
 src/backend/downloadworker.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/backend/downloadworker.cpp b/src/backend/downloadworker.cpp
index d6f92af..f2370ab 100644
--- a/src/backend/downloadworker.cpp
+++ b/src/backend/downloadworker.cpp
@@ -1,4 +1,4 @@
-#include "downloadworker.h"
+#include "downloadworker.h"
 
 #include <QProcess>
 #include <QRegularExpression>
@@ -120,6 +120,8 @@ void DownloadController::startDownload(const QString &url)
         QString downloadDir = "/tmp/spark-store/"; //下载目录
         QString aria2ConnectionPerServer = "--max-connection-per-server=1"; //每个服务器最大连接数
         QString aria2ConnectionMax = "--max-concurrent-downloads=16"; //最大同时下载数
+        QString aria2Timeout = "--timeout=3"; // 3秒超时 not use see v.
+        QString aria2ConnectionTimeout = "--connect-timeout=1"; // 1 秒服务器连接超时(像 spark1.uniartisan.com、cdn.dl.uniartisan.com、momen.d.store.deepinos.org.cn 等服务器失效时不影响即时下载)
 
 
         if (useMetalink) //如果是metalink
@@ -147,6 +149,7 @@ void DownloadController::startDownload(const QString &url)
         command.append(aria2SizePerThreads.toUtf8());
         command.append(aria2ConnectionPerServer.toUtf8());
         command.append(aria2ConnectionMax.toUtf8());
+        command.append(aria2ConnectionTimeout.toUtf8());
 
         if (useMetalink)
         {

From 021283e2407c50e119e7f8548eb87431c81ea3fd Mon Sep 17 00:00:00 2001
From: shenmo <jifengshenmo@outlook.com>
Date: Sat, 27 Apr 2024 05:56:57 +0000
Subject: [PATCH 7/9] fix: hide error

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

diff --git a/tool/spark-dstore-patch b/tool/spark-dstore-patch
index c955fcd..e0292ab 100755
--- a/tool/spark-dstore-patch
+++ b/tool/spark-dstore-patch
@@ -7,7 +7,7 @@
 enumAppInfoList() {
     appInfoList=()
     apps="/opt/apps"
-    list=$(ls $apps)
+    list=$(ls $apps 2>/dev/null)
     for appID in $list; do
         appInfoList+=("$appID")
     done
@@ -78,7 +78,7 @@ if [ ! -d "/usr/share/icons/hicolor/scalable/apps" ];then
 mkdir -p /usr/share/icons/hicolor/scalable/apps
 fi
 
-for icon_root_icon_path in $(ls /usr/share/icons/*.png /usr/share/icons/*.svg)
+for icon_root_icon_path in $(ls /usr/share/icons/*.png /usr/share/icons/*.svg 2>/dev/null)
 do
 target_icon_path=/usr/share/icons/hicolor/scalable/apps/$(basename ${icon_root_icon_path})
 if [  ! -e ${target_icon_path} ];then
@@ -90,19 +90,23 @@ done
 function exec_link_clean(){
 # remove broken links in /usr/share
 
-    find /usr/share/applications -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; &
-    find /usr/share/icons -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; &
-    find /usr/share/mime/packages -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; &
-    find /usr/share/glib-2.0 -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; &
-    find /usr/share/dbus-1/services -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; &
-    find /usr/share/fcitx -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; &
-    find /usr/share/help -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; &
-    find /usr/share/locale -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; &
-    find /usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/fcitx -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; &
-    find /usr/lib/mozilla/plugins -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; &
-    find /usr/share/polkit-1/actions -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; &
-    find /usr/share/fonts -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; &
-    find /etc/fonts/conf.d -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; &
+    find /usr/share/applications -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; 2>/dev/null &
+    find /usr/share/icons -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; 2>/dev/null &
+    find /usr/share/mime/packages -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; 2>/dev/null &
+    find /usr/share/glib-2.0 -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; 2>/dev/null &
+    find /usr/share/dbus-1/services -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; 2>/dev/null &
+    find /usr/share/fcitx -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; 2>/dev/null &
+    find /usr/share/help -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; 2>/dev/null &
+    find /usr/share/locale -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; 2>/dev/null &
+    find /usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/fcitx -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; 2>/dev/null &
+    find /usr/lib/mozilla/plugins -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; 2>/dev/null &
+    find /usr/share/polkit-1/actions -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; 2>/dev/null &
+    find /usr/share/fonts -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; 2>/dev/null &
+    find /etc/fonts/conf.d -xtype l -exec echo '{} is invalid now and going to be cleaned' \; -exec unlink  {} \; 2>/dev/null &
+
+
+}
+function exec_uos_package_update(){
     update-icon-caches /usr/share/icons/* > /dev/null 2>&1 &
     update-desktop-database -q > /dev/null 2>&1 &
     update-mime-database -V /usr/share/mime > /dev/null 2>&1 &
@@ -110,13 +114,15 @@ function exec_link_clean(){
 
 }
 
-
 #########################################################################################
 echo "----------------Running Spark DStore Patch----------------"
 if [ ! -e /usr/bin/deepin-app-store-tool ];then
 # execute linkApp function for each app and print output
 exec_uos_package_link
+
 fi
 exec_v23_icon_link
 exec_link_clean
+wait
+exec_uos_package_update
 echo "----------------Finished----------------"

From b2120411e5050caf045f4308453e43f2e4069cfd Mon Sep 17 00:00:00 2001
From: shenmo <jifengshenmo@outlook.com>
Date: Sat, 27 Apr 2024 10:30:57 +0000
Subject: [PATCH 8/9] update src/backend/downloadworker.cpp.

Signed-off-by: shenmo <jifengshenmo@outlook.com>
---
 src/backend/downloadworker.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/backend/downloadworker.cpp b/src/backend/downloadworker.cpp
index f2370ab..d44f350 100644
--- a/src/backend/downloadworker.cpp
+++ b/src/backend/downloadworker.cpp
@@ -1,4 +1,4 @@
-#include "downloadworker.h"
+#include "downloadworker.h"
 
 #include <QProcess>
 #include <QRegularExpression>
@@ -120,8 +120,7 @@ void DownloadController::startDownload(const QString &url)
         QString downloadDir = "/tmp/spark-store/"; //下载目录
         QString aria2ConnectionPerServer = "--max-connection-per-server=1"; //每个服务器最大连接数
         QString aria2ConnectionMax = "--max-concurrent-downloads=16"; //最大同时下载数
-        QString aria2Timeout = "--timeout=3"; // 3秒超时 not use see v.
-        QString aria2ConnectionTimeout = "--connect-timeout=1"; // 1 秒服务器连接超时(像 spark1.uniartisan.com、cdn.dl.uniartisan.com、momen.d.store.deepinos.org.cn 等服务器失效时不影响即时下载)
+        QString aria2ConnectionTimeout = "--connect-timeout=5"; // 1 秒服务器连接超时(像 spark1.uniartisan.com、cdn.dl.uniartisan.com、momen.d.store.deepinos.org.cn 等服务器失效时不影响即时下载)
 
 
         if (useMetalink) //如果是metalink

From 6426a3c12a95bf5ccb6b08773dd0fe21f75f6a65 Mon Sep 17 00:00:00 2001
From: shenmo <jifengshenmo@outlook.com>
Date: Sat, 27 Apr 2024 10:37:11 +0000
Subject: [PATCH 9/9] update debian/changelog.

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

diff --git a/debian/changelog b/debian/changelog
index 025e1c8..67be9a6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,7 @@
 spark-store (4.2.12) stable; urgency=medium
 
   * 修复:飞腾部分设备上白屏的问题
-  
+  * 修复:下载开始时长时等待(降低链接超时时长)
   
  -- shenmo <shenmo@spark-app.store>  Sun, 5 Mar 2022 11:45:14 +0800