mirror of
https://github.com/f-droid/fdroidserver.git
synced 2026-03-25 02:12:00 -04:00
move 'nativecode' field into internal index-v2 format
This commit is contained in:
committed by
Michael Pöhn
parent
bf81f9f149
commit
f0eedc3ade
@@ -634,7 +634,6 @@ def convert_version(version, app, repodir):
|
||||
|
||||
manifest = version.get("manifest", dict())
|
||||
for element in (
|
||||
"nativecode",
|
||||
"versionName",
|
||||
"maxSdkVersion",
|
||||
):
|
||||
@@ -1412,8 +1411,12 @@ def make_v0(apps, apks, repodir, repodict, requestsdict, signer_fingerprints):
|
||||
permel.setAttribute('maxSdkVersion', str(p23['maxSdkVersion']))
|
||||
apkel.appendChild(permel)
|
||||
permel.setAttribute('name', p23['name'])
|
||||
if 'nativecode' in apk:
|
||||
addElement('nativecode', ','.join(sorted(apk['nativecode'])), doc, apkel) # fmt: skip
|
||||
addElementNonEmpty(
|
||||
'nativecode',
|
||||
','.join(sorted(manifest.get('nativecode', list()))),
|
||||
doc,
|
||||
apkel,
|
||||
)
|
||||
addElementNonEmpty('features', ','.join(sorted(apk['features'])), doc, apkel) # fmt: skip
|
||||
|
||||
if (
|
||||
|
||||
@@ -1936,8 +1936,8 @@ def scan_apk_androguard(apk, apkfile):
|
||||
arch_re = re.compile("^lib/(.*)/.*$")
|
||||
arch = set([arch_re.match(file).group(1) for file in apkobject.get_files() if arch_re.match(file)])
|
||||
if len(arch) >= 1:
|
||||
apk['nativecode'] = []
|
||||
apk['nativecode'].extend(sorted(list(arch)))
|
||||
manifest['nativecode'] = []
|
||||
manifest['nativecode'].extend(sorted(list(arch)))
|
||||
|
||||
for item in xml.findall('uses-permission'):
|
||||
name = item.attrib.get(xmlns + 'name')
|
||||
|
||||
@@ -15,20 +15,20 @@ icons_src:
|
||||
'240': res/drawable-hdpi-v4/icon_launcher.png
|
||||
ipfsCIDv1: bafybeifijmr5ygvfvig4vzbmdc3ysj6m46ddohaol4vgp4qoyooqpc27zu
|
||||
manifest:
|
||||
nativecode:
|
||||
- arm64-v8a
|
||||
- armeabi
|
||||
- armeabi-v7a
|
||||
- mips
|
||||
- mips64
|
||||
- x86
|
||||
- x86_64
|
||||
usesPermission:
|
||||
- name: android.permission.BIND_INPUT_METHOD
|
||||
- name: android.permission.READ_EXTERNAL_STORAGE
|
||||
- name: android.permission.VIBRATE
|
||||
minSdkVersion: 7
|
||||
name: Compass Keyboard
|
||||
nativecode:
|
||||
- arm64-v8a
|
||||
- armeabi
|
||||
- armeabi-v7a
|
||||
- mips
|
||||
- mips64
|
||||
- x86
|
||||
- x86_64
|
||||
packageName: org.dyndns.fules.ck
|
||||
sig: 9bf7a6a67f95688daec75eab4b1436ac
|
||||
signer: 9326a2cc1a2f148202bc7837a0af3b81200bd37fd359c9e13a2296a71d342056
|
||||
|
||||
@@ -923,8 +923,10 @@ class UpdateTest(unittest.TestCase):
|
||||
self.assertEqual(apk_info['packageName'], 'org.dyndns.fules.ck')
|
||||
self.assertEqual(apk_info['versionCode'], 20)
|
||||
self.assertEqual(apk_info['size'], 132453)
|
||||
self.assertEqual(apk_info['nativecode'],
|
||||
['arm64-v8a', 'armeabi', 'armeabi-v7a', 'mips', 'mips64', 'x86', 'x86_64'])
|
||||
self.assertEqual(
|
||||
apk_info['manifest']['nativecode'],
|
||||
['arm64-v8a', 'armeabi', 'armeabi-v7a', 'mips', 'mips64', 'x86', 'x86_64'],
|
||||
)
|
||||
self.assertEqual(apk_info['minSdkVersion'], 7)
|
||||
self.assertEqual(apk_info['sig'], '9bf7a6a67f95688daec75eab4b1436ac')
|
||||
self.assertEqual(apk_info['hashType'], 'sha256')
|
||||
@@ -1907,6 +1909,15 @@ class UpdateTest(unittest.TestCase):
|
||||
'-1': 'res/drawable-mdpi-v4/icon_launcher.png',
|
||||
},
|
||||
'manifest': {
|
||||
'nativecode': [
|
||||
'arm64-v8a',
|
||||
'armeabi',
|
||||
'armeabi-v7a',
|
||||
'mips',
|
||||
'mips64',
|
||||
'x86',
|
||||
'x86_64',
|
||||
],
|
||||
'usesPermission': [
|
||||
{'name': 'android.permission.BIND_INPUT_METHOD'},
|
||||
{'name': 'android.permission.READ_EXTERNAL_STORAGE'},
|
||||
@@ -1919,15 +1930,6 @@ class UpdateTest(unittest.TestCase):
|
||||
'minSdkVersion': 7,
|
||||
'name': 'Compass Keyboard',
|
||||
'targetSdkVersion': 8,
|
||||
'nativecode': [
|
||||
'arm64-v8a',
|
||||
'armeabi',
|
||||
'armeabi-v7a',
|
||||
'mips',
|
||||
'mips64',
|
||||
'x86',
|
||||
'x86_64',
|
||||
],
|
||||
},
|
||||
)
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user