GmsCore icon indicating copy to clipboard operation
GmsCore copied to clipboard

Face detection

Open Iey4iej3 opened this issue 8 months ago • 6 comments

According to https://github.com/microg/GmsCore/releases/tag/v0.3.7.250932, there are some initial support for face recognition.

I tried N26. Unfortunately, the APP continuously complains that face is not detected. I look at the log, and I am unable to figure out what is lacking.

Iey4iej3 avatar Apr 25 '25 13:04 Iey4iej3

This release ships with initial support for Google's Face Detection API. This functionality is still very incomplete, but works for some apps using it.

It's explained in the release notes.

This release ships with initial support for Google's Face Detection API. This functionality is still very incomplete, but works for some apps using it.

It's explained in the release notes.

I saw this. I want to be more precise — what API / functionality is yet to implement? I look at the log, and it does not seem to contain any explicit error claiming that some service does not exist, say.

Iey4iej3 avatar Apr 26 '25 21:04 Iey4iej3

One thing that's not implemented yet is the head rotation vector. That might be used for liveness detection (as it's harder to fake with a sheet of paper) in banking apps.

mar-v-in avatar Apr 27 '25 08:04 mar-v-in

General commentary:

I find the addition of facial recognition tools in GmsCore kind of shocking, considering how often such tools are used for grotesque privacy abuses by various entities around the world.

Is this implementation going to do anything to work against such abuses, or just help facilitate them?

Sapiosenses avatar Apr 29 '25 00:04 Sapiosenses

The feature implemented is actually Face Detection, not Face Recognition.

  • Face Recognition is used to match people's faces against a set of known faces to identify people.
  • Face Detection is used to used to see if and where there is a face in a picture and certain basic properties of such faces (like position of eyes and nose within the face)

That said, I see little abuse potential for both of these if they're executed as open source software on a user's device. Nonetheless, in the future we might opt to allow users to decide if apps are allowed to use this API or not.

mar-v-in avatar Apr 29 '25 07:04 mar-v-in

As breadcrumbs, here's the stacktrace from N26's app when it crashes while trying to init the biometrics:

