mirror of
https://github.com/saphid/frame-control.git
synced 2026-10-06 08:00:32 +02:00
Refuse APK entries Android can't read; ignore stale title lists
- Only stored and deflated entries are read: Python 3.9's bzip2 and lzma readers inflate without bound before trimming. - loadTitles drops a response that a newer request has overtaken, so the install dialog's replace warning uses the fresh list. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
dfacf43e55
commit
fd0a284942
3 files changed
+20
-4
No files matched your search
@@ -165,6 +165,14 @@ class ApkInfo(unittest.TestCase):
|
||||
frame_apk.MAX_MANIFEST = limit
|
||||
self.assertLess(peak, 8 * 1024**2)
|
||||
|
||||
def test_refuses_compression_android_cant_read(self):
|
||||
for method in (zipfile.ZIP_BZIP2, zipfile.ZIP_LZMA):
|
||||
buf = io.BytesIO()
|
||||
with zipfile.ZipFile(buf, 'w', method) as z:
|
||||
z.writestr('AndroidManifest.xml', manifest('com.example.odd', 0x7f010000, 0x7f010001, 21))
|
||||
with self.assertRaisesRegex(frame_apk.ApkError, 'compression'):
|
||||
self.read(buf.getvalue())
|
||||
|
||||
def test_reference_cycles_and_fan_out_are_bounded(self):
|
||||
res = frame_apk.Resources(b'')
|
||||
ref = frame_apk.T_REF
|
||||
|
||||
Reference in new issue
Block a user