microg / GmsCore

Free implementation of Play Services
https://microg.org
Apache License 2.0
8.38k stars 1.7k forks source link

Wrong Library Lookup Paths #97

Closed scento closed 8 years ago

scento commented 8 years ago

I experienced several crashes in application using the Maps V2 APIs (e.g. DBNavigator), which occured due to android's library lookup paths, which in my case only check the not available lib/arm-subdirectory of the apk archive instead of the jni/armeabi-v7a one.

Workaround: If the application is on the system partition and in it's own directory (e.g. /system/priv-app/GmsCore), one can extract the jni/ subdirectory of the apk file in the app directory, rename it to lib and copy the corresponding arm architecture subdirectory to lib/arm.

mar-v-in commented 8 years ago

What Android version are you running?

scento commented 8 years ago

I am running a self-compiled AOSP 6.0.1 with hammerhead - the self-check is completely working and the location provider and the signature spoofing have been patched. After using the workaround I experienced no issues with the already implemented parts.

mar-v-in commented 8 years ago

Please try again with latest nightly and report exact error message as in logcat.

scento commented 8 years ago

I retried with the current nightly - the error still persists.

Logcat:

03-01 09:16:07.549  2191  2709 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=de.hafas.android.db/de.bahn.dbtickets.ui.DBNavLauncherActivity (has extras)} from uid 10008 on display 0
03-01 09:16:07.579  2191  3399 I ActivityManager: Start proc 4503:de.hafas.android.db/u0a164 for activity de.hafas.android.db/de.bahn.dbtickets.ui.DBNavLauncherActivity
03-01 09:16:07.637  4503  4503 W System  : ClassLoader referenced unknown path: /data/app/de.hafas.android.db-2/lib/arm
03-01 09:16:07.716  2191  2412 I ActivityManager: START u0 {act=de.hafas.android.ACTION_SHOW_CONNECTION flg=0x400000 cmp=de.hafas.android.db/de.hafas.main.HafasApp (has extras)} from uid 10164 on display 0
03-01 09:16:07.716  2191  2412 W ActivityManager: startActivity called from finishing ActivityRecord{34117a5 u0 de.hafas.android.db/de.bahn.dbtickets.ui.DBNavLauncherActivity t2703 f}; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=de.hafas.android.ACTION_SHOW_CONNECTION flg=0x400000 cmp=de.hafas.android.db/de.hafas.main.HafasApp (has extras) }
03-01 09:16:07.878  4503  4536 D OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
03-01 09:16:07.911  4503  4536 I Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: QUALCOMM Build: 10/21/15, 369a2ea, I96aee987eb
03-01 09:16:07.913  4503  4536 I OpenGLRenderer: Initialized EGL, version 1.4
03-01 09:16:07.979  2691  2702 D GmsLocManagerSvc: bound by: GetServiceRequest{serviceId=LOCATION_MANAGER, gmsVersion=7327000, packageName='de.hafas.android.db', extras=Bundle[{client_name=locationServices}]}
03-01 09:16:08.034  2191  2210 I ActivityManager: Displayed de.hafas.android.db/de.hafas.main.HafasApp: +313ms (total +466ms)
03-01 09:16:08.065  2691  3207 D GmsLocManagerSvcImpl: getLastLocationWithPackage: de.hafas.android.db
03-01 09:16:08.076  2691  3209 D GmsLocManagerSvcImpl: updateLocationRequest: LocationRequestUpdateData{opCode=1, request=LocationRequestInternal{request=LocationRequest{priority=100, interval=5000, fastestInterval=5000, explicitFastestInterval=true, expirationTime=9223372036854775807, numUpdates=2147483647, smallestDesplacement=0.0, maxWaitTime=0}, requestNlpDebugInfo=false, restorePendingIntentListeners=true, triggerUpdate=true, clients=[], tag='null', hideFromAppOps=false}, listener=com.google.android.gms.location.ILocationListener$Stub$Proxy@ce223c1, pendingIntent=null, callback=null}
03-01 09:16:08.076  2691  3209 D GmsLocProviderReal: gps: addRequest LocationRequestHelper{locationRequest=LocationRequest{priority=100, interval=5000, fastestInterval=5000, explicitFastestInterval=true, expirationTime=9223372036854775807, numUpdates=2147483647, smallestDesplacement=0.0, maxWaitTime=0}, hasFinePermission=true, hasCoarsePermission=true, packageName='null', lastReport=null}
03-01 09:16:08.078  2691  3209 D GmsLocProviderReal: gps: requesting location updates. minTime=5000 minDistance=0.0
03-01 09:16:08.078  2691  3209 D GmsLocProviderReal: network: addRequest LocationRequestHelper{locationRequest=LocationRequest{priority=100, interval=5000, fastestInterval=5000, explicitFastestInterval=true, expirationTime=9223372036854775807, numUpdates=2147483647, smallestDesplacement=0.0, maxWaitTime=0}, hasFinePermission=true, hasCoarsePermission=true, packageName='null', lastReport=null}
03-01 09:16:08.078  2691  3209 V NlpLocationProvider: onSetRequest: ProviderRequest[ON interval=+5s0ms] by WorkSource{10054 com.google.android.gms}
03-01 09:16:08.079  2691  3209 V NlpLocationProvider: using autoUpdate=true autoTime=5000
03-01 09:16:08.079  2691  3209 D GmsLocProviderReal: network: requesting location updates. minTime=5000 minDistance=0.0
03-01 09:16:08.089  3093  3107 D IchnaeaBackendService: Cells: 1
03-01 09:16:08.092  3093  4549 D IchnaeaBackendService: request: {**@ANONYMIZED**}
03-01 09:16:08.092  2691  4548 V NlpLocationBackendFuser: location=Location[network {**@ANONYMIZED**} acc=100 et=+2m10s231ms {Bundle[{noGPSLocation=Location[network {**@ANONYMIZED**} acc=100 et=+2m10s231ms {Bundle[{SERVICE_BACKEND_PROVIDER=ichnaea, SERVICE_BACKEND_COMPONENT=org.microg.nlp.backend.ichnaea/.BackendService}]}], SERVICE_BACKEND_PROVIDER=ichnaea, SERVICE_BACKEND_COMPONENT=org.microg.nlp.backend.ichnaea/.BackendService}]}]
03-01 09:16:08.097  2691  2691 D GmsLocRequestHelper: sending Location: Location[gps {**@ANONYMIZED**} acc=18 et=+2m10s221ms alt=240.0 vel=1.118034 bear=187.0 {Bundle[mParcelledData.dataSize=40]}]
03-01 09:16:08.139  2858  4544 I art     : Waiting for a blocking GC DisableMovingGc
03-01 09:16:08.140  2858  4544 I art     : Starting a blocking GC DisableMovingGc
03-01 09:16:08.200  4503  4503 I zzy     : Making Creator dynamically
03-01 09:16:08.205  4503  4503 W System  : ClassLoader referenced unknown path: /system/priv-app/PlayServicesCore/lib/arm
03-01 09:16:08.222  4503  4503 D SafeParcel: Unknown field num 12 in com.google.android.gms.maps.GoogleMapOptions, skipping.
03-01 09:16:08.222  4503  4503 D SafeParcel: Unknown field num 14 in com.google.android.gms.maps.GoogleMapOptions, skipping.
03-01 09:16:08.223  4503  4503 D MapViewImpl: onCreate
03-01 09:16:08.225  4503  4503 D GoogleMapImpl: Loading native vtm-jni
03-01 09:16:08.230  4503  4503 D AndroidRuntime: Shutting down VM
03-01 09:16:08.231  4503  4503 E AndroidRuntime: FATAL EXCEPTION: main
03-01 09:16:08.231  4503  4503 E AndroidRuntime: Process: de.hafas.android.db, PID: 4503
03-01 09:16:08.231  4503  4503 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/com.android.location.provider.jar", zip file "/system/priv-app/PlayServicesCore/PlayServicesCore.apk"],nativeLibraryDirectories=[/system/priv-app/PlayServicesCore/lib/arm, /system/priv-app/PlayServicesCore/PlayServicesCore.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]] couldn't find "libvtm-jni.so"
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at java.lang.Runtime.loadLibrary(Runtime.java:367)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at java.lang.System.loadLibrary(System.java:1076)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at org.microg.gms.maps.GoogleMapImpl.loadNativeLib(GoogleMapImpl.java:196)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at org.microg.gms.maps.GoogleMapImpl.<init>(GoogleMapImpl.java:144)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at org.microg.gms.maps.MapViewImpl.myMap(MapViewImpl.java:49)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at org.microg.gms.maps.MapViewImpl.getView(MapViewImpl.java:102)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at com.google.android.gms.maps.internal.IMapViewDelegate$Stub.onTransact(IMapViewDelegate.java:119)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at org.microg.gms.maps.MapViewImpl.onTransact(MapViewImpl.java:112)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at android.os.Binder.transact(Binder.java:387)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at com.google.android.gms.maps.internal.IMapViewDelegate$zza$zza.getView(Unknown Source)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at com.google.android.gms.maps.MapView$zza.onCreate(Unknown Source)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at com.google.android.gms.dynamic.zza$3.zzb(Unknown Source)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at com.google.android.gms.dynamic.zza$1.zza(Unknown Source)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at com.google.android.gms.maps.MapView$zzb.zztD(Unknown Source)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at com.google.android.gms.maps.MapView$zzb.zza(Unknown Source)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at com.google.android.gms.dynamic.zza.zza(Unknown Source)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at com.google.android.gms.dynamic.zza.onCreate(Unknown Source)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at com.google.android.gms.maps.MapView.onCreate(Unknown Source)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at de.hafas.android.c.a.l.c(GoogleMaps2View.java:275)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at de.hafas.ui.map.e.a.onCreate(BasicMapScreen.java:293)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at android.support.v4.app.Fragment.performCreate(Fragment.java:1766)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at android.support.v4.app.ak.a(FragmentManager.java:917)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at android.support.v4.app.ak.a(FragmentManager.java:1138)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at android.support.v4.app.s.run(BackStackRecord.java:740)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at android.support.v4.app.ak.h(FragmentManager.java:1501)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at android.support.v4.app.ak.b(FragmentManager.java:490)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at de.hafas.app.b.changeView(HafasBaseApp.java:3209)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at de.hafas.app.b.access$2100(HafasBaseApp.java:139)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at de.hafas.app.i.run(HafasBaseApp.java:2496)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:739)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:95)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:148)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:5417)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
03-01 09:16:08.231  4503  4503 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
03-01 09:16:08.232  2191  2709 W ActivityManager:   Force finishing activity de.hafas.android.db/de.hafas.main.HafasApp
mar-v-in commented 8 years ago

