Merge branch '0.8-fixes' into 'master'

0.8 fixes

Closes #325, #347, and #309

See merge request !304
This commit is contained in:
Hans-Christoph Steiner 2017-07-20 03:58:27 +00:00
commit 512688990f
17 changed files with 282 additions and 7361 deletions

View file

@ -7,8 +7,8 @@ test:
- ./complete-ci-tests - ./complete-ci-tests
# Test that the parsing of the .txt format didn't change. The metadata # Test that the parsing of the .txt format didn't change. The metadata
# field 'Author Web Site' was added after 0.7.0, so that can't be part # fields 'Author Web Site', 'antifeatures=', 'buildozer=', and 'sudo='
# of the test. # where added after 0.7.0, so that can't be part of the test.
metadata_v0: metadata_v0:
script: script:
- cd tests - cd tests
@ -19,6 +19,10 @@ metadata_v0:
- sed -i "s/'Author Email',/'Author Email',\n'Author Web Site',/" fdroidserver/metadata.py - sed -i "s/'Author Email',/'Author Email',\n'Author Web Site',/" fdroidserver/metadata.py
- git clone --depth 1 https://gitlab.com/fdroid/fdroiddata - git clone --depth 1 https://gitlab.com/fdroid/fdroiddata
- cd fdroiddata - cd fdroiddata
- sed -i -e '/antifeatures=/d'
-e '/buildozer=/d'
-e '/sudo=/d'
metadata/*.txt
- ../tests/dump.py - ../tests/dump.py
- cd .. - cd ..
- git reset --hard - git reset --hard

View file

@ -5,6 +5,7 @@ include fdroid
include jenkins-build include jenkins-build
include makebuildserver include makebuildserver
include buildserver/config.buildserver.py include buildserver/config.buildserver.py
include buildserver/gradle
include buildserver/provision-android-ndk include buildserver/provision-android-ndk
include buildserver/provision-android-sdk include buildserver/provision-android-sdk
include buildserver/provision-apt-get-install include buildserver/provision-apt-get-install
@ -13,21 +14,142 @@ include buildserver/provision-gradle
include buildserver/provision-pip include buildserver/provision-pip
include buildserver/provision-qt-sdk include buildserver/provision-qt-sdk
include buildserver/provision-ubuntu-trusty-paramiko include buildserver/provision-ubuntu-trusty-paramiko
include buildserver/setup-env-vars
include buildserver/Vagrantfile include buildserver/Vagrantfile
include completion/bash-completion include completion/bash-completion
include examples/config.py include examples/config.py
include examples/fdroid-icon.png include examples/fdroid-icon.png
include examples/makebuildserver.config.py include examples/makebuildserver.config.py
include examples/opensc-fdroid.cfg include examples/opensc-fdroid.cfg
include tests/getsig/run.sh include examples/public-read-only-s3-bucket-policy.json
include tests/getsig/make.sh include examples/template.yml
include tests/androguard_test.py
include tests/build.TestCase
include tests/common.TestCase
include tests/complete-ci-tests
include tests/config.py
include tests/description-parsing.py
include tests/dump_internal_metadata_format.py
include tests/extra/convert_metadata_to_yaml_then_txt.sh
include tests/extra/manual-vmtools-test.py
include tests/getsig/getsig.java include tests/getsig/getsig.java
include tests/getsig/make.sh
include tests/getsig/run.sh
include tests/gnupghome/pubring.gpg
include tests/gnupghome/random_seed
include tests/gnupghome/secring.gpg
include tests/gnupghome/trustdb.gpg
include tests/import_proxy.py
include tests/import.TestCase
include tests/index.TestCase
include tests/install.TestCase
include tests/keystore.jks
include tests/lint.TestCase
include tests/metadata/apk/info.guardianproject.urzip.yaml
include tests/metadata/apk/org.dyndns.fules.ck.yaml
include tests/metadata/app.with.special.build.params.txt
include tests/metadata/com.politedroid.txt
include tests/metadata/dump/com.politedroid.yaml
include tests/metadata/dump/org.adaway.yaml
include tests/metadata/dump/org.smssecure.smssecure.yaml
include tests/metadata/dump/org.videolan.vlc.yaml
include tests/metadata/fake.ota.update.txt
include tests/metadata/info.guardianproject.checkey/en-US/description.txt
include tests/metadata/info.guardianproject.checkey/en-US/phoneScreenshots/checkey-phone.png
include tests/metadata/info.guardianproject.checkey/en-US/phoneScreenshots/checkey.png
include tests/metadata/info.guardianproject.checkey/en-US/summary.txt
include tests/metadata/info.guardianproject.checkey.txt
include tests/metadata/info.guardianproject.urzip/en-US/changelogs/100.txt
include tests/metadata/info.guardianproject.urzip/en-US/full_description.txt
include tests/metadata/info.guardianproject.urzip/en-US/images/featureGraphic.png
include tests/metadata/info.guardianproject.urzip/en-US/images/icon.png
include tests/metadata/info.guardianproject.urzip/en-US/short_description.txt
include tests/metadata/info.guardianproject.urzip/en-US/title.txt
include tests/metadata/info.guardianproject.urzip/en-US/video.txt
include tests/metadata/info.guardianproject.urzip.yml
include tests/metadata/obb.main.oldversion.txt
include tests/metadata/obb.mainpatch.current.txt
include tests/metadata/obb.main.twoversions.txt
include tests/metadata/org.adaway.json
include tests/metadata/org.fdroid.ci.test.app.txt
include tests/metadata/org.fdroid.fdroid.txt
include tests/metadata/org.smssecure.smssecure.txt
include tests/metadata/org.videolan.vlc.yml
include tests/metadata/raw.template.txt
include tests/metadata-rewrite-yml/app.with.special.build.params.yml
include tests/metadata-rewrite-yml/fake.ota.update.yml
include tests/metadata-rewrite-yml/org.fdroid.fdroid.yml
include tests/metadata.TestCase
include tests/openssl-version-check-test.py
include tests/org.bitbucket.tickytacky.mirrormirror_1.apk
include tests/org.bitbucket.tickytacky.mirrormirror_2.apk
include tests/org.bitbucket.tickytacky.mirrormirror_3.apk
include tests/org.bitbucket.tickytacky.mirrormirror_4.apk
include tests/org.dyndns.fules.ck_20.apk
include tests/repo/categories.txt
include tests/repo/com.politedroid_3.apk
include tests/repo/com.politedroid_4.apk
include tests/repo/com.politedroid_5.apk
include tests/repo/com.politedroid_6.apk
include tests/repo/fake.ota.update_1234.zip
include tests/repo/index.xml
include tests/repo/main.1101613.obb.main.twoversions.obb
include tests/repo/main.1101615.obb.main.twoversions.obb
include tests/repo/main.1434483388.obb.main.oldversion.obb
include tests/repo/main.1619.obb.mainpatch.current.obb
include tests/repo/obb.main.oldversion_1444412523.apk
include tests/repo/obb.mainpatch.current_1619_another-release-key.apk
include tests/repo/obb.mainpatch.current_1619.apk
include tests/repo/obb.mainpatch.current/en-US/featureGraphic.png
include tests/repo/obb.mainpatch.current/en-US/icon.png
include tests/repo/obb.mainpatch.current/en-US/phoneScreenshots/screenshot-main.png
include tests/repo/obb.mainpatch.current/en-US/sevenInchScreenshots/screenshot-tablet-main.png
include tests/repo/obb.main.twoversions_1101613.apk
include tests/repo/obb.main.twoversions_1101615.apk
include tests/repo/obb.main.twoversions_1101617.apk
include tests/repo/obb.main.twoversions_1101617_src.tar.gz
include tests/repo/org.videolan.vlc/en-US/icon.png
include tests/repo/org.videolan.vlc/en-US/phoneScreenshots/screenshot10.png
include tests/repo/org.videolan.vlc/en-US/phoneScreenshots/screenshot12.png
include tests/repo/org.videolan.vlc/en-US/phoneScreenshots/screenshot15.png
include tests/repo/org.videolan.vlc/en-US/phoneScreenshots/screenshot18.png
include tests/repo/org.videolan.vlc/en-US/phoneScreenshots/screenshot20.png
include tests/repo/org.videolan.vlc/en-US/phoneScreenshots/screenshot22.png
include tests/repo/org.videolan.vlc/en-US/phoneScreenshots/screenshot4.png
include tests/repo/org.videolan.vlc/en-US/phoneScreenshots/screenshot7.png
include tests/repo/org.videolan.vlc/en-US/phoneScreenshots/screenshot9.png
include tests/repo/org.videolan.vlc/en-US/sevenInchScreenshots/screenshot0.png
include tests/repo/org.videolan.vlc/en-US/sevenInchScreenshots/screenshot11.png
include tests/repo/org.videolan.vlc/en-US/sevenInchScreenshots/screenshot13.png
include tests/repo/org.videolan.vlc/en-US/sevenInchScreenshots/screenshot14.png
include tests/repo/org.videolan.vlc/en-US/sevenInchScreenshots/screenshot16.png
include tests/repo/org.videolan.vlc/en-US/sevenInchScreenshots/screenshot17.png
include tests/repo/org.videolan.vlc/en-US/sevenInchScreenshots/screenshot19.png
include tests/repo/org.videolan.vlc/en-US/sevenInchScreenshots/screenshot1.png
include tests/repo/org.videolan.vlc/en-US/sevenInchScreenshots/screenshot21.png
include tests/repo/org.videolan.vlc/en-US/sevenInchScreenshots/screenshot23.png
include tests/repo/org.videolan.vlc/en-US/sevenInchScreenshots/screenshot2.png
include tests/repo/org.videolan.vlc/en-US/sevenInchScreenshots/screenshot3.png
include tests/repo/org.videolan.vlc/en-US/sevenInchScreenshots/screenshot5.png
include tests/repo/org.videolan.vlc/en-US/sevenInchScreenshots/screenshot6.png
include tests/repo/org.videolan.vlc/en-US/sevenInchScreenshots/screenshot8.png
include tests/repo/patch.1619.obb.mainpatch.current.obb
include tests/repo/urzip-πÇÇπÇÇ现代汉语通用字-български-عربي1234.apk
include tests/run-tests include tests/run-tests
include tests/signindex/guardianproject.jar
include tests/signindex/guardianproject-v1.jar
include tests/signindex/testy.jar
include tests/signindex/unsigned.jar
include tests/source-files/fdroid/fdroidclient/AndroidManifest.xml
include tests/source-files/fdroid/fdroidclient/build.gradle
include tests/source-files/open-keychain/open-keychain/build.gradle
include tests/source-files/open-keychain/open-keychain/OpenKeychain/build.gradle
include tests/source-files/osmandapp/osmand/build.gradle
include tests/source-files/Zillode/syncthing-silk/build.gradle
include tests/stats/known_apks.txt
include tests/update.TestCase include tests/update.TestCase
include tests/urzip.apk include tests/urzip.apk
include tests/urzip-badcert.apk
include tests/urzip-badsig.apk include tests/urzip-badsig.apk
include wp-fdroid/AndroidManifest.xml include tests/urzip-release.apk
include wp-fdroid/android-permissions.php include tests/urzip-release-unsigned.apk
include wp-fdroid/readme.txt
include wp-fdroid/strings.xml
include wp-fdroid/wp-fdroid.php

View file

@ -1158,7 +1158,7 @@ def main():
url = url.replace('%v', build.versionName) url = url.replace('%v', build.versionName)
url = url.replace('%c', str(build.versionCode)) url = url.replace('%c', str(build.versionCode))
logging.info("...retrieving " + url) logging.info("...retrieving " + url)
of = common.get_release_filename(app, build) + '.binary' of = re.sub(r'.apk$', '.binary.apk', common.get_release_filename(app, build))
of = os.path.join(output_dir, of) of = os.path.join(output_dir, of)
try: try:
net.download_file(url, local_filename=of) net.download_file(url, local_filename=of)

View file

@ -112,9 +112,8 @@ def make(apps, sortedids, apks, repodir, archive):
else: else:
mirrors.append(urllib.parse.urljoin(mirror + '/', urlbasepath)) mirrors.append(urllib.parse.urljoin(mirror + '/', urlbasepath))
for mirror in common.config.get('servergitmirrors', []): for mirror in common.config.get('servergitmirrors', []):
mirror = get_mirror_service_url(mirror) for url in get_mirror_service_urls(mirror):
if mirror: mirrors.append(url + '/' + repodir)
mirrors.append(mirror + '/' + repodir)
if mirrorcheckfailed: if mirrorcheckfailed:
raise FDroidException("Malformed repository mirrors.") raise FDroidException("Malformed repository mirrors.")
if mirrors: if mirrors:
@ -259,6 +258,35 @@ def make_v0(apps, apks, repodir, repodict, requestsdict):
el.appendChild(doc.createCDATASection(value)) el.appendChild(doc.createCDATASection(value))
parent.appendChild(el) parent.appendChild(el)
def addElementCheckLocalized(name, app, key, doc, parent, default=''):
'''Fill in field from metadata or localized block
For name/summary/description, they can come only from the app source,
or from a dir in fdroiddata. They can be entirely missing from the
metadata file if there is localized versions. This will fetch those
from the localized version if its not available in the metadata file.
'''
el = doc.createElement(name)
value = app.get(key)
lkey = key[:1].lower() + key[1:]
localized = app.get('localized')
if not value and localized:
for lang in ['en-US'] + [x for x in localized.keys()]:
if not lang.startswith('en'):
continue
if lang in localized:
value = localized[lang].get(lkey)
if value:
break
if not value and localized and len(localized) > 1:
lang = list(localized.keys())[0]
value = localized[lang].get(lkey)
if not value:
value = default
el.appendChild(doc.createTextNode(value))
parent.appendChild(el)
root = doc.createElement("fdroid") root = doc.createElement("fdroid")
doc.appendChild(root) doc.appendChild(root)
@ -313,16 +341,16 @@ def make_v0(apps, apks, repodir, repodict, requestsdict):
addElement('added', app.added.strftime('%Y-%m-%d'), doc, apel) addElement('added', app.added.strftime('%Y-%m-%d'), doc, apel)
if app.lastUpdated: if app.lastUpdated:
addElement('lastupdated', app.lastUpdated.strftime('%Y-%m-%d'), doc, apel) addElement('lastupdated', app.lastUpdated.strftime('%Y-%m-%d'), doc, apel)
addElement('name', app.Name, doc, apel)
addElement('summary', app.Summary, doc, apel) addElementCheckLocalized('name', app, 'Name', doc, apel)
addElementCheckLocalized('summary', app, 'Summary', doc, apel)
if app.icon: if app.icon:
addElement('icon', app.icon, doc, apel) addElement('icon', app.icon, doc, apel)
if app.get('Description'): addElementCheckLocalized('desc', app, 'Description', doc, apel,
description = app.Description '<p>No description available</p>')
else:
description = '<p>No description available</p>'
addElement('desc', description, doc, apel)
addElement('license', app.License, doc, apel) addElement('license', app.License, doc, apel)
if app.Categories: if app.Categories:
addElement('categories', ','.join(app.Categories), doc, apel) addElement('categories', ','.join(app.Categories), doc, apel)
@ -525,14 +553,15 @@ def extract_pubkey():
return hexlify(pubkey), repo_pubkey_fingerprint return hexlify(pubkey), repo_pubkey_fingerprint
def get_mirror_service_url(url): def get_mirror_service_urls(url):
'''Get direct URL from git service for use by fdroidclient '''Get direct URLs from git service for use by fdroidclient
Via 'servergitmirrors', fdroidserver can create and push a mirror Via 'servergitmirrors', fdroidserver can create and push a mirror
to certain well known git services like gitlab or github. This to certain well known git services like gitlab or github. This
will always use the 'master' branch since that is the default will always use the 'master' branch since that is the default
branch in git. branch in git. The files are then accessible via alternate URLs,
where they are served in their raw format via a CDN rather than
from git.
''' '''
if url.startswith('git@'): if url.startswith('git@'):
@ -549,18 +578,22 @@ def get_mirror_service_url(url):
branch = "master" branch = "master"
folder = "fdroid" folder = "fdroid"
urls = []
if hostname == "github.com": if hostname == "github.com":
# Github-like RAW segments "https://raw.githubusercontent.com/user/repo/master/fdroid" # Github-like RAW segments "https://raw.githubusercontent.com/user/repo/branch/folder"
segments[2] = "raw.githubusercontent.com" segments[2] = "raw.githubusercontent.com"
segments.extend([branch, folder]) segments.extend([branch, folder])
urls.append('/'.join(segments))
elif hostname == "gitlab.com": elif hostname == "gitlab.com":
# Gitlab-like Pages segments "https://user.gitlab.com/repo/fdroid" # Gitlab Raw "https://gitlab.com/user/repo/raw/branch/folder"
gitlab_url = ["https:", "", user + ".gitlab.io", repo, folder] gitlab_raw = segments + ['raw', branch, folder]
segments = gitlab_url urls.append('/'.join(gitlab_raw))
else: # Gitlab-like Pages segments "https://user.gitlab.io/repo/folder"
return None gitlab_pages = ["https:", "", user + ".gitlab.io", repo, folder]
urls.append('/'.join(gitlab_pages))
return urls
return '/'.join(segments) return urls
def download_repo_index(url_str, etag=None, verify_fingerprint=True): def download_repo_index(url_str, etag=None, verify_fingerprint=True):

View file

@ -19,6 +19,7 @@
import sys import sys
import os import os
import re
import shutil import shutil
import glob import glob
import hashlib import hashlib
@ -128,7 +129,7 @@ def main():
# version if everything checks out. # version if everything checks out.
# The binary should already have been retrieved during the build # The binary should already have been retrieved during the build
# process. # process.
srcapk = apkfile + ".binary" srcapk = re.sub(r'.apk$', '.binary.apk', apkfile)
# Compare our unsigned one with the downloaded one... # Compare our unsigned one with the downloaded one...
compare_result = common.verify_apks(srcapk, apkfile, tmp_dir) compare_result = common.verify_apks(srcapk, apkfile, tmp_dir)

View file

@ -77,8 +77,10 @@ def main():
if not options.to and ext not in supported: if not options.to and ext not in supported:
logging.info("Ignoring %s file at '%s'" % (ext, path)) logging.info("Ignoring %s file at '%s'" % (ext, path))
continue continue
else: elif options.to is not None:
logging.info("rewriting '%s' to %s" % (appid, options.to)) logging.info("rewriting '%s' to %s" % (appid, options.to))
else:
logging.info("rewriting '%s'" % (appid))
to_ext = ext to_ext = ext
if options.to is not None: if options.to is not None:

View file

@ -304,6 +304,16 @@ def update_localcopy(repo_section, local_copy_dir):
push_binary_transparency(offline_copy, online_copy) push_binary_transparency(offline_copy, online_copy)
def _get_size(start_path='.'):
'''get size of all files in a dir https://stackoverflow.com/a/1392549'''
total_size = 0
for dirpath, dirnames, filenames in os.walk(start_path):
for f in filenames:
fp = os.path.join(dirpath, f)
total_size += os.path.getsize(fp)
return total_size
def update_servergitmirrors(servergitmirrors, repo_section): def update_servergitmirrors(servergitmirrors, repo_section):
'''update repo mirrors stored in git repos '''update repo mirrors stored in git repos
@ -327,13 +337,15 @@ def update_servergitmirrors(servergitmirrors, repo_section):
if repo_section == 'repo': if repo_section == 'repo':
git_mirror_path = 'git-mirror' git_mirror_path = 'git-mirror'
dotgit = os.path.join(git_mirror_path, '.git') dotgit = os.path.join(git_mirror_path, '.git')
if not os.path.isdir(git_mirror_path): git_repodir = os.path.join(git_mirror_path, 'fdroid', repo_section)
os.mkdir(git_mirror_path) if not os.path.isdir(git_repodir):
elif os.path.isdir(dotgit): os.makedirs(git_repodir)
if os.path.isdir(dotgit) and _get_size(git_mirror_path) > 1000000000:
logging.warning('Deleting git-mirror history, repo is too big (1 gig max)')
shutil.rmtree(dotgit) shutil.rmtree(dotgit)
fdroid_repo_path = os.path.join(git_mirror_path, "fdroid") # rsync is very particular about trailing slashes
_local_sync(repo_section, fdroid_repo_path) _local_sync(repo_section.rstrip('/') + '/', git_repodir.rstrip('/') + '/')
# use custom SSH command if identity_file specified # use custom SSH command if identity_file specified
ssh_cmd = 'ssh -oBatchMode=yes' ssh_cmd = 'ssh -oBatchMode=yes'
@ -344,10 +356,16 @@ def update_servergitmirrors(servergitmirrors, repo_section):
repo = git.Repo.init(git_mirror_path) repo = git.Repo.init(git_mirror_path)
for mirror in servergitmirrors: for remote_url in servergitmirrors:
hostname = re.sub(r'\W*\w+\W+(\w+).*', r'\1', mirror) hostname = re.sub(r'\W*\w+\W+(\w+).*', r'\1', remote_url)
repo.create_remote(hostname, mirror) r = git.remote.Remote(repo, hostname)
logging.info('Mirroring to: ' + mirror) if r in repo.remotes:
r = repo.remote(hostname)
if 'set_url' in dir(r): # force remote URL if using GitPython 2.x
r.set_url(remote_url)
else:
repo.create_remote(hostname, remote_url)
logging.info('Mirroring to: ' + remote_url)
# sadly index.add don't allow the --all parameter # sadly index.add don't allow the --all parameter
logging.debug('Adding all files to git mirror') logging.debug('Adding all files to git mirror')
@ -368,7 +386,6 @@ def update_servergitmirrors(servergitmirrors, repo_section):
# push for every remote. This will overwrite the git history # push for every remote. This will overwrite the git history
for remote in repo.remotes: for remote in repo.remotes:
branch = 'master'
if remote.name == 'gitlab': if remote.name == 'gitlab':
logging.debug('Writing .gitlab-ci.yml to deploy to GitLab Pages') logging.debug('Writing .gitlab-ci.yml to deploy to GitLab Pages')
with open(os.path.join(git_mirror_path, ".gitlab-ci.yml"), "wt") as out_file: with open(os.path.join(git_mirror_path, ".gitlab-ci.yml"), "wt") as out_file:
@ -387,13 +404,16 @@ def update_servergitmirrors(servergitmirrors, repo_section):
logging.debug('Pushing to ' + remote.url) logging.debug('Pushing to ' + remote.url)
with repo.git.custom_environment(GIT_SSH_COMMAND=ssh_cmd): with repo.git.custom_environment(GIT_SSH_COMMAND=ssh_cmd):
remote.push(branch, force=True, set_upstream=True, progress=progress) pushinfos = remote.push('master', force=True, set_upstream=True, progress=progress)
for pushinfo in pushinfos:
# Reset the gitlab specific stuff before the next remote. if pushinfo.flags & (git.remote.PushInfo.ERROR
if remote.name == 'gitlab': | git.remote.PushInfo.REJECTED
logging.debug('Removing .gitlab-ci.yml now that it has successfully deployed') | git.remote.PushInfo.REMOTE_FAILURE
repo.index.reset('HEAD^') | git.remote.PushInfo.REMOTE_REJECTED):
repo.index.checkout() raise FDroidException(remote.url + ' push failed: ' + str(pushinfo.flags)
+ ' ' + pushinfo.summary)
else:
logging.debug(remote.url + ': ' + pushinfo.summary)
if progress: if progress:
bar.done() bar.done()
@ -507,7 +527,8 @@ def push_binary_transparency(git_repo_path, git_remote):
If the remote is a local directory, make sure it exists, and is a If the remote is a local directory, make sure it exists, and is a
git repo. This is used to move this git repo from an offline git repo. This is used to move this git repo from an offline
machine onto a flash drive, then onto the online machine. machine onto a flash drive, then onto the online machine. Also,
this pulls because pushing to a non-bare git repo is error prone.
This is also used in offline signing setups, where it then also This is also used in offline signing setups, where it then also
creates a "local copy dir" git repo that serves to shuttle the git creates a "local copy dir" git repo that serves to shuttle the git
@ -518,24 +539,36 @@ def push_binary_transparency(git_repo_path, git_remote):
''' '''
import git import git
if os.path.isdir(os.path.dirname(git_remote)) \
and not os.path.isdir(os.path.join(git_remote, '.git')):
os.makedirs(git_remote, exist_ok=True)
repo = git.Repo.init(git_remote)
config = repo.config_writer()
config.set_value('receive', 'denyCurrentBranch', 'updateInstead')
config.release()
logging.info('Pushing binary transparency log to ' + git_remote) logging.info('Pushing binary transparency log to ' + git_remote)
gitrepo = git.Repo(git_repo_path)
origin = git.remote.Remote(gitrepo, 'origin') if os.path.isdir(os.path.dirname(git_remote)):
if origin in gitrepo.remotes: # from offline machine to thumbdrive
origin = gitrepo.remote('origin') remote_path = os.path.abspath(git_repo_path)
if 'set_url' in dir(origin): # added in GitPython 2.x if not os.path.isdir(os.path.join(git_remote, '.git')):
origin.set_url(git_remote) os.makedirs(git_remote, exist_ok=True)
thumbdriverepo = git.Repo.init(git_remote)
local = thumbdriverepo.create_remote('local', remote_path)
else:
thumbdriverepo = git.Repo(git_remote)
local = git.remote.Remote(thumbdriverepo, 'local')
if local in thumbdriverepo.remotes:
local = thumbdriverepo.remote('local')
if 'set_url' in dir(local): # force remote URL if using GitPython 2.x
local.set_url(remote_path)
else:
local = thumbdriverepo.create_remote('local', remote_path)
local.pull('master')
else: else:
origin = gitrepo.create_remote('origin', git_remote) # from online machine to remote on a server on the internet
origin.push('master') gitrepo = git.Repo(git_repo_path)
origin = git.remote.Remote(gitrepo, 'origin')
if origin in gitrepo.remotes:
origin = gitrepo.remote('origin')
if 'set_url' in dir(origin): # added in GitPython 2.x
origin.set_url(git_remote)
else:
origin = gitrepo.create_remote('origin', git_remote)
origin.push('master')
def main(): def main():

View file

@ -80,7 +80,10 @@ def main():
try: try:
net.download_file(url, dldir=tmp_dir) net.download_file(url, dldir=tmp_dir)
except requests.exceptions.HTTPError as e: except requests.exceptions.HTTPError as e:
raise FDroidException('Downloading %s failed. %s', (url, e)) try:
net.download_file(url.replace('/repo', '/archive'), dldir=tmp_dir)
except requests.exceptions.HTTPError as e:
raise FDroidException('Downloading %s failed. %s', (url, e))
compare_result = common.verify_apks( compare_result = common.verify_apks(
remoteapk, remoteapk,

View file

@ -6,16 +6,6 @@ Issue Tracker:https://dev.guardianproject.info/projects/checkey/issues
Bitcoin:1Fi5xUHiAPRKxHvyUGVFGt9extBe8Srdbk Bitcoin:1Fi5xUHiAPRKxHvyUGVFGt9extBe8Srdbk
Auto Name:Checkey Auto Name:Checkey
Summary:Info on local apps
Description:
Checkey is a utility for getting information about the APKs that are installed
on your device. Starting with a list of all of the apps that you have
installed on your device, it will show you the APK signature with a single
touch, and provides links to virustotal.com and androidobservatory.org to
easily access the profiles of that APK. It will also let you export the
signing certificate and generate ApkSignaturePin pin files for use with the
TrustedIntents library.
.
Current Version Code:9999999 Current Version Code:9999999

View file

@ -0,0 +1 @@
Checkey is a utility for getting information about the APKs that are installed on your device. Starting with a list of all of the apps that you have installed on your device, it will show you the APK signature with a single touch, and provides links to virustotal.com and androidobservatory.org to easily access the profiles of that APK. It will also let you export the signing certificate and generate ApkSignaturePin pin files for use with the TrustedIntents library.

View file

@ -0,0 +1 @@
Info on local apps

View file

@ -1051,24 +1051,20 @@ test `grep '<mirror>' archive/index.xml | wc -l` -eq 2
cd binary_transparency cd binary_transparency
[ `git rev-list --count HEAD` == "1" ] [ `git rev-list --count HEAD` == "1" ]
cd .. cd ..
if have_git_2_3; then $fdroid server update --verbose
$fdroid server update --verbose grep -F '<application id=' $LOCAL_COPY_DIR/repo/index.xml > /dev/null
grep -F '<application id=' $LOCAL_COPY_DIR/repo/index.xml > /dev/null cd $ONLINE_ROOT
cd $ONLINE_ROOT echo "local_copy_dir = '$LOCAL_COPY_DIR'" >> config.py
echo "local_copy_dir = '$LOCAL_COPY_DIR'" >> config.py echo "sync_from_local_copy_dir = True" >> config.py
echo "sync_from_local_copy_dir = True" >> config.py echo "serverwebroots = '$SERVERWEBROOT'" >> config.py
echo "serverwebroots = '$SERVERWEBROOT'" >> config.py echo "servergitmirrors = '$SERVER_GIT_MIRROR'" >> config.py
echo "servergitmirrors = '$SERVER_GIT_MIRROR'" >> config.py echo "local_copy_dir = '$LOCAL_COPY_DIR'" >> config.py
echo "local_copy_dir = '$LOCAL_COPY_DIR'" >> config.py echo "binary_transparency_remote = '$BINARY_TRANSPARENCY_REMOTE'" >> config.py
echo "binary_transparency_remote = '$BINARY_TRANSPARENCY_REMOTE'" >> config.py $fdroid server update --verbose
$fdroid server update --verbose cd $BINARY_TRANSPARENCY_REMOTE
cd $BINARY_TRANSPARENCY_REMOTE [ `git rev-list --count HEAD` == "1" ]
[ `git rev-list --count HEAD` == "1" ] cd $SERVER_GIT_MIRROR
cd $SERVER_GIT_MIRROR [ `git rev-list --count HEAD` == "1" ]
[ `git rev-list --count HEAD` == "1" ]
else
echo "Skipping test, `git --version` older than 2.3"
fi
#------------------------------------------------------------------------------# #------------------------------------------------------------------------------#

File diff suppressed because it is too large Load diff

View file

@ -1,114 +0,0 @@
<?php
// Class that provides PHP-friendly android permissions information from the raw Andoid source XML files that describes the permissions.
class AndroidPermissions
{
// Path to the AndroidManifest.xml-file from the Android source. Get it from https://raw.github.com/android/platform_frameworks_base/master/core/res/AndroidManifest.xml for example.
private $android_manifest_file_path;
// Path to the strings.xml-file from the Android source. Get it from https://raw.github.com/android/platform_frameworks_base/master/core/res/res/values/strings.xml for example.
private $android_strings_file_path;
// Path to the file where the resulting permissions data will be cached. NOTE: Must be writable by PHP!
private $cache_file_path;
public function __construct($android_manifest_file_path_in = 'AndroidManifest.xml', $android_strings_file_path_in = 'strings.xml', $cache_file_path_in = 'android-permissions.cache') {
$this->android_manifest_file_path = $android_manifest_file_path_in;
$this->android_strings_file_path = $android_strings_file_path_in;
$this->cache_file_path = $cache_file_path_in;
}
// Returns an associative array with android permissions and data about them
function get_permissions_array() {
// Check status of cache
$android_manifest_file_stat = stat($this->android_manifest_file_path);
$android_manifest_file_mtime = $android_manifest_file_stat['mtime'];
$android_strings_file_stat = stat($this->android_strings_file_path);
$android_strings_file_mtime = $android_strings_file_stat['mtime'];
$cache_file_mtime = 0;
if(file_exists($this->cache_file_path)) {
$cache_file_stat = stat($this->cache_file_path);
$cache_file_mtime = $cache_file_stat['mtime'];
}
// If the cache is fresh, use it instead
if($android_manifest_file_mtime < $cache_file_mtime && $android_strings_file_mtime < $cache_file_mtime ) {
$cache_file_handle = fopen($this->cache_file_path, 'r');
$cache_file_content = fread($cache_file_handle, filesize($this->cache_file_path));
fclose($cache_file_handle);
$permissions = unserialize($cache_file_content);
return $permissions;
}
// We are updating the cache, touch the file (note: race condition possible between stating the cache file above and this line...)
touch($this->cache_file_path);
// Get permission raw data from XML
$manifestDoc = new DOMDocument;
$manifestDoc->load($this->android_manifest_file_path);
$manifestXpath = new DOMXPath($manifestDoc);
$stringsDoc = new DOMDocument;
$stringsDoc->load($this->android_strings_file_path);
$stringsXpath = new DOMXPath($stringsDoc);
$comment = '';
foreach ($manifestXpath->query('node()') as $node) {
// Save permissions and permission groups from tags
if($node->nodeName == 'permission-group' || $node->nodeName == 'permission') {
$name = $node->attributes->getNamedItem('name')->value;
$name = substr(strrchr($name,'.'), 1);
// Lookup the human readable title
$labelObject = $node->attributes->getNamedItem('label');
$labelString = $name;
if( $labelObject !== NULL ) {
$labelName = substr(strrchr($labelObject->value,'/'),1);
$labelStringObject = $stringsXpath->query('//string[@name="'.$labelName.'"]');
$labelString = ucfirst($labelStringObject->item(0)->nodeValue);
}
// Lookup the human readable description
$descriptionObject = $node->attributes->getNamedItem('description');
$descriptionString = '(Description missing)';
if($descriptionObject !== NULL) {
$descriptionName = substr(strrchr($descriptionObject->value,'/'),1);
$descriptionStringObject = $stringsXpath->query('//string[@name="'.$descriptionName.'"]');
$descriptionString = ucfirst($descriptionStringObject->item(0)->nodeValue);
}
$permissions[$node->nodeName][$name]['label'] = stripslashes($labelString);
$permissions[$node->nodeName][$name]['description'] = stripslashes($descriptionString);
$permissions[$node->nodeName][$name]['comment'] = stripslashes(str_replace(array("\r\n", "\r", "\n", "\t", ' '), '', $comment));
if($node->nodeName == 'permission') {
$permissionGroupObject = $node->attributes->getNamedItem('permissionGroup');
$permissionGroup = 'none';
if($permissionGroupObject !== NULL) {
$permissionGroup = substr(strrchr($permissionGroupObject->value,'.'), 1);
}
$permissions[$node->nodeName][$name]['permissionGroup'] = $permissionGroup;
$permissions[$node->nodeName][$name]['protectionLevel'] = $node->attributes->getNamedItem('protectionLevel')->value;
}
}
// Cache descriptions from comments preceding the tags
if($node->nodeName == '#comment') {
$comment .= $node->textContent;
}
elseif($node->nodeName != '#text') {
$comment = '';
}
}
// Update cache with serialized permissions
$cache_file_handle = fopen($this->cache_file_path, 'w');
fwrite($cache_file_handle, serialize($permissions));
fclose($cache_file_handle);
return $permissions;
}
}
?>

View file

@ -1,34 +0,0 @@
=== WP FDroid ===
Contributors: CiaranG
Tags: android, repository
Requires at least: 2.9
Tested up to: 2.9
Stable tag: 0.1
Provides the ability to browse the contents of an FDroid repository.
== Description ==
This plugin provides the ability to browse the contents of an FDroid
repository. The repository browser can be inserted into the site by
creating a page containing the 'fdroidrepo' shortcode.
License: GPL v3
== Installation ==
1. Download and extract the zip file.
2. Upload the plugin directory to /wp-content/plugins on your server.
3. Go to the Plugins screen in your Wordpress Admin and activate it.
== Frequently Asked Questions ==
= Is this finished? =
No it isn't. I'm working on it.
== Screenshots ==
1. There isn't one yet actually.

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff