Hello.
I tried to start an app with libMGD.so inside it but the app always crashed instantly when I started it. This problem happened on Samsung S8 and Note 5 (both happens to be in Android Nougat). I always use unrooted devices. This problem doesn't happen when I use it on Samsung S7 and S6.
This is the logcat that might be relevant to my problem (I have to erase some of the phrase because it's work-related) :
05-15 04:10:02.560: I/libMGD(13118): JVM_NativeLoad of /system/lib/libcc_manager_jni.so 05-15 04:10:02.560: I/libMGD(13118): dlopen of /system/lib/libcc_manager_jni.so 05-15 04:10:02.561: E/linker(13118): library "/system/lib/libcc_manager_jni.so" ("/system/lib/libcc_manager_jni.so") needed or dlopened by "/data/app/com.xxxxxxxx.android.xxxx.xxxxxxxxx-1/lib/arm/libMGD.so" is not accessible for the namespace: [name="classloader-namespace", ld_library_paths="", default_library_paths="/data/app/com.xxxxxxx.android.Axxx.xxxxxxxxx-1/lib/arm:/data/app/com.xxxxxxx.android.Axxx.xxxxxxxxx-1/base.apk!/lib/armeabi-v7a", permitted_paths="/data:/mnt/expand:/data/data/com.xxxxxxx.android.Axxx.xxxxxxxxx"] 05-15 04:10:02.562: I/libMGD(13118): Could not dlopen /system/lib/libcc_manager_jni.so 05-15 04:10:02.562: I/libMGD(13118): Could not JVM_NativeLoad /system/lib/libcc_manager_jni.so 05-15 04:10:02.562: W/System.err(13118): Could not link the library. Error: dlopen failed: library "/system/lib/libcc_manager_jni.so" needed or dlopened by "/data/app/com.xxxxxxx.android.Axxx.xxxxxxxxx-1/lib/arm/libMGD.so" is not accessible for the namespace "classloader-namespace" 05-15 04:10:02.564: E/art(13118): No implementation found for boolean com.samsung.android.security.CCManager.isMdfEnforced() (tried Java_com_samsung_android_security_CCManager_isMdfEnforced and Java_com_samsung_android_security_CCManager_isMdfEnforced__) 05-15 04:10:02.565: E/art(13118): No implementation found for boolean com.samsung.android.security.CCManager.isMdfEnforced() (tried Java_com_samsung_android_security_CCManager_isMdfEnforced and Java_com_samsung_android_security_CCManager_isMdfEnforced__) 05-15 04:10:02.579: E/AndroidRuntime(13118): FATAL EXCEPTION: Thread-3 05-15 04:10:02.579: E/AndroidRuntime(13118): Process: com.xxxxxxxx.android.xxxx.xxxxxxxxx, PID: 13118 05-15 04:10:02.579: E/AndroidRuntime(13118): java.lang.UnsatisfiedLinkError: No implementation found for boolean com.samsung.android.security.CCManager.isMdfEnforced() (tried Java_com_samsung_android_security_CCManager_isMdfEnforced and Java_com_samsung_android_security_CCManager_isMdfEnforced__) 05-15 04:10:02.579: E/AndroidRuntime(13118): at com.samsung.android.security.CCManager.isMdfEnforced(Native Method) 05-15 04:10:02.579: E/AndroidRuntime(13118): at com.android.okhttp.Connection.connectTls(Connection.java:1549) 05-15 04:10:02.579: E/AndroidRuntime(13118): at com.android.okhttp.Connection.connectSocket(Connection.java:1458) 05-15 04:10:02.579: E/AndroidRuntime(13118): at com.android.okhttp.Connection.connect(Connection.java:1413) 05-15 04:10:02.579: E/AndroidRuntime(13118): at com.android.okhttp.Connection.connectAndSetOwner(Connection.java:1700) 05-15 04:10:02.579: E/AndroidRuntime(13118): at com.android.okhttp.OkHttpClient$1.connectAndSetOwner(OkHttpClient.java:133) 05-15 04:10:02.579: E/AndroidRuntime(13118): at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:466) 05-15 04:10:02.579: E/AndroidRuntime(13118): at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:371) 05-15 04:10:02.579: E/AndroidRuntime(13118): at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:503) 05-15 04:10:02.579: E/AndroidRuntime(13118): at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:130) 05-15 04:10:02.579: E/AndroidRuntime(13118): at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.connect(DelegatingHttpsURLConnection.java:89) 05-15 04:10:02.579: E/AndroidRuntime(13118): at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java) 05-15 04:10:02.579: E/AndroidRuntime(13118): at com.xxxxxxxx.xxxxxxx.xxxx.xxxxxxxxx.installer.GameInstaller.b(SourceFile:4059) 05-15 04:10:02.579: E/AndroidRuntime(13118): at com.xxxxxxxx.xxxxxxx.xxxx.xxxxxxxxx.installer.GameInstaller.D(SourceFile:1294) 05-15 04:10:02.579: E/AndroidRuntime(13118): at xxx.xxxxxxxx.xxxxxxx.xxxx.xxxxxxxxx.installer.GameInstaller.c(SourceFile:1713) 05-15 04:10:02.579: E/AndroidRuntime(13118): at com.xxxxxxxx.xxxxxxx.xxxx.xxxxxxxxx.installer.GameInstaller.run(SourceFile:1370) 05-15 04:10:02.579: E/AndroidRuntime(13118): at java.lang.Thread.run(Thread.java:762)
Any idea why? Thank you!
Hi, Thanks for reporting this issue. The non-rooted support in MGD works by intercepting library loads and patching any references to OpenGL ES library functions to instead call into the MGD library. However, since Android Nougat, apps are prevented from loading non-API system libraries (see developer.android.com/.../android-7.0-changes.html. The cause of the error message you're seeing in the log is due to MGD intercepting a system library load that it isn't allowed to. To fix this, we will need to make some changes to libMGD.so that prevents it from intercepting library load calls for the system library that itself loads "libcc_manager_jni.so". Unfortunately, with the current version of MGD, there will be no way for you to trace applications on the S8 without you rooting it. We'll aim to fix the issue as soon as we can, hopefully by the next release of MGD.
Hi, Having done some initial investigation, this is not as easy to fix as we first thought. Because of the way the Samsung security features are implemented, if we don't load the security module (which causes a crash) we also won't load your applications C/C++ OpenGL ES/EGL code so you won't see any trace in MGD. Easiest workaround right now is to disable any functions which call protected system features. In this case it appears you're trying to open network connections. We know this is not ideal and will continue to look for a better solution and work with Samsung to see what we can do. Thanks, Jon.
Hello,
You're advice is so spot on, I commented the method call in the stack trace above and it works!
Thank you!
Thank you for your answer. I like working with MGD, hope it works out soon!