From 27ea66743865290007121717a5f2c75b9249b176 Mon Sep 17 00:00:00 2001 From: Jochen Sprickerhof Date: Fri, 2 Jun 2023 10:06:47 +0200 Subject: [PATCH] Add test for !1370 The bug fixed in !1370 was due to a reuse of the per app anti features dictionary in the per version one and adding the per version anti features into it. This was not caught by the test suite as the app versions are processed from newest to oldest and the test data had only anti features in the oldest version. This patch adds an anti feature to a newest version so only those in between should not have it. --- tests/metadata/com.politedroid.yml | 4 ++++ tests/metadata/dump/com.politedroid.yaml | 5 ++++- tests/repo/entry.json | 2 +- tests/repo/index-v1.json | 7 ++++++- tests/repo/index-v2.json | 7 +++++-- tests/repo/index.xml | 2 +- 6 files changed, 21 insertions(+), 6 deletions(-) diff --git a/tests/metadata/com.politedroid.yml b/tests/metadata/com.politedroid.yml index a1ddc8bf..669520a6 100644 --- a/tests/metadata/com.politedroid.yml +++ b/tests/metadata/com.politedroid.yml @@ -39,6 +39,10 @@ Builds: sudo: echo 'this is just a test' gradle: - yes + antifeatures: + - KnownVuln + - UpstreamNonFree + - NonFreeAssets ArchivePolicy: 4 versions AutoUpdateMode: Version v%v diff --git a/tests/metadata/dump/com.politedroid.yaml b/tests/metadata/dump/com.politedroid.yaml index 7a970436..17e6a8f3 100644 --- a/tests/metadata/dump/com.politedroid.yaml +++ b/tests/metadata/dump/com.politedroid.yaml @@ -122,7 +122,10 @@ Builds: versionName: '1.4' - androidupdate: [] antcommands: [] - antifeatures: {} + antifeatures: + KnownVuln: {} + NonFreeAssets: {} + UpstreamNonFree: {} binary: null build: '' buildjni: [] diff --git a/tests/repo/entry.json b/tests/repo/entry.json index 13514cc5..2f98dbab 100644 --- a/tests/repo/entry.json +++ b/tests/repo/entry.json @@ -3,7 +3,7 @@ "version": 20002, "index": { "name": "/index-v2.json", - "sha256": "f4979b9db840cb51a99e80c20da676ba42b13133dbaa4819673bc43ed2ffc3f3", + "sha256": "ba000a3f5e1935d338f374c50cae529b8ce6d988ab3ed67c7a8cf437502f81ad", "size": 52481, "numPackages": 10 }, diff --git a/tests/repo/index-v1.json b/tests/repo/index-v1.json index bf2f53ae..4b845994 100644 --- a/tests/repo/index-v1.json +++ b/tests/repo/index-v1.json @@ -231,6 +231,11 @@ "com.politedroid": [ { "added": 1498176000000, + "antiFeatures": [ + "KnownVuln", + "NonFreeAssets", + "UpstreamNonFree" + ], "apkName": "com.politedroid_6.apk", "hash": "70c2f776a2bac38a58a7d521f96ee0414c6f0fb1de973c3ca8b10862a009247d", "hashType": "sha256", @@ -689,4 +694,4 @@ } ] } -} +} \ No newline at end of file diff --git a/tests/repo/index-v2.json b/tests/repo/index-v2.json index fed40fb9..5a8deb1e 100644 --- a/tests/repo/index-v2.json +++ b/tests/repo/index-v2.json @@ -568,10 +568,13 @@ ] }, "antiFeatures": { + "KnownVuln": {}, "NoSourceSince": { "en-US": "1.5" }, - "NonFreeNet": {} + "NonFreeAssets": {}, + "NonFreeNet": {}, + "UpstreamNonFree": {} } }, "5bdbfa071cca4b8d05ced41d6b28763595d6e8096cca5bbf0f9253c9a2622e5d": { @@ -1403,4 +1406,4 @@ } } } -} \ No newline at end of file +} diff --git a/tests/repo/index.xml b/tests/repo/index.xml index dfdb76b6..6935f675 100644 --- a/tests/repo/index.xml +++ b/tests/repo/index.xml @@ -318,7 +318,7 @@ APK is called F-Droid Privileged Extension. https://github.com/miguelvps/PoliteDroid/issues 1.5 6 - NoSourceSince,NonFreeNet + KnownVuln,NoSourceSince,NonFreeAssets,NonFreeNet,UpstreamNonFree 1.5 6