Skip to content

Commit 4870f69

Browse files
committed
fix(repro): use Python zipfile instead of zip command
F-Droid build env doesn't have zip. Use Python zipfile module to remove META-INF/com and META-INF/services directories. — opus-4.5
1 parent d66ddc9 commit 4870f69

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,16 +161,23 @@ jobs:
161161
done
162162
163163
# REPRODUCIBILITY: Delete non-deterministic files that excludes didn't catch
164+
# Uses Python zipfile to match F-Droid postbuild (which doesn't have zip command)
164165
- name: Remove non-deterministic metadata
165166
run: |
166167
cd build/outputs/apk/release
167168
for apk in *.apk; do
168169
echo "Removing metadata from $apk..."
169-
# Remove AGP build metadata
170-
zip -d "$apk" 'META-INF/com/android/build/gradle/*' 2>/dev/null || true
171-
# Remove kotlinx.coroutines service files (not covered by v2/v3 signature)
172-
zip -d "$apk" 'META-INF/services/kotlinx.coroutines.internal.MainDispatcherFactory' 2>/dev/null || true
173-
zip -d "$apk" 'META-INF/services/kotlinx.coroutines.CoroutineExceptionHandler' 2>/dev/null || true
170+
python3 -c "
171+
import zipfile, sys, tempfile, shutil
172+
apk = sys.argv[1]
173+
tmp = tempfile.mktemp('.apk')
174+
with zipfile.ZipFile(apk) as z:
175+
with zipfile.ZipFile(tmp, 'w') as o:
176+
for i in z.infolist():
177+
if not (i.filename.startswith('META-INF/com/') or i.filename.startswith('META-INF/services/')):
178+
o.writestr(i, z.read(i.filename))
179+
shutil.move(tmp, apk)
180+
" "$apk"
174181
done
175182

176183
# Sign the APKs with our release key after fixes

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ dependencies {
5050
// UPDATE ONLY THESE THREE VALUES FOR A NEW RELEASE:
5151
ext.VERSION_MAJOR = 1
5252
ext.VERSION_MINOR = 1
53-
ext.VERSION_PATCH = 58
53+
ext.VERSION_PATCH = 59
5454
// =============================================================================
5555
// DERIVED VALUES (auto-calculated, do not edit):
5656
// - versionCode = MAJOR*10000 + MINOR*100 + PATCH

0 commit comments

Comments
 (0)