protoloom 0.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. protoloom-0.1.4/.dockerignore +18 -0
  2. protoloom-0.1.4/.gitattributes +13 -0
  3. protoloom-0.1.4/.githooks/commit-msg +12 -0
  4. protoloom-0.1.4/.github/dependabot.yml +40 -0
  5. protoloom-0.1.4/.github/workflows/ci.yml +65 -0
  6. protoloom-0.1.4/.github/workflows/release.yml +175 -0
  7. protoloom-0.1.4/.gitignore +16 -0
  8. protoloom-0.1.4/CONTRIBUTING.md +27 -0
  9. protoloom-0.1.4/Dockerfile +42 -0
  10. protoloom-0.1.4/LICENSE +202 -0
  11. protoloom-0.1.4/Makefile +19 -0
  12. protoloom-0.1.4/PKG-INFO +337 -0
  13. protoloom-0.1.4/README.md +113 -0
  14. protoloom-0.1.4/SECURITY.md +46 -0
  15. protoloom-0.1.4/benchmarks/corpora/tier-a-small/manifest.json +22 -0
  16. protoloom-0.1.4/benchmarks/corpora/tier-a-small/recovered.json +14 -0
  17. protoloom-0.1.4/benchmarks/corpora/tier-a-small/source/cpp-lite-a/schema.proto +11 -0
  18. protoloom-0.1.4/benchmarks/corpora/tier-a-small/source/cpp-lite-b/schema.proto +11 -0
  19. protoloom-0.1.4/benchmarks/corpora/tier-a-small/source/go/go.mod +5 -0
  20. protoloom-0.1.4/benchmarks/corpora/tier-a-small/source/go/go.sum +6 -0
  21. protoloom-0.1.4/benchmarks/corpora/tier-a-small/source/go/main.go +11 -0
  22. protoloom-0.1.4/benchmarks/corpora/tier-a-small/source/go/schema.proto +11 -0
  23. protoloom-0.1.4/benchmarks/corpora/tier-a-small/source/go-tags/go.mod +5 -0
  24. protoloom-0.1.4/benchmarks/corpora/tier-a-small/source/go-tags/go.sum +2 -0
  25. protoloom-0.1.4/benchmarks/corpora/tier-a-small/source/go-tags/main.go +27 -0
  26. protoloom-0.1.4/benchmarks/corpora/tier-a-small/source/matrix.proto +32 -0
  27. protoloom-0.1.4/benchmarks/corpora/tier-a-small/source/path1.proto +9 -0
  28. protoloom-0.1.4/benchmarks/corpora/tier-a-small/source/path1_main.cc +8 -0
  29. protoloom-0.1.4/benchmarks/corpora/tier-a-small/source/path2_main.cc +6 -0
  30. protoloom-0.1.4/benchmarks/corpora/tier-a-small/source/r8-aggressive.pro +4 -0
  31. protoloom-0.1.4/benchmarks/corpora/tier-a-small/source/r8-default.pro +2 -0
  32. protoloom-0.1.4/benchmarks/corpora/tier-a-small/truth.json +14 -0
  33. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/envoy-arena-wrapped/recovered.json +42 -0
  34. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/envoy-arena-wrapped/truth.desc +9 -0
  35. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/envoy-arena-wrapped/truth.json +42 -0
  36. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/envoy-extraction/recovered.json +395 -0
  37. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/envoy-extraction/truth.desc +0 -0
  38. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/envoy-extraction/truth.json +395 -0
  39. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/envoy-helloworld/recovered.json +42 -0
  40. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/envoy-helloworld/truth.desc +0 -0
  41. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/envoy-helloworld/truth.json +42 -0
  42. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/googleapis-date/recovered.json +37 -0
  43. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/googleapis-date/truth.desc +8 -0
  44. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/googleapis-date/truth.json +37 -0
  45. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/googleapis-latlng/recovered.json +30 -0
  46. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/googleapis-latlng/truth.desc +7 -0
  47. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/googleapis-latlng/truth.json +30 -0
  48. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/googleapis-money/recovered.json +37 -0
  49. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/googleapis-money/truth.desc +9 -0
  50. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/googleapis-money/truth.json +37 -0
  51. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/googleapis-month/recovered.json +68 -0
  52. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/googleapis-month/truth.desc +0 -0
  53. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/googleapis-month/truth.json +68 -0
  54. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/googleapis-timeofday/recovered.json +44 -0
  55. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/googleapis-timeofday/truth.desc +9 -0
  56. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/googleapis-timeofday/truth.json +44 -0
  57. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/grpc-health/recovered.json +92 -0
  58. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/grpc-health/truth.desc +0 -0
  59. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/grpc-health/truth.json +92 -0
  60. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/manifest.json +182 -0
  61. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/measurements.json +145 -0
  62. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/protobuf-conformance/recovered.json +265 -0
  63. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/protobuf-conformance/truth.desc +0 -0
  64. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/protobuf-conformance/truth.json +265 -0
  65. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/protobuf-test-messages-proto3/recovered.json +1564 -0
  66. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/protobuf-test-messages-proto3/truth.desc +0 -0
  67. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/protobuf-test-messages-proto3/truth.json +1564 -0
  68. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/protobuf-unittest-proto3/recovered.json +1237 -0
  69. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/protobuf-unittest-proto3/truth.desc +0 -0
  70. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/protobuf-unittest-proto3/truth.json +1237 -0
  71. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/protobuf-well-known-unittest/recovered.json +902 -0
  72. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/protobuf-well-known-unittest/truth.desc +0 -0
  73. protoloom-0.1.4/benchmarks/corpora/tier-a-upstream/protobuf-well-known-unittest/truth.json +902 -0
  74. protoloom-0.1.4/benchmarks/corpora/tier-c-bitwarden/manifest.json +44 -0
  75. protoloom-0.1.4/benchmarks/corpora/tier-c-bitwarden/payload.bin +0 -0
  76. protoloom-0.1.4/benchmarks/corpora/tier-c-bitwarden/recovered.desc +12 -0
  77. protoloom-0.1.4/benchmarks/corpora/tier-c-bitwarden/truth.desc +0 -0
  78. protoloom-0.1.4/benchmarks/corpus/README.md +80 -0
  79. protoloom-0.1.4/benchmarks/corpus/tier-a-upstream-sources.json +117 -0
  80. protoloom-0.1.4/benchmarks/corpus/tier-b-real-apps.json +101 -0
  81. protoloom-0.1.4/benchmarks/corpus/tier-b-real-apps.schema.json +36 -0
  82. protoloom-0.1.4/benchmarks/results.md +679 -0
  83. protoloom-0.1.4/environment.yml +17 -0
  84. protoloom-0.1.4/protoloom.spec +32 -0
  85. protoloom-0.1.4/pyproject.toml +111 -0
  86. protoloom-0.1.4/scripts/__init__.py +0 -0
  87. protoloom-0.1.4/scripts/check_authorship.sh +27 -0
  88. protoloom-0.1.4/scripts/check_dex_oracle.py +38 -0
  89. protoloom-0.1.4/scripts/check_matrix_roundtrip.py +66 -0
  90. protoloom-0.1.4/scripts/compare_pbtk.sh +82 -0
  91. protoloom-0.1.4/scripts/diagnose_real_app.py +320 -0
  92. protoloom-0.1.4/scripts/fetch_real_apps.py +140 -0
  93. protoloom-0.1.4/scripts/no_docstrings.py +20 -0
  94. protoloom-0.1.4/scripts/pbtk_1_1_2_adapter.sh +14 -0
  95. protoloom-0.1.4/scripts/record_readme_demo.sh +42 -0
  96. protoloom-0.1.4/scripts/render_readme_demo.sh +36 -0
  97. protoloom-0.1.4/scripts/run_lite_matrix.sh +110 -0
  98. protoloom-0.1.4/scripts/run_path1_cpp.sh +52 -0
  99. protoloom-0.1.4/scripts/run_path1_go.sh +48 -0
  100. protoloom-0.1.4/scripts/run_path2_cpp.sh +46 -0
  101. protoloom-0.1.4/scripts/run_path2_go.sh +62 -0
  102. protoloom-0.1.4/scripts/run_tier_a_upstream.py +365 -0
  103. protoloom-0.1.4/scripts/set_version.py +34 -0
  104. protoloom-0.1.4/src/protoloom/__init__.py +22 -0
  105. protoloom-0.1.4/src/protoloom/bench/__init__.py +27 -0
  106. protoloom-0.1.4/src/protoloom/bench/corpus.py +332 -0
  107. protoloom-0.1.4/src/protoloom/bench/jsonio.py +60 -0
  108. protoloom-0.1.4/src/protoloom/bench/metrics.py +299 -0
  109. protoloom-0.1.4/src/protoloom/bench/runner.py +256 -0
  110. protoloom-0.1.4/src/protoloom/bench/upstream.py +385 -0
  111. protoloom-0.1.4/src/protoloom/cli.py +956 -0
  112. protoloom-0.1.4/src/protoloom/container/__init__.py +3 -0
  113. protoloom-0.1.4/src/protoloom/container/apk.py +204 -0
  114. protoloom-0.1.4/src/protoloom/container/detect.py +134 -0
  115. protoloom-0.1.4/src/protoloom/container/dex.py +698 -0
  116. protoloom-0.1.4/src/protoloom/container/elf.py +189 -0
  117. protoloom-0.1.4/src/protoloom/container/macho.py +172 -0
  118. protoloom-0.1.4/src/protoloom/container/read.py +33 -0
  119. protoloom-0.1.4/src/protoloom/decode/__init__.py +4 -0
  120. protoloom-0.1.4/src/protoloom/decode/descpb.py +79 -0
  121. protoloom-0.1.4/src/protoloom/decode/fieldtype.py +69 -0
  122. protoloom-0.1.4/src/protoloom/decode/infostring.py +183 -0
  123. protoloom-0.1.4/src/protoloom/decode/lite.py +447 -0
  124. protoloom-0.1.4/src/protoloom/decode/names.py +78 -0
  125. protoloom-0.1.4/src/protoloom/decode/wire.py +308 -0
  126. protoloom-0.1.4/src/protoloom/doctor.py +101 -0
  127. protoloom-0.1.4/src/protoloom/emit/__init__.py +3 -0
  128. protoloom-0.1.4/src/protoloom/emit/dashboard.py +191 -0
  129. protoloom-0.1.4/src/protoloom/emit/descset.py +74 -0
  130. protoloom-0.1.4/src/protoloom/emit/jsonout.py +98 -0
  131. protoloom-0.1.4/src/protoloom/emit/proto.py +363 -0
  132. protoloom-0.1.4/src/protoloom/emit/report.py +80 -0
  133. protoloom-0.1.4/src/protoloom/extract/__init__.py +18 -0
  134. protoloom-0.1.4/src/protoloom/extract/descriptor.py +122 -0
  135. protoloom-0.1.4/src/protoloom/extract/gotags.py +242 -0
  136. protoloom-0.1.4/src/protoloom/extract/gozip.py +39 -0
  137. protoloom-0.1.4/src/protoloom/extract/jadx.py +211 -0
  138. protoloom-0.1.4/src/protoloom/extract/lite.py +977 -0
  139. protoloom-0.1.4/src/protoloom/extract/wire.py +709 -0
  140. protoloom-0.1.4/src/protoloom/model.py +82 -0
  141. protoloom-0.1.4/src/protoloom/py.typed +0 -0
  142. protoloom-0.1.4/src/protoloom/reconcile.py +291 -0
  143. protoloom-0.1.4/src/protoloom/tui/__init__.py +0 -0
  144. protoloom-0.1.4/src/protoloom/tui/application.py +381 -0
  145. protoloom-0.1.4/src/protoloom/tui/jobs.py +155 -0
  146. protoloom-0.1.4/src/protoloom/tui/render.py +120 -0
  147. protoloom-0.1.4/src/protoloom/tui/results.py +136 -0
  148. protoloom-0.1.4/src/protoloom/tui/state.py +51 -0
  149. protoloom-0.1.4/src/protoloom/validate/__init__.py +14 -0
  150. protoloom-0.1.4/src/protoloom/validate/compile.py +107 -0
  151. protoloom-0.1.4/src/protoloom/validate/roundtrip.py +83 -0
  152. protoloom-0.1.4/tests/bench/test_corpus_runner.py +595 -0
  153. protoloom-0.1.4/tests/bench/test_metrics.py +254 -0
  154. protoloom-0.1.4/tests/bench/test_tier_a_upstream.py +846 -0
  155. protoloom-0.1.4/tests/container/test_detect_apk.py +269 -0
  156. protoloom-0.1.4/tests/container/test_dex.py +410 -0
  157. protoloom-0.1.4/tests/container/test_native.py +185 -0
  158. protoloom-0.1.4/tests/container/test_read.py +39 -0
  159. protoloom-0.1.4/tests/decode/test_decode_lite.py +324 -0
  160. protoloom-0.1.4/tests/decode/test_fieldtype.py +40 -0
  161. protoloom-0.1.4/tests/decode/test_infostring.py +208 -0
  162. protoloom-0.1.4/tests/decode/test_names.py +48 -0
  163. protoloom-0.1.4/tests/emit/test_dashboard.py +83 -0
  164. protoloom-0.1.4/tests/emit/test_descset.py +107 -0
  165. protoloom-0.1.4/tests/emit/test_jsonout.py +79 -0
  166. protoloom-0.1.4/tests/emit/test_proto.py +408 -0
  167. protoloom-0.1.4/tests/emit/test_report.py +113 -0
  168. protoloom-0.1.4/tests/extract/test_descriptor.py +152 -0
  169. protoloom-0.1.4/tests/extract/test_gotags.py +158 -0
  170. protoloom-0.1.4/tests/extract/test_jadx.py +280 -0
  171. protoloom-0.1.4/tests/extract/test_lite.py +997 -0
  172. protoloom-0.1.4/tests/extract/test_wire.py +314 -0
  173. protoloom-0.1.4/tests/fixtures/bench/manifest.json +23 -0
  174. protoloom-0.1.4/tests/fixtures/bench/recovered.json +25 -0
  175. protoloom-0.1.4/tests/fixtures/bench/truth.json +24 -0
  176. protoloom-0.1.4/tests/test_bench_cli.py +67 -0
  177. protoloom-0.1.4/tests/test_check_matrix_roundtrip.py +40 -0
  178. protoloom-0.1.4/tests/test_cli.py +206 -0
  179. protoloom-0.1.4/tests/test_cli_commands.py +987 -0
  180. protoloom-0.1.4/tests/test_diagnose_real_app.py +219 -0
  181. protoloom-0.1.4/tests/test_doctor.py +42 -0
  182. protoloom-0.1.4/tests/test_fetch_real_apps.py +178 -0
  183. protoloom-0.1.4/tests/test_model.py +62 -0
  184. protoloom-0.1.4/tests/test_reconcile.py +254 -0
  185. protoloom-0.1.4/tests/test_release_assets.py +103 -0
  186. protoloom-0.1.4/tests/test_run_tier_a_upstream.py +90 -0
  187. protoloom-0.1.4/tests/tui/test_application.py +265 -0
  188. protoloom-0.1.4/tests/tui/test_jobs.py +258 -0
  189. protoloom-0.1.4/tests/tui/test_render.py +118 -0
  190. protoloom-0.1.4/tests/tui/test_results.py +146 -0
  191. protoloom-0.1.4/tests/tui/test_state.py +48 -0
  192. protoloom-0.1.4/tests/validate/test_compile.py +142 -0
  193. protoloom-0.1.4/tests/validate/test_roundtrip.py +98 -0
  194. protoloom-0.1.4/tests/validate/test_tier_c_capture.py +92 -0
  195. protoloom-0.1.4/uv.lock +1034 -0
