Name Date Size #Lines LOC

..--

annotations-src/android/hosttest/annotation/H25-Apr-2025-409112

helper-runtime-src/com/android/hoststubgen/hosthelper/H25-Apr-2025-461231

invoketest/H25-Apr-2025-250172

scripts/H25-Apr-2025-258144

src/com/android/hoststubgen/H25-Apr-2025-6,0343,920

test/com/android/hoststubgen/H25-Apr-2025-302202

test-tiny-framework/H25-Apr-2025-27,53125,265

.gitignoreH A D25-Apr-202541 54

Android.bpH A D25-Apr-20254.5 KiB172154

README.mdH A D25-Apr-20252.4 KiB7950

common.shH A D25-Apr-20252.8 KiB11770

framework-policy-override.txtH A D25-Apr-20254.8 KiB10687

hoststubgen-standard-options.txtH A D25-Apr-20251.2 KiB4429

jarjar-rules.txtH A D25-Apr-202569 22

README.md

1# HostStubGen
2
3## Overview
4
5HostStubGen is a tool built for ravenwood. It can read an Android framework jar file
6(such as `framework-minus-apex.jar` or `framework-all.jar`) and
7converts them, so that they can be used on the Ravenwood environment.
8
9This directory contains the HostStubGen source code, tests and some library source files
10used at runtime.
11
12- HostStubGen itself is design to be agnostic to Android. It doesn't use any Android APIs
13(hidden or not). But it may use Android specific knowledge -- e.g. as of now,
14AndroidHeuristicsFilter has hardcoded heuristics to detect AIDL generated classes.
15
16- `test-tiny-framework/` contains basic tests that are agnostic to Android.
17
18- More Android specific build files and code are stored in `frameworks/base/Ravenwood.bp`
19  `frameworks/base/ravenwood`.
20
21## Directories and files
22
23- `src/`
24
25  HostStubGen tool source code.
26
27- `annotations-src/` See `Android.bp`.
28- `helper-framework-buildtime-src/` See `Android.bp`.
29- `helper-framework-runtime-src/` See `Android.bp`.
30- `helper-runtime-src/` See `Android.bp`.
31
32- `test-tiny-framework/` See `README.md` in it.
33
34- `scripts`
35  - `dump-jar.sh`
36
37    A script to dump the content of `*.class` and `*.jar` files.
38
39  - `run-all-tests.sh`
40
41    Run all tests. Many tests may fail, but at least this should run til the end.
42    (It should print `run-all-tests.sh finished` at the end)
43
44## Build and run
45
46### Building `HostStubGen` binary
47
48```
49m hoststubgen
50```
51
52### Run the tests
53
54- Run all relevant tests and test scripts. All of it is expected to pass, and it'll print
55  "Ready to submit" at the end.
56
57  However, because some of the script it executes depend on internal file paths to Soong's
58  intermediate directory, some of it might fail when something changes in the build system.
59
60  We need proper build system integration to fix them.
61```
62$ ./scripts/run-all-tests.sh
63```
64
65- See also `README.md` in `test-*` directories.
66
67## TODOs, etc
68
69 - Make sure the parent's visibility is not smaller than the member's.
70
71- @HostSideTestNativeSubstitutionClass should automatically add class-keep to the substitute class.
72  (or at least check it.)
73
74 - The `HostStubGenTest-framework-test-host-test-lib` jar somehow contain all ASM classes? Figure out where the dependency is coming from.
75
76- At some point, we can move or delete all Android specific code to `frameworks/base/ravenwood`.
77  - `helper-framework-*-src` should be moved to `frameworks/base/ravenwood`
78  - `test-framework` should be deleted.
79