diff --git a/.gitignore b/.gitignore index 40e2cd2b..4652e8a2 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ *.pyc *.class *.box +TAGS # files generated by build build/ @@ -17,6 +18,7 @@ docs/html/ # files generated by tests tmp/ /tests/repo/icons* +/tests/repo/latestapps.dat # files used in manual testing /config.py @@ -26,10 +28,14 @@ tmp/ makebuildserver.config.py /tests/.fdroid.keypass.txt /tests/.fdroid.keystorepass.txt -/tests/config.py /tests/fdroid-icon.png -/tests/keystore.jks +/tests/OBBMainOldVersion.apk /tests/OBBMainPatchCurrent.apk /tests/OBBMainTwoVersions.apk +/tests/archive/categories.txt +/tests/archive/icons* +/tests/archive/index.jar +/tests/archive/index.xml +/tests/repo/index.jar /tests/urzip-πÇÇπÇÇ现代汉语通用字-български-عربي1234.apk /unsigned/ diff --git a/examples/config.py b/examples/config.py index a047a71d..026cd3e6 100644 --- a/examples/config.py +++ b/examples/config.py @@ -175,10 +175,10 @@ The repository of older versions of applications from the main demo repository. # and the archive, if it is enabled. So these URLs should end in the # 'fdroid' base of the F-Droid part of the web server like serverwebroot. # -# mirrors = { +# mirrors = ( # 'https://foo.bar/fdroid', # 'http://foobarfoobarfoobar.onion/fdroid', -# } +# ) # optionally specific which identity file to use when using rsync over SSH # @@ -253,7 +253,7 @@ The repository of older versions of applications from the main demo repository. # By default, fdroid will use YAML .yml and the custom .txt metadata formats. It # is also possible to have metadata in JSON by adding 'json'. -# accepted_formats = ['txt', 'yml'] +# accepted_formats = ('txt', 'yml') # Limit in number of characters that fields can take up # Only the fields listed here are supported, defaults shown @@ -269,13 +269,13 @@ The repository of older versions of applications from the main demo repository. # the packageNames listed. This is protected by the same signing key # as the app index metadata. # -# install_list = { +# install_list = ( # 'at.bitfire.davdroid', # 'com.fsck.k9', # 'us.replicant', -# } +# ) # -# uninstall_list = { +# uninstall_list = ( # 'com.facebook.orca', # 'com.android.vending', -# } +# ) diff --git a/tests/config.py b/tests/config.py new file mode 100644 index 00000000..16917a64 --- /dev/null +++ b/tests/config.py @@ -0,0 +1,35 @@ + +repo_url = "https://MyFirstFDroidRepo.org/fdroid/repo" +repo_name = "My First F-Droid Repo Demo" +repo_icon = "fdroid-icon.png" +repo_description = """ +This is a repository of apps to be used with F-Droid. Applications in this +repository are either official binaries built by the original application +developers, or are binaries built from source by the admin of f-droid.org +using the tools on https://gitlab.com/u/fdroid. +""" + +archive_older = 3 +archive_url = "https://f-droid.org/archive" +archive_name = "My First F-Droid Archive Demo" +archive_icon = "fdroid-icon.png" +archive_description = """ +The repository of older versions of applications from the main demo repository. +""" + +repo_keyalias = "sova" +keystore = "keystore.jks" +keystorepass = "r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI=" +keypass = "r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI=" +keydname = "CN=sova, OU=F-Droid" + +mirrors = ( + 'https://foo.bar/fdroid', + 'http://foobarfoobarfoobar.onion/fdroid', +) + +update_stats = True +accepted_formats = ('json', 'txt', 'yml') + +install_list = 'org.adaway' +uninstall_list = ('com.android.vending', 'com.facebook.orca', ) diff --git a/tests/keystore.jks b/tests/keystore.jks new file mode 100644 index 00000000..1eb91fe7 Binary files /dev/null and b/tests/keystore.jks differ diff --git a/tests/repo/categories.txt b/tests/repo/categories.txt new file mode 100644 index 00000000..a0aab2be --- /dev/null +++ b/tests/repo/categories.txt @@ -0,0 +1,7 @@ +Development +GuardianProject +Multimedia +None +Phone & SMS +Security +System diff --git a/tests/repo/index.xml b/tests/repo/index.xml new file mode 100644 index 00000000..14ee0205 --- /dev/null +++ b/tests/repo/index.xml @@ -0,0 +1,162 @@ + + + + This is a repository of apps to be used with F-Droid. Applications in this repository are either official binaries built by the original application developers, or are binaries built from source by the admin of f-droid.org using the tools on https://gitlab.com/u/fdroid. + http://foobarfoobarfoobar.onion/fdroid/repo + https://foo.bar/fdroid/repo + + + + + + obb.main.oldversion + 2013-12-31 + 2013-12-31 + OBB Main Old Version + + obb.main.oldversion.1444412523.png + <p>No description available</p> + GPLv3 + Development + Development + + https://github.com/eighthave/urzip + + 1Fi5xUHiAPRKxHvyUGVFGt9extBe8Srdbk + + 99999999 + + 0.1 + 1444412523 + obb.main.oldversion_1444412523.apk + 7562a36c9e2b38013b96663cf41f0f290dc7a248a81befa8d89e14f390c94c7f + 11470 + 4 + 18 + main.1434483388.obb.main.oldversion.obb + d3eb539a556352f3f47881d71fb0e5777b2f3e9a4251d283c18c67ce996774b7 + 2013-12-31 + b4964fd759edaa54e65bb476d0276880 + + + + obb.main.twoversions + 2015-10-12 + 2016-06-20 + OBB Main Two Versions + + obb.main.twoversions.1101617.png + <p>No description available</p> + GPLv3 + Development + Development + + https://github.com/eighthave/urzip + + 1Fi5xUHiAPRKxHvyUGVFGt9extBe8Srdbk + + 99999999 + + 0.1 + 1101617 + obb.main.twoversions_1101617.apk + obb.main.twoversions_1101617_src.tar.gz + 9bc74566f089ef030ac33e7fbd99d92f1a38f363fb499fed138d9e7b774e821c + 11481 + 4 + 18 + main.1101615.obb.main.twoversions.obb + d3eb539a556352f3f47881d71fb0e5777b2f3e9a4251d283c18c67ce996774b7 + 2016-06-20 + b4964fd759edaa54e65bb476d0276880 + + + 0.1 + 1101615 + obb.main.twoversions_1101615.apk + 7b0b7b9ba248e15751a16e3a0e01e1e24cbb673686c38422030cb75d5c33f0bb + 11480 + 4 + 18 + main.1101615.obb.main.twoversions.obb + d3eb539a556352f3f47881d71fb0e5777b2f3e9a4251d283c18c67ce996774b7 + 2016-01-01 + b4964fd759edaa54e65bb476d0276880 + + + 0.1 + 1101613 + obb.main.twoversions_1101613.apk + cce97a52ff18d843185be7f22ecb1a557c36b7a9f8ba07a8be94e328e00b35dc + 11477 + 4 + 18 + main.1101613.obb.main.twoversions.obb + d3eb539a556352f3f47881d71fb0e5777b2f3e9a4251d283c18c67ce996774b7 + 2015-10-12 + b4964fd759edaa54e65bb476d0276880 + + + + obb.mainpatch.current + 2016-04-23 + 2016-04-23 + OBB Main/Patch Current + + obb.mainpatch.current.1619.png + <p>No description available</p> + GPLv3 + Development + Development + + https://github.com/eighthave/urzip + + 1Fi5xUHiAPRKxHvyUGVFGt9extBe8Srdbk + + 99999999 + + 0.1 + 1619 + obb.mainpatch.current_1619.apk + eda5fc3ecfdac3252717e36bdbc9820865baeef162264af9ba5db7364f0e7a0c + 11479 + 4 + 18 + main.1619.obb.mainpatch.current.obb + d3eb539a556352f3f47881d71fb0e5777b2f3e9a4251d283c18c67ce996774b7 + patch.1619.obb.mainpatch.current.obb + d3eb539a556352f3f47881d71fb0e5777b2f3e9a4251d283c18c67ce996774b7 + 2016-04-23 + b4964fd759edaa54e65bb476d0276880 + + + + info.guardianproject.urzip + 2016-06-23 + 2016-06-23 + urzip-πÇÇπÇÇ现代汉语通用字-български-عربي1234 + 一个实用工具,获取已安装在您的设备上的应用的有关信息 + info.guardianproject.urzip.100.png + <p>It’s Urzip 是一个获得已安装 APK 相关信息的实用工具。它从您的设备上已安装的所有应用开始,一键触摸即可显示 APK 的指纹,并且提供到达 virustotal.com 和 androidobservatory.org 的快捷链接,让您方便地了解特定 APK 的档案。它还可以让您导出签名证书和生成 ApkSignaturePin Pin 文件供 TrustedIntents 库使用。</p><p>★ Urzip 支持下列语言: Deutsch, English, español, suomi, 日本語, 한국어, Norsk, português (Portugal), Русский, Slovenščina, Türkçe 没看到您的语言?帮忙翻译本应用吧: https://www.transifex.com/projects/p/urzip</p><p>★ 致用户:我们还缺少你喜欢的功能?发现了一个 bug?请告诉我们!我们乐于听取您的意见。请发送电子邮件至: support@guardianproject.info 或者加入我们的聊天室 https://guardianproject.info/contact</p> + GPLv3 + Development,GuardianProject + Development + https://dev.guardianproject.info/projects/urzip + https://github.com/guardianproject/urzip + https://dev.guardianproject.info/projects/urzip/issues + 1Fi5xUHiAPRKxHvyUGVFGt9extBe8Srdbk + + 9999999 + + 0.1 + 100 + urzip-πÇÇπÇÇ现代汉语通用字-български-عربي1234.apk + 15c0ec72c74a3791f42cdb43c57df0fb11a4dbb656851bbb8cf05b26a8372789 + 11471 + 4 + 18 + 2016-06-23 + b4964fd759edaa54e65bb476d0276880 + + + diff --git a/tests/run-tests b/tests/run-tests index fd58024a..09f401c1 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -158,17 +158,21 @@ echo_header "copy tests/repo, generate java/gpg keys, update, and gpgsign" REPOROOT=`create_test_dir` GNUPGHOME=$REPOROOT/gnupghome +KEYSTORE=$WORKSPACE/tests/keystore.jks cd $REPOROOT -$fdroid init -cp -a $WORKSPACE/tests/metadata $WORKSPACE/tests/repo $REPOROOT/ +$fdroid init --keystore $KEYSTORE --repo-keyalias=sova +echo 'keystorepass = "r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI="' >> config.py +echo 'keypass = "r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI="' >> config.py +cp -a $WORKSPACE/tests/metadata $WORKSPACE/tests/repo $WORKSPACE/tests/stats $REPOROOT/ cp -a $WORKSPACE/tests/gnupghome $GNUPGHOME chmod 0700 $GNUPGHOME echo "accepted_formats = ['json', 'txt', 'yml']" >> config.py echo "install_list = 'org.adaway'" >> config.py -echo "uninstall_list = {'com.android.vending', 'com.facebook.orca',}" >> config.py +echo "uninstall_list = ('com.android.vending', 'com.facebook.orca',)" >> config.py echo "gpghome = '$GNUPGHOME'" >> config.py echo "gpgkey = 'CE71F7FB'" >> config.py -$fdroid update --verbose +echo "mirrors = ('http://foobarfoobarfoobar.onion/fdroid','https://foo.bar/fdroid',)" >> config.py +$fdroid update --verbose --pretty test -e repo/index.xml test -e repo/index.jar grep -F '