10-21 12:49:33.719 27434 27501 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-21 12:49:33.719 27434 27501 F DEBUG   : LineageOS Version: 'unknown'
10-21 12:49:33.719 27434 27501 F DEBUG   : Build fingerprint: 'Fairphone/FP4eea/FP4:13/TKQ1.230127.002/TP2V:user/release-keys'
10-21 12:49:33.719 27434 27501 F DEBUG   : Revision: '0'
10-21 12:49:33.719 27434 27501 F DEBUG   : ABI: 'arm64'
10-21 12:49:33.719 27434 27501 F DEBUG   : Timestamp: 2025-10-21 12:49:33.433004816+0200
10-21 12:49:33.719 27434 27501 F DEBUG   : Process uptime: 5297s
10-21 12:49:33.719 27434 27501 F DEBUG   : Cmdline: de.number26.android
10-21 12:49:33.719 27434 27501 F DEBUG   : pid: 27434, tid: 27501, name: DefaultDispatch  >>> de.number26.android <<<
10-21 12:49:33.719 27434 27501 F DEBUG   : uid: 10238
10-21 12:49:33.719 27434 27501 F DEBUG   : tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE)
10-21 12:49:33.719 27434 27501 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr --------
10-21 12:49:33.719 27434 27501 F DEBUG   : Cause: null pointer dereference
10-21 12:49:33.719 27434 27501 F DEBUG   :     x0  0000000000000000  x1  00000000000000c2  x2  0000000000000004  x3  0000000000000000
10-21 12:49:33.719 27434 27501 F DEBUG   :     x4  0000000000000010  x5  000000701025bcbc  x6  0000000000000001  x7  7f7f7f7f7f7f7f7f
10-21 12:49:33.719 27434 27501 F DEBUG   :     x8  0000000000f0bf03  x9  0000000000001001  x10 0000000000000942  x11 0000000000000741
10-21 12:49:33.719 27434 27501 F DEBUG   :     x12 0000000000001337  x13 00000000ecd91223  x14 00000000000076be  x15 000000000000deec
10-21 12:49:33.719 27434 27501 F DEBUG   :     x16 00000072a911c0f0  x17 00000072d6ccc5c0  x18 0000006eb7790000  x19 0000006ec848c2e0
10-21 12:49:33.719 27434 27501 F DEBUG   :     x20 0000006ec1831558  x21 0000006ec2ce0568  x22 0000006ec2ce1ba0  x23 0000006ec18208f8
10-21 12:49:33.719 27434 27501 F DEBUG   :     x24 00000000000f0003  x25 0000000000001466  x26 00000071e0299030  x27 00000070f0289450
10-21 12:49:33.719 27434 27501 F DEBUG   :     x28 0000006ec8491a9c  x29 0000006ec8491af0
10-21 12:49:33.719 27434 27501 F DEBUG   :     lr  0000006ec2ac70bc  sp  0000006ec846fdd0  pc  0000006ec2ad5440  pst 0000000000001000
10-21 12:49:33.719 27434 27501 F DEBUG   : 26 total frames
10-21 12:49:33.719 27434 27501 F DEBUG   : backtrace:
10-21 12:49:33.719 27434 27501 F DEBUG   :       #00 pc 0000000001584440  /data/app/~~YyPDO178ZlONpOwjyXqOuA==/de.number26.android-d8kIEGTTXERcLGtlt86G7g==/split_config.arm64_v8a.apk!libbiom-native-lib.so (offset 0x4e0000) (BuildId: 1a148b5e331b6f872d789f8929559898f658bd55)
10-21 12:49:33.719 27434 27501 F DEBUG   :       #01 pc 0000000000925a14  /data/app/~~YyPDO178ZlONpOwjyXqOuA==/de.number26.android-d8kIEGTTXERcLGtlt86G7g==/split_config.arm64_v8a.apk!libbiom-native-lib.so (offset 0x4e0000) (Java_io_keyless_sdk_biom_v5_jni_domain_JniInitTakLibraryUseCase_jniInitTakLibrary+172) (BuildId: 1a148b5e331b6f872d789f8929559898f658bd55)
10-21 12:49:33.719 27434 27501 F DEBUG   :       #02 pc 0000000000048f88  /system/framework/arm64/boot-core-libart.oat (art_jni_trampoline+168) (BuildId: 457f9f86433d968aa138842a07dce4272a30a41e)
10-21 12:49:33.719 27434 27501 F DEBUG   :       #03 pc 00000000007baf20  /apex/com.android.art/lib64/libart.so (nterp_helper+4016) (BuildId: 3949dee442ee6ee1ad4fa266013f8143)
10-21 12:49:33.719 27434 27501 F DEBUG   :       #04 pc 0000000000457dd0  /data/app/~~YyPDO178ZlONpOwjyXqOuA==/de.number26.android-d8kIEGTTXERcLGtlt86G7g==/base.apk
10-21 12:49:33.719 27434 27501 F DEBUG   :       #05 pc 00000000007baec4  /apex/com.android.art/lib64/libart.so (nterp_helper+3924) (BuildId: 3949dee442ee6ee1ad4fa266013f8143)
10-21 12:49:33.719 27434 27501 F DEBUG   :       #06 pc 0000000000456bf4  /data/app/~~YyPDO178ZlONpOwjyXqOuA==/de.number26.android-d8kIEGTTXERcLGtlt86G7g==/base.apk
10-21 12:49:33.719 27434 27501 F DEBUG   :       #07 pc 00000000007bbd90  /apex/com.android.art/lib64/libart.so (nterp_helper+7712) (BuildId: 3949dee442ee6ee1ad4fa266013f8143)
10-21 12:49:33.719 27434 27501 F DEBUG   :       #08 pc 0000000000454efc  /data/app/~~YyPDO178ZlONpOwjyXqOuA==/de.number26.android-d8kIEGTTXERcLGtlt86G7g==/base.apk
10-21 12:49:33.719 27434 27501 F DEBUG   :       #09 pc 00000000007bbd90  /apex/com.android.art/lib64/libart.so (nterp_helper+7712) (BuildId: 3949dee442ee6ee1ad4fa266013f8143)
10-21 12:49:33.719 27434 27501 F DEBUG   :       #10 pc 00000000004a90c8  /data/app/~~YyPDO178ZlONpOwjyXqOuA==/de.number26.android-d8kIEGTTXERcLGtlt86G7g==/base.apk
10-21 12:49:33.719 27434 27501 F DEBUG   :       #11 pc 00000000007baec4  /apex/com.android.art/lib64/libart.so (nterp_helper+3924) (BuildId: 3949dee442ee6ee1ad4fa266013f8143)
10-21 12:49:33.719 27434 27501 F DEBUG   :       #12 pc 0000000000448390  /data/app/~~YyPDO178ZlONpOwjyXqOuA==/de.number26.android-d8kIEGTTXERcLGtlt86G7g==/base.apk
10-21 12:49:33.719 27434 27501 F DEBUG   :       #13 pc 000000000203d884  /memfd:jit-cache (deleted) (offset 0x2000000) (kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith+212)
10-21 12:49:33.719 27434 27501 F DEBUG   :       #14 pc 000000000203d618  /memfd:jit-cache (deleted) (offset 0x2000000) (kotlinx.coroutines.c1.run+1256)
10-21 12:49:33.719 27434 27501 F DEBUG   :       #15 pc 000000000202c744  /memfd:jit-cache (deleted) (offset 0x2000000) (kotlinx.coroutines.scheduling.CoroutineScheduler.G0+116)
10-21 12:49:33.719 27434 27501 F DEBUG   :       #16 pc 000000000203450c  /memfd:jit-cache (deleted) (offset 0x2000000) (kotlinx.coroutines.scheduling.CoroutineScheduler$c.b+124)
10-21 12:49:33.719 27434 27501 F DEBUG   :       #17 pc 000000000201d9c4  /memfd:jit-cache (deleted) (offset 0x2000000) (kotlinx.coroutines.scheduling.CoroutineScheduler$c.s+612)
10-21 12:49:33.719 27434 27501 F DEBUG   :       #18 pc 00000000007baec4  /apex/com.android.art/lib64/libart.so (nterp_helper+3924) (BuildId: 3949dee442ee6ee1ad4fa266013f8143)
10-21 12:49:33.719 27434 27501 F DEBUG   :       #19 pc 0000000000418918  /data/app/~~YyPDO178ZlONpOwjyXqOuA==/de.number26.android-d8kIEGTTXERcLGtlt86G7g==/base.apk
10-21 12:49:33.719 27434 27501 F DEBUG   :       #20 pc 0000000000376194  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+612) (BuildId: 3949dee442ee6ee1ad4fa266013f8143)
10-21 12:49:33.719 27434 27501 F DEBUG   :       #21 pc 0000000000358f28  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+136) (BuildId: 3949dee442ee6ee1ad4fa266013f8143)
10-21 12:49:33.719 27434 27501 F DEBUG   :       #22 pc 00000000004a1d9c  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1004) (BuildId: 3949dee442ee6ee1ad4fa266013f8143)
10-21 12:49:33.719 27434 27501 F DEBUG   :       #23 pc 00000000004a1998  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallbackWithUffdGc(void*)+8) (BuildId: 3949dee442ee6ee1ad4fa266013f8143)
10-21 12:49:33.719 27434 27501 F DEBUG   :       #24 pc 000000000006f7a4  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+180) (BuildId: 155abb92b893b52119785952ddcc9701)
10-21 12:49:33.719 27434 27501 F DEBUG   :       #25 pc 0000000000061830  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 155abb92b893b52119785952ddcc9701)

This occurs right after:

10-21 12:49:31.864 27434 27434 I CameraManagerGlobal: Connecting to camera service
10-21 12:49:31.867  1433  1638 I AttributionAndPermissionUtils: checkPermission (forDataDelivery 0 startDataDelivery 0): Permission hard denied for client attribution [uid 10238, pid 27434, packageName "<unknown>"]
10-21 12:49:31.904  1595  6921 D CoreBackPreview: Window{df486d u0 de.number26.android/com.n26.auth_sdk.keyless.presentation.KeylessActivity}: Setting back callback OnBackInvokedCallbackInfo{mCallback=android.window.IOnBackInvokedCallback$Stub$Proxy@ffc5d33, mPriority=0, mIsAnimationCallback=false, mOverrideBehavior=0}
10-21 12:49:31.924  1595  1827 I ActivityTaskManager: Displayed de.number26.android/com.n26.auth_sdk.keyless.presentation.KeylessActivity for user 0: +121ms

So my guess is that gms passes something back that Keyless's native library chokes on.

poshul avatar Oct 21 '25 12:10 poshul