Can you try installing the Services Core APP "as usual" (not pushing it to /system)?

scento commented 8 years ago

Before installing the app using adb install, I tried to push it to system/app, which lead to the same error as in the previous post.

When I install the Services Core App "as usual", the system does not grant the permission required for binding the location backend (it is a system permission). This is then the reason for an app crash, due to the missing network adapter:

Logcat:

03-01 09:33:03.478  2387  2899 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=de.hafas.android.db/de.bahn.dbtickets.ui.DBNavLauncherActivity (has extras)} from uid 10008 on display 0
03-01 09:33:03.566  2387  2399 I ActivityManager: Start proc 8041:de.hafas.android.db/u0a164 for activity de.hafas.android.db/de.bahn.dbtickets.ui.DBNavLauncherActivity
03-01 09:33:03.697  8041  8041 W System  : ClassLoader referenced unknown path: /data/app/de.hafas.android.db-2/lib/arm
03-01 09:33:03.781  2387  2597 W InputMethodManagerService: Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@66faa02 attribute=null, token = android.os.BinderProxy@f3ebcea
03-01 09:33:03.802  2387  2899 I ActivityManager: START u0 {act=de.hafas.android.ACTION_SHOW_CONNECTION flg=0x400000 cmp=de.hafas.android.db/de.hafas.main.HafasApp (has extras)} from uid 10164 on display 0
03-01 09:33:03.802  2387  2899 W ActivityManager: startActivity called from finishing ActivityRecord{7043c76 u0 de.hafas.android.db/de.bahn.dbtickets.ui.DBNavLauncherActivity t2713 f}; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { act=de.hafas.android.ACTION_SHOW_CONNECTION flg=0x400000 cmp=de.hafas.android.db/de.hafas.main.HafasApp (has extras) }
03-01 09:33:04.239  3163  3174 W art     : Suspending all threads took: 14.458ms
03-01 09:33:04.317  7497  7497 D GmsLocManagerSvc: onBind: Intent { act=com.google.android.location.internal.GoogleLocationManagerService.START pkg=com.google.android.gms }
03-01 09:33:04.332  8041  8065 D OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
03-01 09:33:04.415  8041  8065 I Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: QUALCOMM Build: 10/21/15, 369a2ea, I96aee987eb
03-01 09:33:04.432  8041  8065 I OpenGLRenderer: Initialized EGL, version 1.4
03-01 09:33:04.647  7497  7509 D GmsLocManagerSvc: bound by: GetServiceRequest{serviceId=LOCATION_MANAGER, gmsVersion=7327000, packageName='de.hafas.android.db', extras=Bundle[{client_name=locationServices}]}
03-01 09:33:04.726  2387  2406 I ActivityManager: Displayed de.hafas.android.db/de.hafas.main.HafasApp: +906ms (total +1s177ms)
03-01 09:33:04.789  7497  7651 D GmsLocManagerSvcImpl: getLastLocationWithPackage: de.hafas.android.db
03-01 09:33:04.807  7497  7651 D GmsLocProviderReal: uh-ok: last location for network is null!
03-01 09:33:04.807  7497  7651 D GmsLocProviderReal: uh-ok: last location for gps is null!
03-01 09:33:04.816  7497  7577 D GmsLocManagerSvcImpl: updateLocationRequest: LocationRequestUpdateData{opCode=1, request=LocationRequestInternal{request=LocationRequest{priority=100, interval=5000, fastestInterval=5000, explicitFastestInterval=true, expirationTime=9223372036854775807, numUpdates=2147483647, smallestDesplacement=0.0, maxWaitTime=0}, requestNlpDebugInfo=false, restorePendingIntentListeners=true, triggerUpdate=true, clients=[], tag='null', hideFromAppOps=false}, listener=com.google.android.gms.location.ILocationListener$Stub$Proxy@ace2997, pendingIntent=null, callback=null}
03-01 09:33:04.831  7497  7577 D GmsLocProviderReal: gps: addRequest LocationRequestHelper{locationRequest=LocationRequest{priority=100, interval=5000, fastestInterval=5000, explicitFastestInterval=true, expirationTime=9223372036854775807, numUpdates=2147483647, smallestDesplacement=0.0, maxWaitTime=0}, hasFinePermission=true, hasCoarsePermission=true, packageName='null', lastReport=null}
03-01 09:33:04.836  7497  7577 D GmsLocProviderReal: gps: requesting location updates. minTime=5000 minDistance=0.0
03-01 09:33:04.836  7497  7577 D GmsLocProviderReal: network: addRequest LocationRequestHelper{locationRequest=LocationRequest{priority=100, interval=5000, fastestInterval=5000, explicitFastestInterval=true, expirationTime=9223372036854775807, numUpdates=2147483647, smallestDesplacement=0.0, maxWaitTime=0}, hasFinePermission=true, hasCoarsePermission=true, packageName='null', lastReport=null}
03-01 09:33:04.845  8041  8041 D AndroidRuntime: Shutting down VM
03-01 09:33:04.846  8041  8041 E AndroidRuntime: FATAL EXCEPTION: main
03-01 09:33:04.846  8041  8041 E AndroidRuntime: Process: de.hafas.android.db, PID: 8041
03-01 09:33:04.846  8041  8041 E AndroidRuntime: java.lang.IllegalArgumentException: provider doesn't exist: network
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at android.os.Parcel.readException(Parcel.java:1624)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at android.os.Parcel.readException(Parcel.java:1573)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at com.google.android.gms.location.internal.zzg$zza$zza.zza(Unknown Source)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at com.google.android.gms.location.internal.zzi.zza(Unknown Source)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at com.google.android.gms.location.internal.zzj.zza(Unknown Source)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at com.google.android.gms.location.internal.zzd$1.zza(Unknown Source)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at com.google.android.gms.location.internal.zzd$1.zza(Unknown Source)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at com.google.android.gms.common.api.zza$zza.zzb(Unknown Source)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at com.google.android.gms.common.api.zzd.zza(Unknown Source)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at com.google.android.gms.common.api.zzd.zzb(Unknown Source)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at com.google.android.gms.common.api.zzg.zzb(Unknown Source)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at com.google.android.gms.location.internal.zzd.requestLocationUpdates(Unknown Source)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at de.hafas.d.h.a(GoogleLocationService.java:137)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at de.hafas.d.j.onConnected(GoogleLocationService.java:177)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at com.google.android.gms.common.internal.zzj.zzg(Unknown Source)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at com.google.android.gms.common.api.zze.zzkU(Unknown Source)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at com.google.android.gms.common.api.zze.onConnected(Unknown Source)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at com.google.android.gms.common.api.zzg$2.onConnected(Unknown Source)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at com.google.android.gms.common.internal.zzj.zzg(Unknown Source)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at com.google.android.gms.common.internal.zzj.zzmh(Unknown Source)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at com.google.android.gms.common.internal.zzi$zzf.zzma(Unknown Source)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at com.google.android.gms.common.internal.zzi$zza.zzc(Unknown Source)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at com.google.android.gms.common.internal.zzi$zza.zzo(Unknown Source)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at com.google.android.gms.common.internal.zzi$zzc.zzmc(Unknown Source)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at com.google.android.gms.common.internal.zzi$zzb.handleMessage(Unknown Source)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:102)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:148)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:5417)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
03-01 09:33:04.846  8041  8041 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
03-01 09:33:04.869  2387  3126 W ActivityManager:   Force finishing activity de.hafas.android.db/de.hafas.main.HafasApp
mar-v-in commented 8 years ago

I will fix the crashing issue with Location, which is the real bug. Pushing to /system is not the best method as it got a lot more complex with Android 5 when working with native libraries.

The reason for your system not to grant access to microG to register as a network provider can have two reasons:

scento commented 8 years ago

Oddly enough, rebooting multiple times resolved this issue.