Warning
This guide is for experienced users who know how to unpack/modify/repacksystemimages and flash them safely.
You do this entirely at your own risk – bootloops and data loss are possible.
- Device on Android 15 with a system layout like
system_root/system/...(In this case is ExtremeRom 2.6.0 used) - Target device family: beyondx in this example (Galaxy S10 series family, adjust to your exact variant, tested on S10/e/+/5G)
- Access to:
- Your current ROM’s
system/system_ext - The stock Samsung ROM for your device (latest Version) for original libraries and APKs
- Your current ROM’s
- Tools:
- Linux/WSL or similar environment for resigning
patchelf- APK tooling:
apktool,zipalign,apksigner(or equivalent) - Image tools: payload dumper / simg2img / etc., depending on how your ROM ships the
systemimage
- Platform keys (or the keys your ROM uses) to re-sign priv-apps
- Ability to flash modified
system/system_ext(fastboot, Odin, custom recovery, etc.) - A brain
- Common sense (optional)
- Ability to read (IMPORTANT)
-
Extract your ROM’s
systempartition to a working directory so you have:system_root/ system/ system_ext/ -
Extract the stock ROM somewhere else (for example
stock/) – you will copy several.sofiles and APKs from there.
Place the faced binary into:
system_root/system/bin/faced
Set the SELinux file context for it to:
/system/bin/faced u:object_r:faced_exec:s0
How you apply this depends on your ROM: usually via
file_contexts/file_contexts.binor.ciloverlays.
Add the init rc file:
system_root/system/etc/init/faced.rc
Ensure faced.rc defines the service faced entry pointing at /system/bin/faced and running in the faced SELinux domain.
In system_root/system/etc/Permissions:
-
Add:
system_root/system/etc/Permissions/privapp-permissions-com.samsung.android.biometrics.app.setting.xml system_root/system/etc/Permissions/biofaceservice.xml -
Remove:
system_root/system/etc/Permissions/android.hardware.biometrics.face.xml
This removes the generic AOSP face permission definition and replaces it with Samsung face-related permissions.
Replace or patch:
system_root/system/framework/framework.jar
with the patched version from this repo (the one prepared for this System Faced setup).
Add:
system_root/system/lib64/hw/face.default.so
(From stock ROM)
From the stock ROM, copy and overwrite the following into your working tree:
system_root/system/lib64/android.hardware.biometrics.face@1.0.so
system_root/system/lib64/libsecfr_engine.so
system_root/system/lib64/libsecfr_model.so
system_root/system/lib64/libteecl.so
system_root/system/lib64/vendor.samsung.hardware.biometrics.face@2.0.so
These are Samsung’s face biometrics libraries needed for the service.
From stock, take:
libFaceService.solibutils.solibstagefright_foundation.so
Then, in your working system_root, place them as:
system_root/system/lib64/libFaceService.so
system_root/system/lib64/libstagefright_foundation_face.so
system_root/system/lib64/libutils_face.so
Now run patchelf on libFaceService.so in your working tree:
cd system_root/system/lib64
patchelf --replace-needed libstagefright_foundation.so libstagefright_foundation_face.so libFaceService.so
patchelf --replace-needed libutils.so libutils_face.so libFaceService.soThis avoids conflicts with the system-wide libutils and libstagefright_foundation which would lead to bootloops.
You must ensure the following priv-apps exist and are patched/resigned as needed. You NEED to resign them, otherwise - Bootloop.
-
Add BioFaceService:
system_root/system/priv-app/BioFaceService/ (directory) system_root/system/priv-app/BioFaceService/BioFaceService.apk -
Patch from repo and replace existing:
system_root/system/priv-app/BiometricSetting/BiometricSetting.apk system_root/system/priv-app/SecSettings/SecSettings.apk system_root/system/system_ext/priv-app/SystemUI/SystemUI.apk -
Re-sign with the correct keys (matching your ROM’s platform / priv-app keys):
BioFaceService.apkBiometricSetting.apkSecSettings.apkSystemUI.apk- Any modified framework components if needed (
framework.jar, etc.)
Ensure you run zipalign and apksigner (or equivalent) on any rebuilt APKs, then verify signatures.
Edit:
system_root/system/system_ext/etc/selinux/system_ext_sepolicy.cil
Append/merge the following definitions and rules:
(roletype object_r ewlogd_exec)
(type faced)
(roletype object_r faced)
(type faced_exec)
(roletype object_r faced_exec)
(type faced_service)
(roletype object_r faced_service)
(typetransition init ewlogd_exec process ewlogd)
(allow init faced_exec (file (read getattr map execute open)))
(allow init faced (process (transition)))
(allow faced faced_exec (file (read getattr map execute open entrypoint)))
(dontaudit init faced (process (noatsecure)))
(allow init faced (process (siginh rlimitinh)))
(typetransition init faced_exec process faced)
(allow faced servicemanager (binder (call transfer)))
(allow servicemanager faced (binder (call transfer)))
(allow servicemanager faced (dir (search)))
(allow servicemanager faced (file (read open)))
(allow servicemanager faced (process (getattr)))
(allow faced system_server (binder (call)))
(allow faced system_app (binder (call)))
(allow faced permission_service (service_manager (find)))
(allow faced activity_service (service_manager (find)))
(allow faced faced_service (service_manager (add)))
(allow system_server faced_service (service_manager (find)))
(allow system_app faced_service (service_manager (add)))
(allow system_server faced_service (service_manager (find)))
(typeattributeset domain (... faced ...))
(typeattributeset file_type (... face_vendor_data_file ... faced_exec ...))
(typeattributeset exec_type (... faced_exec ...))
(typeattributeset system_file_type (... faced_exec ...))
(typeattributeset app_api_service (... face_service ... smartfaceservice_service ...))
(typeattributeset service_manager_type (... face_service ... faced_service ... smartfaceservice_service ...))
(typeattributeset binderservicedomain (... faced ...))
(typeattributeset coredomain (... faced ...))Notes:
- The
...entries mean: addfaced/faced_exec/faced_serviceetc. into the existingtypeattributesetlists instead of duplicating the entire definition. - After editing, validate SELinux policies with your ROM’s build tools (if available) to avoid boot issues.
Edit:
system_root/system/build.prop
- Change:
ro.product.system.name=r12sxxxto:
ro.product.system.name=beyondxxxx(adjust to your exact device family identifier, THIS IS IMPORTANT).
- Add or adjust the device property (depending on your device, THIS TOO):
ro.product.device=beyondxEnsure these values match what Samsung expects for your device. This matters because in the libsecfr components Samsung compares the ro.product.device= string against beyondx to enable if the device is a S10 5G the second ToF camera.
Following this, the setup crashes on a missing cam, or a TEE which rejects missing data, depending on which device you would mess up.
-
Repack your modified
system_rootinto a propersystemimage. -
Flash the modified
system.imgvia your usual method -
After flashing:
- Wipe Dalvik / ART cache.
- Optionally wipe cache to prevent leftover issues.
-
Boot the device.
After boot:
- Verify that the
facedservice is running (for example vialogcatorps -A | grep faced). - Check
logcatfor SELinux denials (avc: denied) related tofacedor face services and adjust policy if needed. - Open Settings → Biometrics / Face (exact path depends on ROM/Samsung base):
- Confirm that Face Unlock / Face Registration options appear and works.
- Register a face and test face unlock / authentication.
Add:
system_root/system/bin/facedsystem_root/system/etc/init/faced.rcsystem_root/system/etc/Permissions/privapp-permissions-com.samsung.android.biometrics.app.setting.xmlsystem_root/system/etc/Permissions/biofaceservice.xml- patched
system_root/system/framework/framework.jar system_root/system/lib64/hw/face.default.sosystem_root/system/lib64/android.hardware.biometrics.face@1.0.sosystem_root/system/lib64/libsecfr_engine.sosystem_root/system/lib64/libsecfr_model.sosystem_root/system/lib64/libteecl.sosystem_root/system/lib64/vendor.samsung.hardware.biometrics.face@2.0.sosystem_root/system/lib64/libFaceService.so(with patched dependencies)system_root/system/lib64/libstagefright_foundation_face.sosystem_root/system/lib64/libutils_face.sosystem_root/system/priv-app/BioFaceService/BioFaceService.apk- patched:
system_root/system/priv-app/BiometricSetting/BiometricSetting.apksystem_root/system/priv-app/SecSettings/SecSettings.apksystem_root/system/system_ext/priv-app/SystemUI/SystemUI.apk
- SELinux rules in
system_root/system/system_ext/etc/selinux/system_ext_sepolicy.cil
Remove:
system_root/system/etc/Permissions/android.hardware.biometrics.face.xml
Edit:
system_root/system/build.prop- SELinux file contexts (for
/system/bin/faced) - Policy file
system_ext_sepolicy.cil
Use this README as your step-by-step checklist while building and flashing your System Faced setup on Android 15.
The sign_apk function wraps the apksigner binary so you can quickly sign APKs from the current directory using a predefined signer directory containing:
apksigner– the signing tool (e.g. from the Android build output)platform.pk8– the private keyplatform.x509.pem– the certificate
By default, the signer directory is expected at:
$HOME/Desktop/signerYou can adjust this path in the function if your setup differs.
Add the following function to your shell configuration (e.g. ~/.bashrc, ~/.zshrc):
sign_apk() {
local APK_NAME="$1"
local SIGNER_DIR="$HOME/Desktop/signer"
if [ -z "$APK_NAME" ]; then
echo "Usage: sign_apk <apk-name-in-current-dir>"
return 1
fi
"$SIGNER_DIR/apksigner" sign --key "$SIGNER_DIR/platform.pk8" --cert "$SIGNER_DIR/platform.x509.pem" --out "$SIGNER_DIR/$APK_NAME" "$PWD/$APK_NAME"
}After adding it, reload your shell configuration, for example:
source ~/.bashrc
# or
source ~/.zshrc- Copy the APK you want to sign into any directory.
- Make sure the
apksignerbinary and the platform key/cert files exist in your signer directory:$HOME/Desktop/signer/apksigner$HOME/Desktop/signer/platform.pk8$HOME/Desktop/signer/platform.x509.pem
- From the directory containing the APK, run:
sign_apk my-app-unsigned.apk- The signed APK will be written to the signer directory as:
$HOME/Desktop/signer/my-app-unsigned.apk(With the same filename you passed to the function.)
- Custom versions of
apksignercan be downloaded or built from the Android Open Source Project (AOSP) repositories. - In a typical Android build tree,
apksignerand the platform keys are available in the build output. For example, theplatform.pk8andplatform.x509.pemfiles are part of the standard AOSP platform signing keys used to sign system images.
Note: The AOSP default platform keys are publicly known and are intended for development/testing only. Do not use them for production builds.
- Works on latest s24fe Base
- Tested successfully on S10e, S10, S10+, S10 5G. Thanks to all the testers <3
---Made with luuuvvvve by Crecker---
- Please apply the patches with one line of fuzz to ensure that the hashes dont cause trouble
git apply -C1 patch.diff