From ffd42745039ddb767db224c6cee0ecab4b74870d Mon Sep 17 00:00:00 2001 From: Leo Heitmann Ruiz Date: Fri, 9 May 2025 18:39:21 +0200 Subject: [PATCH 1/2] Fix handling of Triple-T 1.0.0 graphics Unlike screenshots, the featureGraphic, icon, promoGraphic, and tvBanner should be placed directly in the locale directory instead of in a dedicated subdirectory (in the F-Droid metadata structure). For version 1.0.0 of the Triple-T structure this currently isn't done. Instead, the graphics are treated as screenshots are. To illustrate: en-US/listing/icon/icon.png en-US/listing/featureGraphic/play_store_feature_graphic.png Should end up as: en-US/icon.png en-US/featureGraphic.png But instead they currently end up as: en-US/icon/icon.png en-US/featureGraphic/play_store_feature_graphic.png This patch should fix it. It seems the erroneous behavior was introduced in a4169484fdf67fb2644d3824227498cc75b6367e Closes #1260 --- fdroidserver/update.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fdroidserver/update.py b/fdroidserver/update.py index 9df02e54..2fa0c532 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -1114,6 +1114,9 @@ def copy_triple_t_store_metadata(apps): repofilename = os.path.basename(f) if segments[-2] == 'listing': locale = segments[-3] + if dirname in GRAPHIC_NAMES: + repofilename = dirname + '.' + extension + dirname = '' elif segments[-4] == 'listings': # v2.x locale = segments[-3] if dirname in tt_graphic_names: From 5f534ea2cb48fbc033dc49659162bf8e89f2e33c Mon Sep 17 00:00:00 2001 From: Leo Heitmann Ruiz Date: Wed, 21 May 2025 18:38:14 +0200 Subject: [PATCH 2/2] Add test case for Triple-T 1.0.0 graphics --- MANIFEST.in | 4 +++ tests/test_update.py | 18 +++++++++++++ .../play_store_feature_graphic.png | Bin 0 -> 1067 bytes .../src/main/play/en-US/listing/icon/icon.png | Bin 0 -> 451 bytes .../play/en-US/listing/phoneScreenshots/1.png | Bin 0 -> 330 bytes .../metadata/de.wivewa.dialer.yml | 25 ++++++++++++++++++ 6 files changed, 47 insertions(+) create mode 100644 tests/triple-t-1-graphics/build/de.wivewa.dialer/app/src/main/play/en-US/listing/featureGraphic/play_store_feature_graphic.png create mode 100644 tests/triple-t-1-graphics/build/de.wivewa.dialer/app/src/main/play/en-US/listing/icon/icon.png create mode 100644 tests/triple-t-1-graphics/build/de.wivewa.dialer/app/src/main/play/en-US/listing/phoneScreenshots/1.png create mode 100644 tests/triple-t-1-graphics/metadata/de.wivewa.dialer.yml diff --git a/MANIFEST.in b/MANIFEST.in index e833d6f6..fd5eb862 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -868,6 +868,10 @@ include tests/test_signatures.py include tests/test_signindex.py include tests/test_update.py include tests/test_vcs.py +include tests/triple-t-1-graphics/build/de.wivewa.dialer/app/src/main/play/en-US/listing/featureGraphic/play_store_feature_graphic.png +include tests/triple-t-1-graphics/build/de.wivewa.dialer/app/src/main/play/en-US/listing/icon/icon.png +include tests/triple-t-1-graphics/build/de.wivewa.dialer/app/src/main/play/en-US/listing/phoneScreenshots/1.png +include tests/triple-t-1-graphics/metadata/de.wivewa.dialer.yml include tests/triple-t-2/build/org.piwigo.android/app/.gitignore include tests/triple-t-2/build/org.piwigo.android/app/build.gradle include tests/triple-t-2/build/org.piwigo.android/app/src/debug/res/values/constants.xml diff --git a/tests/test_update.py b/tests/test_update.py index 59dca6e1..3575b546 100755 --- a/tests/test_update.py +++ b/tests/test_update.py @@ -436,6 +436,24 @@ class UpdateTest(unittest.TestCase): locales = sorted(apps['org.fdroid.ci.test.app']['localized']) self.assertEqual(correctlocales, locales) + def test_insert_triple_t_1_graphics(self): + packageName = 'de.wivewa.dialer' + shutil.copytree(basedir / 'triple-t-1-graphics', self.testdir, dirs_exist_ok=True) + os.chdir(self.testdir) + + config = dict() + fdroidserver.common.fill_config_defaults(config) + fdroidserver.common.config = config + fdroidserver.update.config = config + + apps = fdroidserver.metadata.read_metadata() + fdroidserver.update.copy_triple_t_store_metadata(apps) + + os.chdir(os.path.join('repo', packageName)) + self.assertTrue(os.path.exists(os.path.join('en-US', 'icon.png'))) + self.assertTrue(os.path.exists(os.path.join('en-US', 'featureGraphic.png'))) + self.assertTrue(os.path.exists(os.path.join('en-US', 'phoneScreenshots', '1.png'))) + def test_insert_triple_t_2_metadata(self): packageName = 'org.piwigo.android' shutil.copytree(basedir / 'triple-t-2', self.testdir, dirs_exist_ok=True) diff --git a/tests/triple-t-1-graphics/build/de.wivewa.dialer/app/src/main/play/en-US/listing/featureGraphic/play_store_feature_graphic.png b/tests/triple-t-1-graphics/build/de.wivewa.dialer/app/src/main/play/en-US/listing/featureGraphic/play_store_feature_graphic.png new file mode 100644 index 0000000000000000000000000000000000000000..0d5e35914c1362151fd9b7dc683b9e7450148283 GIT binary patch literal 1067 zcmV+`1l0S9P)Nkl&S~C}$OlIyVwr$(CZ9CUaT zX|sKOvMOLyAbBA#Q$RyZhSJ-e1&vJ9mi8Bhv%Oor)gn7IC z5^U`9RjgiQ^gN>%Gq|*qg@z2#WVHl;GK{Mimld*CO-n0Hq zdo3M@-K_`hjeE_ps|i)F*2JzRw(hrwE=E?qQXRLNxbnej&_ZbSt92ZJB&y5yZ9kTQ|W2$IA{O`a2{`u!$&&aiBc!?0pLJd_|$Xn!=3%$n!T}Qp$N4;Pj zJ{ui89qv0BXxeMlzNsHN9ckEYZr*RLdbJj;*x1O~SoU@v>KXlYbCav44jzPqpW>vD zKk^OTK3yBwz9zr`ug3* znAHR%Gq-Zk@0R_xwu6p{rDz-uHhcrP*(o=r*EDQEJpIo5KbAKgK0+B0UoFfQzj03I zj8)`bx=EhSW_K6K1LlUa6W3EbXMEi)-pC_H9$vzIjbBUloeel zLLidKh`$O(Cpkc;@s(<+yW%8*X`ul{$vbVVFPv{O3RGPea!Ux{ew=qU2rz z2q&KZLJ<_X922!1i+O?p;x`wFnHaN@0Hf#a6v8&qD{-kC8M!+Ja1M?IYj4~f9Q0Q> zn-vaoGWz3;*)Miu!uZbFo8Nu={U5oNyHC&-rJM2cIcS~V5n)S_$s1`P!vq8zW_iL| za{6W#z7VE6wv@J+iD?+T5Pmb>oqV(t?+ZbPp5`S?MjHnULR7XxRJO0T;N|G`;N$b<=k>O|<3dxm`I7_m?#^-Z@$u&r^oTb@~m(w;$vN=n$Yk9`O$LB;=w?R|3-r@2HMbVOY^5X99M!R?RzbSMGHRnzb#WzZSEFx^HW-?i2Q*-%3u|$STxdNbCQ)}hA z&y8k_l52P1*KHfz>jyj-8ax{NI+?1$GMl5bXpz-&h4qHabi2d8XZzuZ)AhODS#ZvkzF28xEv^+nBBD25|4) za9hY@ouw3B*nz63V^w;dPqbOY+*G7xK7GypvGiQ*6e1#`xQ~^<2pFdnHn0SH*Qni+ z>sW-sBAF9d%i_7o>N0V*E!C(}X;T<_L6ugG3^ldMH-#vpDcPaoRP`sWfiz{Q-kV-k zpCbIOtne!qvX$@kuBx?su-94Kmc_Iym3gXNqe`T>t<8 literal 0 HcmV?d00001 diff --git a/tests/triple-t-1-graphics/metadata/de.wivewa.dialer.yml b/tests/triple-t-1-graphics/metadata/de.wivewa.dialer.yml new file mode 100644 index 00000000..a86e2c53 --- /dev/null +++ b/tests/triple-t-1-graphics/metadata/de.wivewa.dialer.yml @@ -0,0 +1,25 @@ +Categories: + - Phone & SMS + - System +License: GPL-3.0-only +AuthorEmail: welefon@jolo.software +SourceCode: https://codeberg.org/wivewa/wivewa-dialer-android +IssueTracker: https://codeberg.org/wivewa/wivewa-dialer-android/issues + +AutoName: Welefon + +RepoType: git +Repo: https://codeberg.org/wivewa/wivewa-dialer-android.git + +Builds: + - versionName: 1.7.0 + versionCode: 13 + commit: 3550193fa6b6f7836876f2ca9bf5819a34eef404 + subdir: app + gradle: + - yes + +AutoUpdateMode: Version +UpdateCheckMode: Tags +CurrentVersion: 1.7.0 +CurrentVersionCode: 13