@@ -0,0 +1,18 @@
1
+ .git
2
+ .github
3
+ .mypy_cache
4
+ .pytest_cache
5
+ .ruff_cache
6
+ .venv
7
+ .protoc
8
+ build
9
+ dist
10
+ htmlcov
11
+ out
12
+ __pycache__
13
+ *.egg-info
14
+ *.pyc
15
+ .coverage
16
+ tests
17
+ docs
18
+ benchmarks
@@ -0,0 +1,13 @@
1
+ * text=auto eol=lf
2
+
3
+ *.dex binary
4
+ *.apk binary
5
+ *.aab binary
6
+ *.so binary
7
+ *.desc binary
8
+ *.pb binary
9
+ *.bin binary
10
+ *.jar binary
11
+ *.class binary
12
+ tests/fixtures/** binary
13
+
@@ -0,0 +1,12 @@
1
+ #!/bin/sh
2
+
3
+ if grep -qiE '^(co-authored-by|generated (with|by)):' "$1"; then
4
+ echo "blocked: commit message carries a foreign attribution trailer"
5
+ exit 1
6
+ fi
7
+
8
+ if grep -i '^signed-off-by:' "$1" | grep -qiv 'Nathan Luevano'; then
9
+ echo "blocked: commit message carries a foreign attribution trailer"
10
+ exit 1
11
+ fi
12
+
@@ -0,0 +1,40 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: uv
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ day: monday
8
+ time: "06:00"
9
+ timezone: America/New_York
10
+ open-pull-requests-limit: 3
11
+ groups:
12
+ python-dependencies:
13
+ patterns:
14
+ - "*"
15
+
16
+ - package-ecosystem: github-actions
17
+ directory: /
18
+ schedule:
19
+ interval: weekly
20
+ day: monday
21
+ time: "06:15"
22
+ timezone: America/New_York
23
+ open-pull-requests-limit: 3
24
+ groups:
25
+ workflow-actions:
26
+ patterns:
27
+ - "*"
28
+
29
+ - package-ecosystem: docker
30
+ directory: /
31
+ schedule:
32
+ interval: weekly
33
+ day: monday
34
+ time: "06:30"
35
+ timezone: America/New_York
36
+ open-pull-requests-limit: 2
37
+ groups:
38
+ container-images:
39
+ patterns:
40
+ - "*"
@@ -0,0 +1,65 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ check:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ with:
17
+ fetch-depth: 0
18
+ - uses: astral-sh/setup-uv@v9.0.0
19
+ with:
20
+ enable-cache: true
21
+ python-version: "3.11"
22
+ - run: uv sync --locked --extra dev --group dev
23
+ - name: Run quality gates
24
+ run: uv run make check
25
+
26
+ compatibility:
27
+ runs-on: ubuntu-latest
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ - uses: astral-sh/setup-uv@v9.0.0
31
+ with:
32
+ enable-cache: true
33
+ python-version: "3.14"
34
+ - run: uv sync --locked --extra dev --group dev
35
+ - name: Run tests on latest supported Python
36
+ run: uv run pytest -q
37
+
38
+ package:
39
+ runs-on: ubuntu-latest
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+ - uses: astral-sh/setup-uv@v9.0.0
43
+ with:
44
+ enable-cache: true
45
+ python-version: "3.11"
46
+ - name: Build distributions
47
+ run: uv build
48
+ - name: Install and run wheel
49
+ run: |
50
+ wheel=$(find dist -name '*.whl' -print -quit)
51
+ test -n "$wheel"
52
+ uv run --isolated --no-project --with "$wheel" protoloom --help
53
+
54
+ authorship:
55
+ runs-on: ubuntu-latest
56
+ steps:
57
+ - uses: actions/checkout@v4
58
+ with:
59
+ fetch-depth: 0
60
+ - name: Check commit authors and trailers
61
+ env:
62
+ BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
63
+ HEAD_SHA: ${{ github.sha }}
64
+ ALLOWED_EMAIL: 81777066+Nathan-Luevano@users.noreply.github.com
65
+ run: scripts/check_authorship.sh
@@ -0,0 +1,175 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ quality:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: astral-sh/setup-uv@v9.0.0
18
+ with:
19
+ enable-cache: true
20
+ python-version: "3.11"
21
+ - run: uv sync --locked --extra dev --group dev
22
+ - name: Run quality gates
23
+ run: uv run make check
24
+
25
+ package:
26
+ needs: quality
27
+ runs-on: ubuntu-latest
28
+ permissions:
29
+ contents: read
30
+ id-token: write
31
+ attestations: write
32
+ artifact-metadata: write
33
+ steps:
34
+ - uses: actions/checkout@v4
35
+ - uses: actions/setup-python@v5
36
+ with:
37
+ python-version: "3.11"
38
+ cache: pip
39
+ - name: Set package version from tag
40
+ if: startsWith(github.ref, 'refs/tags/v')
41
+ env:
42
+ RELEASE_VERSION: ${{ github.ref_name }}
43
+ run: python scripts/set_version.py "${RELEASE_VERSION#v}"
44
+ - run: python -m pip install --upgrade build twine
45
+ - run: python -m build
46
+ - run: python -m twine check dist/*
47
+ - name: Install and run wheel
48
+ run: |
49
+ wheel=$(find dist -name '*.whl' -print -quit)
50
+ test -n "$wheel"
51
+ python -m pip install "$wheel"
52
+ protoloom --help
53
+ - uses: actions/attest@v4
54
+ with:
55
+ subject-path: dist/*
56
+ - uses: actions/upload-artifact@v4
57
+ with:
58
+ name: python-distributions
59
+ path: dist/*
60
+ if-no-files-found: error
61
+
62
+ binaries:
63
+ needs: quality
64
+ strategy:
65
+ fail-fast: false
66
+ matrix:
67
+ include:
68
+ - runner: ubuntu-22.04
69
+ artifact: protoloom-linux-x86_64
70
+ - runner: ubuntu-24.04-arm
71
+ artifact: protoloom-linux-aarch64
72
+ - runner: macos-14
73
+ artifact: protoloom-macos-arm64
74
+ runs-on: ${{ matrix.runner }}
75
+ permissions:
76
+ contents: read
77
+ id-token: write
78
+ attestations: write
79
+ artifact-metadata: write
80
+ steps:
81
+ - uses: actions/checkout@v4
82
+ - uses: actions/setup-python@v5
83
+ with:
84
+ python-version: "3.11"
85
+ cache: pip
86
+ - name: Set package version from tag
87
+ if: startsWith(github.ref, 'refs/tags/v')
88
+ env:
89
+ RELEASE_VERSION: ${{ github.ref_name }}
90
+ run: python scripts/set_version.py "${RELEASE_VERSION#v}"
91
+ - run: python -m pip install . pyinstaller
92
+ - run: pyinstaller --clean --noconfirm protoloom.spec
93
+ - run: dist/protoloom --help
94
+ - run: mv dist/protoloom "dist/${{ matrix.artifact }}"
95
+ - uses: actions/attest@v4
96
+ with:
97
+ subject-path: dist/${{ matrix.artifact }}
98
+ - uses: actions/upload-artifact@v4
99
+ with:
100
+ name: ${{ matrix.artifact }}
101
+ path: dist/${{ matrix.artifact }}
102
+ if-no-files-found: error
103
+
104
+ publish-pypi:
105
+ if: startsWith(github.ref, 'refs/tags/v')
106
+ needs: package
107
+ runs-on: ubuntu-latest
108
+ environment:
109
+ name: pypi
110
+ url: https://pypi.org/project/protoloom/
111
+ permissions:
112
+ id-token: write
113
+ steps:
114
+ - uses: actions/download-artifact@v4
115
+ with:
116
+ name: python-distributions
117
+ path: dist
118
+ - uses: pypa/gh-action-pypi-publish@release/v1
119
+
120
+ container:
121
+ if: startsWith(github.ref, 'refs/tags/v')
122
+ needs: quality
123
+ runs-on: ubuntu-latest
124
+ permissions:
125
+ contents: read
126
+ packages: write
127
+ steps:
128
+ - uses: actions/checkout@v4
129
+ - uses: docker/setup-qemu-action@v3
130
+ - uses: docker/setup-buildx-action@v3
131
+ - uses: docker/login-action@v3
132
+ with:
133
+ registry: ghcr.io
134
+ username: ${{ github.actor }}
135
+ password: ${{ secrets.GITHUB_TOKEN }}
136
+ - uses: docker/metadata-action@v5
137
+ id: meta
138
+ with:
139
+ images: ghcr.io/${{ github.repository }}
140
+ tags: |
141
+ type=semver,pattern={{version}}
142
+ type=semver,pattern={{major}}.{{minor}}
143
+ type=raw,value=latest
144
+ - uses: docker/build-push-action@v6
145
+ with:
146
+ context: .
147
+ platforms: linux/amd64,linux/arm64
148
+ push: true
149
+ tags: ${{ steps.meta.outputs.tags }}
150
+ labels: ${{ steps.meta.outputs.labels }}
151
+ build-args: VERSION=${{ github.ref_name }}
152
+ provenance: mode=max
153
+ sbom: true
154
+ cache-from: type=gha
155
+ cache-to: type=gha,mode=max
156
+
157
+ github-release:
158
+ if: startsWith(github.ref, 'refs/tags/v')
159
+ needs: [package, binaries]
160
+ runs-on: ubuntu-latest
161
+ permissions:
162
+ contents: write
163
+ steps:
164
+ - uses: actions/download-artifact@v4
165
+ with:
166
+ path: release-assets
167
+ merge-multiple: true
168
+ - name: Generate release checksums
169
+ working-directory: release-assets
170
+ run: sha256sum * > SHA256SUMS
171
+ - uses: softprops/action-gh-release@v2
172
+ with:
173
+ files: release-assets/*
174
+ generate_release_notes: true
175
+ fail_on_unmatched_files: true
@@ -0,0 +1,16 @@
1
+ .venv/
2
+ .mypy_cache/
3
+ .pytest_cache/
4
+ .ruff_cache/
5
+ __pycache__/
6
+ *.egg-info/
7
+ build/
8
+ dist/
9
+ .coverage
10
+ htmlcov/
11
+ .protoc/
12
+ out/
13
+ *.apk
14
+ PROTOLOOM-ROADMAP.md
15
+ docs/
16
+ NEXT.md
@@ -0,0 +1,27 @@
1
+ # Contributing
2
+
3
+ Run `make check` before proposing a change. Tests should use the original schema
4
+ as a differential oracle where one exists, and recovered payloads must
5
+ byte-identically round-trip before a recovery claim is treated as confirmed.
6
+
7
+ The project contains no Python docstrings. Use rare, informal comments to
8
+ explain a surprising reason, not to narrate the code.
9
+
10
+ ## Commits
11
+
12
+ Keep one logical change in each commit and use:
13
+
14
+ ```text
15
+ <type>(<scope>): <imperative summary under 72 chars>
16
+
17
+ <why the change exists, wrapped at 80 columns>
18
+ ```
19
+
20
+ Types are `feat`, `fix`, `refactor`, `test`, `bench`, `docs`, `chore`, and
21
+ `perf`. Scopes are `dex`, `lite`, `descriptor`, `native`, `emit`, `bench`,
22
+ `cli`, and `corpus`.
23
+
24
+ Do not add co-author, generator, or foreign sign-off attribution. Commits are
25
+ authored by Nathan Luevano. Any change to measured accuracy must give the before
26
+ and after numbers and update `benchmarks/results.md` in the same commit.
27
+
@@ -0,0 +1,42 @@
1
+ FROM python:3.11-slim-bookworm AS jadx
2
+
3
+ ARG JADX_VERSION=1.5.1
4
+ ARG JADX_SHA256=12fd966431903b8e15c36e5007f19343475be7d8f2a55f082e7a929eeabc937e
5
+
6
+ RUN apt-get update \
7
+ && apt-get install --yes --no-install-recommends ca-certificates curl unzip \
8
+ && curl --fail --location --retry 3 \
9
+ --output /tmp/jadx.zip \
10
+ "https://github.com/skylot/jadx/releases/download/v${JADX_VERSION}/jadx-${JADX_VERSION}.zip" \
11
+ && echo "${JADX_SHA256} /tmp/jadx.zip" | sha256sum --check --strict \
12
+ && mkdir /opt/jadx \
13
+ && unzip -q /tmp/jadx.zip -d /opt/jadx
14
+
15
+ FROM python:3.11-slim-bookworm
16
+
17
+ ARG VERSION=0.1.3
18
+ LABEL org.opencontainers.image.title="PROTOLOOM" \
19
+ org.opencontainers.image.description="Recover protobuf schemas from stripped binaries" \
20
+ org.opencontainers.image.version="${VERSION}" \
21
+ org.opencontainers.image.licenses="Apache-2.0"
22
+
23
+ RUN apt-get update \
24
+ && apt-get install --yes --no-install-recommends \
25
+ default-jre-headless \
26
+ protobuf-compiler \
27
+ && apt-get clean \
28
+ && find /var/lib/apt/lists -mindepth 1 -delete \
29
+ && groupadd --system --gid 65532 protoloom \
30
+ && useradd --system --uid 65532 --gid protoloom --create-home protoloom
31
+
32
+ COPY --from=jadx /opt/jadx /opt/jadx
33
+ COPY . /build/protoloom
34
+ RUN python /build/protoloom/scripts/set_version.py "${VERSION#v}" \
35
+ && python -m pip install --no-cache-dir /build/protoloom \
36
+ && rm -r /build/protoloom \
37
+ && ln -s /opt/jadx/bin/jadx /usr/local/bin/jadx
38
+
39
+ USER protoloom
40
+ WORKDIR /work
41
+ ENTRYPOINT ["protoloom"]
42
+ CMD ["--help"]
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,19 @@
1
+ .PHONY: check test lint typecheck architecture no-docstrings
2
+
3
+ check: lint typecheck no-docstrings architecture test
4
+
5
+ test:
6
+ pytest -q
7
+
8
+ lint:
9
+ ruff check .
10
+ ruff format --check .
11
+
12
+ typecheck:
13
+ mypy
14
+
15
+ architecture:
16
+ lint-imports
17
+
18
+ no-docstrings:
19
+ python scripts/no_docstrings.py