NativeScript / NativeScript/android
buildMetaData task doesn't generate reproducible binaries
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- C++
- Star
- 563
- Fork
- 144
- Merge trung bình
- 10 giờ 46 phút
- Pull request đã merge (30 ngày)
- 14
Mô tả
Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):
- CLI: 9.0.1
- Cross-platform modules:
- Android Runtime: 8.9.2 and 9.0.0
- iOS Runtime (if applicable): -
- Plugin(s): -
Describe the bug
buildMetaData task generates metadata binaries that are not deterministic and reproducible, Even with the same --compileSdk version set and exact Java, SDK, etc.. So, security checks will fail specially in opensource app stores like IzzyOnDroid and F-Droid.
The issue might be related to using methods like listFiles() without performing a sort on files or maybe different locale properties, I'm just guessing from my researches.
I've attached a diffoscope result to see the difference.
To Reproduce
- Generate an APK locally
- Generate the same APK using a docker/podman container or Github actions
- diff the results using any tool like diffoscope
Expected behavior
The metadata binaries should be exactly same for a specific compileSdk without considering which environment its running the buildMetaData task.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách xác định tác vụ buildMetaData trong Android runtime và tái tạo quá trình tạo APK cục bộ cũng như trong môi trường Docker, Podman hoặc GitHub Actions. So sánh các đầu ra bằng diffoscope; hoàn tất có nghĩa là các tệp nhị phân siêu dữ liệu giống hệt nhau từng byte đối với cùng một compileSdk, bất kể môi trường.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- android
- Lĩnh vực
- build-system, mobile-dev
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100