]>
glassweightruler.freedombox.rocks Git - waydroid.git/blob - tools/helpers/protocol.py
1 from tools
import helpers
5 # Call me with rootfs mounted!
6 def set_aidl_version(args
):
7 cfg
= tools
.config
.load(args
)
10 android_api
= int(helpers
.props
.file_get(args
,
11 tools
.config
.defaults
["rootfs"] + "/system/build.prop",
12 "ro.build.version.sdk"))
14 logging
.error("Failed to parse android version from system.img")
17 binder_protocol
= "aidl"
19 elif android_api
< 30:
20 binder_protocol
= "aidl2"
22 elif android_api
< 31:
23 binder_protocol
= "aidl3"
25 elif android_api
< 33:
26 binder_protocol
= "aidl4"
29 binder_protocol
= "aidl3"
32 cfg
["waydroid"]["binder_protocol"] = binder_protocol
33 cfg
["waydroid"]["service_manager_protocol"] = sm_protocol
34 tools
.config
.save(args
, cfg
)