diff --git a/.github/workflows/magisk.yml b/.github/workflows/magisk.yml index db50321..b5823da 100644 --- a/.github/workflows/magisk.yml +++ b/.github/workflows/magisk.yml @@ -226,310 +226,78 @@ jobs: sudo find system/product/{app,etc,overlay,priv-app} -type f -exec chcon --reference=system/product/etc/permissions/privapp-permissions-venezia.xml {} \; sudo ./magisk/magiskpolicy --load system/vendor/etc/selinux/precompiled_sepolicy --save system/vendor/etc/selinux/precompiled_sepolicy "allow gmscore_app gmscore_app vsock_socket { create connect write read }" "allow gmscore_app device_config_runtime_native_boot_prop file read" + - name: Fix GApps prop + shell: sudo python {0} + run: | + from __future__ import annotations + from io import TextIOWrapper + from os import system + from typing import OrderedDict - sudo tee system/product/build.prop < None: + super().__init__() + for i, line in enumerate(file.read().splitlines(False)): + if '=' in line: + k, v = line.split('=', 2) + self[k] = v + else: + self[f".{i}"] = line - sudo tee system/build.prop < str: + return '\n'.join([v if k.startswith('.') else f"{k}={v}" for k, v in self.items()]) - # - # ADDITIONAL_BUILD_PROPERTIES - # - ro.treble.enabled=true - net.bt.name=Android + def __iadd__(self, other: str) -> Prop: + self[f".{len(self)}"] = other + return self - ro.build.fingerprint=google/redfin/redfin:12/SPB5.210812.002/7671067:user/release-keys - ro.product.brand=google - ro.product.device=redfin - ro.product.manufacturer=Google - ro.product.model=Pixel 5 - ro.product.name=redfin - EOF - sudo tee system/system/build.prop < str: + return f"{p[f'ro.{sec}.build.flavor']} {p[f'ro.{sec}.build.version.release_or_codename']} {p[f'ro.{sec}.build.id']} {p[f'ro.{sec}.build.version.incremental']} {p[f'ro.{sec}.build.tags']}" - sudo tee system/system_ext/build.prop < str: + return f"""{p[f"ro.product.{sec}.brand"]}/{p[f"ro.product.{sec}.name"]}/{p[f"ro.product.{sec}.device"]}:{p[f"ro.{sec}.build.version.release"]}/{p[f"ro.{sec}.build.id"]}/{p[f"ro.{sec}.build.version.incremental"]}:{p[f"ro.{sec}.build.type"]}/{p[f"ro.{sec}.build.tags"]}""" - # GSI disables non-AOSP nnapi extensions on product partition - ro.nnapi.extensions.deny_on_product=true - # TODO(b/120679683): disable RescueParty before all problem apps solved - persist.sys.disable_rescue=true + def fix_prop(sec, prop): + print(f"fixing {prop}", flush=True) + with open(prop, 'r') as f: + p = Prop(f) - # TODO(b/78105955): disable privapp_permissions checking before the bug solved - ro.control_privapp_permissions=disable + p += "# extra prop added by MagiskOnWSA" - # TODO(b/136212765): the default for LMK - ro.lmk.kill_timeout_ms=100 - # end of build/make/target/board/gsi_system_ext_user.prop - # - # ADDITIONAL SYSTEM_EXT BUILD PROPERTIES - # - ro.setupwizard.mode=DISABLED - EOF - - sudo tee system/vendor/build.prop <