Android 11 WebView无法加载libwebviewchromium.so

news2024/11/15 9:14:10

概述

Android WebView 是 Google 提供的一个预安装系统组件,用以支持 Android 应用显示网页内容。
       Android WebView 是 Google 提供的一个预安装系统组件,用以支持 Android 应用显示网页内容。

       如果您希望在客户端应用中提供 Web 应用(或只是网页),则可以使用 WebView 执行该操作。WebView 类是 Android 的 View 类的扩展,可让您将网页显示为 Activity 布局的一部分。它不会包含功能全面的网络浏览器的任何功能,例如导航控件或地址栏。WebView 默认只显示网页。

使用 WebView 非常有用的一种常见情形是,您希望在应用中提供可能需要更新的信息,例如最终用户协议或用户指南。在 Android 应用中,您可以创建一个包含 WebView 的 Activity,然后使用它来显示在线托管的文档。

另一种 WebView 可能会有所帮助的情形是,如果您的应用向用户提供始终需要互联网连接才能检索数据的数据(例如电子邮件)。在这种情况下,您可能会发现相比于执行网络请求,然后解析数据并在 Android 布局中呈现数据,在 Android 应用中编译 WebView 以显示包含所有用户数据的网页更加轻松。您可以改为设计一个专为 Android 设备定制的网页,然后在加载该网页的 Android 应用中实现 WebView。
________________________From Android

    在测试RK3566 Android 11功能的时候,碰到一个奇怪的问题: 第三方浏览器APP调用系统WebView出错了。测试中用的是Via浏览器,问题表现威:白屏,UI卡死操作一会出现ANR。

问题

从logcat中看到的log:

2023-04-23 16:12:46.733  1907-1907  WebViewFactory     mark.via              I  Loading com.android.webview version 83.0.4103.120 (code 410412053)
2023-04-23 16:12:46.735   176-176   HWC2               surfaceflinger        E  getRequests: invalid layer 0 found on display 0
2023-04-23 16:12:46.742  1907-1907  mark.via           mark.via              I  The ClassLoaderContext is a special shared library.
2023-04-23 16:12:46.744  1907-1907  nativeloader       mark.via              D  classloader namespace configured for unbundled product apk. library_path=/product/app/webview/lib/arm64:/product/app/webview/webview.apk!/lib/arm64-v8a:/product/lib64:/system/product/lib64
2023-04-23 16:12:46.747  1907-1907  webviewc...mloader mark.via              E  Failed to open relro file /data/misc/shared_relro/libwebviewchromium64.relro: No such file or directory
2023-04-23 16:12:46.747  1907-1907  WebViewL...yLoader mark.via              W  failed to load with relro file, proceeding without

2023-04-23 16:12:46.775  1907-1907  AndroidRuntime     mark.via              E  FATAL EXCEPTION: main
 Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: library "libwebviewchromium.so" not found
 	at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
 	at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
 	at java.lang.System.loadLibrary(System.java:1664)
 	at tt.g(chromium-SystemWebView.apk-default-410412053:14)
 	at tt.i(chromium-SystemWebView.apk-default-410412053:5) 
 	at org.chromium.android_webview.AwBrowserProcess.i(chromium-SystemWebView.apk-default-410412053:9) 
 	at com.android.webview.chromium.WebViewChromiumFactoryProvider.f(chromium-SystemWebView.apk-default-410412053:68) 
 	at com.android.webview.chromium.WebViewChromiumFactoryProvider.<init>(chromium-SystemWebView.apk-default-410412053:12) 
 	at com.android.webview.chromium.WebViewChromiumFactoryProviderForR.<init>(chromium-SystemWebView.apk-default-410412053:1) 
 	at com.android.webview.chromium.WebViewChromiumFactoryProviderForR.create(chromium-SystemWebView.apk-default-410412053:1) 
 	at java.lang.reflect.Method.invoke(Native Method) 
 	at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:266) 
 	at android.webkit.WebSettings.getDefaultUserAgent(WebSettings.java:1355) 
 	at mark.via.o.e.a.b(Unknown Source:221) 
 	at mark.via.l.p3.N1(Unknown Source:36) 
 	at androidx.fragment.app.Fragment.m2(Unknown Source:4) 
 	at androidx.fragment.app.t.f(Unknown Source:271) 
 	at androidx.fragment.app.t.m(Unknown Source:124) 
 	at androidx.fragment.app.FragmentManager.a0(Unknown Source:230) 
 	at androidx.fragment.app.FragmentManager.c1(Unknown Source:91) 
 	at androidx.fragment.app.FragmentManager.X(Unknown Source:21) 
 	at androidx.fragment.app.FragmentManager.P(Unknown Source:38) 
 	at androidx.fragment.app.FragmentManager.u(Unknown Source:11) 
 	at androidx.fragment.app.k.c(Unknown Source:4) 
 	at androidx.fragment.app.g.onStart(Unknown Source:20) 
 	at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1435) 
 	at android.app.Activity.performStart(Activity.java:8046) 
 	at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3457) 
 	at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221) 
 	at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201) 
 	at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173) 
 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) 
 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066) 
 	at android.os.Handler.dispatchMessage(Handler.java:106) 
 	at android.os.Looper.loop(Looper.java:223) 
 	at android.app.ActivityThread.main(ActivityThread.java:7664) 
 	at java.lang.reflect.Method.invoke(Native Method) 
 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 
 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) ```

分析LOG前需要先了解一下RELRO参考Android WebView加载Chromium动态库的过程分析
在这里插入图片描述

WebViewFactory WebViewLibraryLoader LocalServices ActivityManagerInternal RelroFileCreator loader.cpp onWebViewProviderChanged createRelros createRelroFile getService startIsolatedProcess main nativeCreateRelroFile CreateRelroFile DoCreateRelroFile WebViewFactory WebViewLibraryLoader LocalServices ActivityManagerInternal RelroFileCreator loader.cpp

frameworks/base/core/java/android/webkit/WebViewLibraryLoader.java

    private static class RelroFileCreator {
        // Called in an unprivileged child process to create the relro file.
        public static void main(String[] args) {
            boolean result = false;
            boolean is64Bit = VMRuntime.getRuntime().is64Bit();
            try {
                if (args.length != 2 || args[0] == null || args[1] == null) {
                    Log.e(LOGTAG, "Invalid RelroFileCreator args: " + Arrays.toString(args));
                    return;
                }
                String packageName = args[0];
                String libraryFileName = args[1];
                Log.v(LOGTAG, "RelroFileCreator (64bit = " + is64Bit + "), package: "
                        + packageName + " library: " + libraryFileName);
                if (!sAddressSpaceReserved) {
                    Log.e(LOGTAG, "can't create relro file; address space not reserved");
                    return;
                }
                LoadedApk apk = ActivityThread.currentActivityThread().getPackageInfo(
                        packageName,
                        null,
                        Context.CONTEXT_INCLUDE_CODE | Context.CONTEXT_IGNORE_SECURITY);
                result = nativeCreateRelroFile(libraryFileName,
                                               is64Bit ? CHROMIUM_WEBVIEW_NATIVE_RELRO_64 :
                                                         CHROMIUM_WEBVIEW_NATIVE_RELRO_32,
                                               apk.getClassLoader());
                if (result && DEBUG) Log.v(LOGTAG, "created relro file");
            } finally {
                // We must do our best to always notify the update service, even if something fails.
                try {
                    WebViewFactory.getUpdateServiceUnchecked().notifyRelroCreationCompleted();
                } catch (RemoteException e) {
                    Log.e(LOGTAG, "error notifying update service", e);
                }

                if (!result) Log.e(LOGTAG, "failed to create relro file");

                // Must explicitly exit or else this process will just sit around after we return.
                System.exit(0);
            }
        }
    }

frameworks/base/native/webview/loader/loader.cpp

ALOGE("Failed to open relro file %s: %s", relro, strerror(errno));
jboolean DoCreateRelroFile(JNIEnv* env, const char* lib, const char* relro,
  if (handle == NULL) {
    ALOGE("Failed to load library %s: %s", lib, dlerror());
    unlink(relro_tmp);
    return JNI_FALSE;
  }
}
Failed to load library libwebviewchromium.so: dlopen failed: library "libwebviewchromium.so" not found
Failed to open relro file /data/misc/shared_relro/libwebviewchromium64.relro: No such file or directory

art/libnativeloader/library_namespaces.cpp

ALOGD("classloader namespace configured for unbundled %s apk. library_path=%s",

//对应LOG
//classloader namespace configured for unbundled product apk. library_path=/product/app/webview/lib/arm64:/product/app/webview/webview.apk!/lib/arm64-v8a:/product/lib64:/system/product/lib64

基本定位到webview的库加载问题后,排除第三方APP问题, 重启看下webview的相关log:

2023-04-24 11:06:15.580   446-472   SystemConfig       system_process        I  Reading permissions from /system/etc/permissions/android.software.webview.xml
2023-04-24 11:06:17.733   446-446   SystemServerTiming system_process        I  StartWebViewUpdateService
2023-04-24 11:06:17.733   446-446   SystemSe...Manager system_process        I  Starting com.android.server.webkit.WebViewUpdateService
2023-04-24 11:06:17.736   446-446   SystemServerTiming system_process        D  StartWebViewUpdateService took to complete: 2ms
2023-04-24 11:06:19.625   446-446   SystemServerTiming system_process        I  OnBootPhase_480_com.android.server.webkit.WebViewUpdateService
2023-04-24 11:06:19.625   446-446   SystemServerTiming system_process        D  OnBootPhase_480_com.android.server.webkit.WebViewUpdateService took to complete: 0ms
2023-04-24 11:06:19.667   446-446   SystemServerTiming system_process        I  OnBootPhase_500_com.android.server.webkit.WebViewUpdateService
2023-04-24 11:06:19.667   446-446   SystemServerTiming system_process        D  OnBootPhase_500_com.android.server.webkit.WebViewUpdateService took to complete: 0ms
2023-04-24 11:06:20.023   446-446   SystemServerTiming system_process        I  OnBootPhase_520_com.android.server.webkit.WebViewUpdateService
2023-04-24 11:06:20.023   446-446   SystemServerTiming system_process        D  OnBootPhase_520_com.android.server.webkit.WebViewUpdateService took to complete: 0ms
2023-04-24 11:06:20.161   446-446   SystemServerTiming system_process        I  OnBootPhase_550_com.android.server.webkit.WebViewUpdateService
2023-04-24 11:06:20.161   446-446   SystemServerTiming system_process        D  OnBootPhase_550_com.android.server.webkit.WebViewUpdateService took to complete: 0ms
2023-04-24 11:06:20.540   446-511   SystemSe...ngAsync system_process        I  InitThreadPoolExec:WebViewFactoryPreparation
2023-04-24 11:06:20.540   446-511   SystemSe...eadPool system_process        D  Started executing WebViewFactoryPreparation
2023-04-24 11:06:20.540   446-511   SystemServer       system_process        I  WebViewFactoryPreparation
2023-04-24 11:06:20.540   446-511   SystemSe...ngAsync system_process        I  WebViewFactoryPreparation
2023-04-24 11:06:20.556   446-511   SystemSe...ngAsync system_process        D  WebViewFactoryPreparation took to complete: 16ms
2023-04-24 11:06:20.556   446-511   SystemSe...eadPool system_process        D  Finished executing WebViewFactoryPreparation
2023-04-24 11:06:20.556   446-511   SystemSe...ngAsync system_process        D  InitThreadPoolExec:WebViewFactoryPreparation took to complete: 17ms
2023-04-24 11:06:20.694   446-475   ActivityManager    system_process        I  Start proc 678:WebViewLoader-armeabi-v7a/1037 [android.webkit.WebViewLibraryLoader$RelroFileCreator] for null
2023-04-24 11:06:20.768   446-475   ActivityManager    system_process        I  Start proc 692:WebViewLoader-arm64-v8a/1037 [android.webkit.WebViewLibraryLoader$RelroFileCreator] for null
2023-04-24 11:06:20.780   678-678   WebViewL...yLoader pid-678               V  RelroFileCreator (64bit = false), package: com.android.webview library: libwebviewchromium.so
2023-04-24 11:06:20.792   692-692   WebViewL...yLoader pid-692               V  RelroFileCreator (64bit = true), package: com.android.webview library: libwebviewchromium.so
2023-04-24 11:06:20.809   446-446   SystemServerTiming system_process        I  OnBootPhase_600_com.android.server.webkit.WebViewUpdateService
2023-04-24 11:06:20.809   446-446   SystemServerTiming system_process        D  OnBootPhase_600_com.android.server.webkit.WebViewUpdateService took to complete: 0ms
2023-04-24 11:06:20.837   692-692   WebViewLoader-     pid-692               I  The ClassLoaderContext is a special shared library.
2023-04-24 11:06:20.837   678-678   WebViewLoader-     pid-678               I  The ClassLoaderContext is a special shared library.
2023-04-24 11:06:20.839   692-692   nativeloader       pid-692               D  classloader namespace configured for unbundled product apk. library_path=/product/app/webview/lib/arm64:/product/app/webview/webview.apk!/lib/arm64-v8a:/product/lib64:/system/product/lib64
2023-04-24 11:06:20.839   678-678   nativeloader       pid-678               D  classloader namespace configured for unbundled product apk. library_path=/product/app/webview/lib/arm:/product/app/webview/webview.apk!/lib/armeabi-v7a:/product/lib:/system/product/lib
2023-04-24 11:06:20.857   678-678   webviewc...mloader pid-678               E  Failed to load library libwebviewchromium.so: dlopen failed: library "libwebviewchromium.so" not found
2023-04-24 11:06:20.863   692-692   webviewc...mloader pid-692               E  Failed to load library libwebviewchromium.so: dlopen failed: library "libwebviewchromium.so" not found
2023-04-24 11:06:20.871   678-678   WebViewL...yLoader pid-678               E  failed to create relro file
2023-04-24 11:06:20.874   692-692   WebViewL...yLoader pid-692               E  failed to create relro file
2023-04-24 11:06:20.881   692-692   WebViewLoader-     pid-692               I  System.exit called, status: 0
2023-04-24 11:06:20.886   678-678   WebViewLoader-     pid-678               I  System.exit called, status: 0
2023-04-24 11:06:20.915   758-758   WebViewZygoteInit  pid-758               I  Starting WebViewZygoteInit
2023-04-24 11:06:20.922   446-504   ActivityManager    system_process        I  Process WebViewLoader-armeabi-v7a (pid 678) has died: psvc PER 
2023-04-24 11:06:20.952   758-758   WebViewZygoteInit  pid-758               I  Beginning application preload for com.android.webview
2023-04-24 11:06:20.958   446-728   ActivityManager    system_process        I  Process WebViewLoader-arm64-v8a (pid 692) has died: psvc PER 
2023-04-24 11:06:20.962   758-758   webview_zygote     pid-758               I  The ClassLoaderContext is a special shared library.
2023-04-24 11:06:20.964   758-758   nativeloader       pid-758               D  classloader namespace configured for unbundled product apk. library_path=/product/app/webview/lib/arm:/product/app/webview/webview.apk!/lib/armeabi-v7a:/product/lib:/system/product/lib
2023-04-24 11:06:20.968   758-758   webviewc...mloader pid-758               E  Failed to open relro file /data/misc/shared_relro/libwebviewchromium32.relro: No such file or directory
2023-04-24 11:06:20.968   758-758   WebViewL...yLoader pid-758               W  failed to load with relro file, proceeding without
2023-04-24 11:06:21.004   758-758   WebViewZygoteInit  pid-758               E  Exception while preloading package
                                                                                java.lang.reflect.InvocationTargetException
                                                                                    at java.lang.reflect.Method.invoke(Native Method)
                                                                                    at com.android.internal.os.WebViewZygoteInit$WebViewZygoteConnection.doPreload(WebViewZygoteInit.java:126)
                                                                                    at com.android.internal.os.WebViewZygoteInit$WebViewZygoteConnection.handlePreloadApp(WebViewZygoteInit.java:79)
                                                                                    at com.android.internal.os.ZygoteConnection.processOneCommand(ZygoteConnection.java:181)
                                                                                    at com.android.internal.os.ZygoteServer.runSelectLoop(ZygoteServer.java:546)
                                                                                    at com.android.internal.os.ChildZygoteInit.runZygoteServer(ChildZygoteInit.java:125)
                                                                                    at com.android.internal.os.WebViewZygoteInit.main(WebViewZygoteInit.java:147)
                                                                                    at java.lang.reflect.Method.invoke(Native Method)
                                                                                    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
                                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
                                                                                Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: library "libwebviewchromium.so" not found
                                                                                    at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
                                                                                    at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
                                                                                    at java.lang.System.loadLibrary(System.java:1664)
                                                                                    at com.android.webview.chromium.WebViewChromiumFactoryProvider.preloadInZygote(chromium-SystemWebView.apk-default-410412053:3)
                                                                                    at java.lang.reflect.Method.invoke(Native Method) 
                                                                                    at com.android.internal.os.WebViewZygoteInit$WebViewZygoteConnection.doPreload(WebViewZygoteInit.java:126) 
                                                                                    at com.android.internal.os.WebViewZygoteInit$WebViewZygoteConnection.handlePreloadApp(WebViewZygoteInit.java:79) 
                                                                                    at com.android.internal.os.ZygoteConnection.processOneCommand(ZygoteConnection.java:181) 
                                                                                    at com.android.internal.os.ZygoteServer.runSelectLoop(ZygoteServer.java:546) 
                                                                                    at com.android.internal.os.ChildZygoteInit.runZygoteServer(ChildZygoteInit.java:125) 
                                                                                    at com.android.internal.os.WebViewZygoteInit.main(WebViewZygoteInit.java:147) 
                                                                                    at java.lang.reflect.Method.invoke(Native Method) 
                                                                                    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 
                                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) 
2023-04-24 11:06:21.004   758-758   WebViewZygoteInit  pid-758               I  Application preload done
2023-04-24 11:06:21.006   446-446   SystemServerTiming system_process        I  ssm.onStartUser-0_com.android.server.webkit.WebViewUpdateService
2023-04-24 11:06:21.006   446-446   SystemServerTiming system_process        D  ssm.onStartUser-0_com.android.server.webkit.WebViewUpdateService took to complete: 0ms
2023-04-24 11:06:21.031   446-446   StorageM...Service system_process        V  Package com.android.webview does not have legacy storage
2023-04-24 11:06:24.986   446-468   Activity...rTiming system_process        I  OnBootPhase_1000_com.android.server.webkit.WebViewUpdateService
2023-04-24 11:06:24.986   446-468   Activity...rTiming system_process        D  OnBootPhase_1000_com.android.server.webkit.WebViewUpdateService took to complete: 0ms
2023-04-24 11:06:26.235   446-474   SystemSe...ngAsync system_process        I  ssm.onUnlockingUser-0_com.android.server.webkit.WebViewUpdateService
2023-04-24 11:06:26.235   446-474   SystemSe...ngAsync system_process        D  ssm.onUnlockingUser-0_com.android.server.webkit.WebViewUpdateService took to complete: 0ms
2023-04-24 11:06:26.366   446-474   SystemSe...ngAsync system_process        I  ssm.onUnlockedUser-0_com.android.server.webkit.WebViewUpdateService
2023-04-24 11:06:26.366   446-474   SystemSe...ngAsync system_process        D  ssm.onUnlockedUser-0_com.android.server.webkit.WebViewUpdateService took to complete: 0ms

基本与第三方APP没什么关系, webview的lib库是在开机就加载的.

bionic/linker/linker.cpp 根据经验,先到linker打打LOG

static int open_library_in_zipfile(ZipArchiveCache* zip_archive_cache,
                                   const char* const input_path,
                                   off64_t* file_offset, std::string* realpath) {
  std::string normalized_path;
  if (!normalize_path(input_path, &normalized_path)) {
    PRINT("open_library_in_zipfile err normallized path");
    return -1;
  }

  const char* const path = normalized_path.c_str();
  TRACE("Trying zip file open from path \"%s\" -> normalized \"%s\"", input_path, path);

  // Treat an '!/' separator inside a path as the separator between the name
  // of the zip file on disk and the subdirectory to search within it.
  // For example, if path is "foo.zip!/bar/bas/x.so", then we search for
  // "bar/bas/x.so" within "foo.zip".
  const char* const separator = strstr(path, kZipFileSeparator);
  if (separator == nullptr) {
    PRINT("open_library_in_zipfile err no separator");
    return -1;
  }

  char buf[512];
  if (strlcpy(buf, path, sizeof(buf)) >= sizeof(buf)) {
    PRINT("Warning: ignoring very long library path: %s", path);
    return -1;
  }

  buf[separator - path] = '\0';

  const char* zip_path = buf;
  const char* file_path = &buf[separator - path + 2];
  int fd = TEMP_FAILURE_RETRY(open(zip_path, O_RDONLY | O_CLOEXEC));
  if (fd == -1) {
    PRINT("open_library_in_zipfile err 0");
    return -1;
  }

  PRINT("open_library_in_zipfile zip_path=%s", zip_path);
  ZipArchiveHandle handle;
  if (!zip_archive_cache->get_or_open(zip_path, &handle)) {
    // invalid zip-file (?)
    close(fd);
    PRINT("open_library_in_zipfile err 1");
    return -1;
  }

  ZipEntry entry;

  if (FindEntry(handle, file_path, &entry) != 0) {
    // Entry was not found.
    close(fd);
    PRINT("open_library_in_zipfile err 2");
    return -1;
  }

  // Check if it is properly stored
  if (entry.method != kCompressStored || (entry.offset % PAGE_SIZE) != 0) {
    close(fd);
    PRINT("open_library_in_zipfile err 3, %d, %d", entry.method != kCompressStored, (entry.offset % PAGE_SIZE) != 0);
    return -1;
  }

  *file_offset = entry.offset;

  if (realpath_fd(fd, realpath)) {
    *realpath += separator;
  } else {
    if (!is_first_stage_init()) {
      PRINT("warning: unable to get realpath for the library \"%s\". Will use given path.",
            normalized_path.c_str());
    }
    *realpath = normalized_path;
  }

  return fd;
}

linker     mark.via  load_library(ns=(default), task=/product/app/webview/oat/arm64/webview.odex, flags=0x2, search_linked_namespaces=0): calling open_library with realpath=
linker     mark.via  open_library name=/product/app/webview/oat/arm64/webview.odex, ns=(default)
linker     mark.via  load_library taskName=libwebviewchromium.so
linker     mark.via  load_library(ns=vendor-classloader-namespace, task=libwebviewchromium.so, flags=0x2, search_linked_namespaces=1): calling open_library with realpath=
linker     mark.via  open_library name=libwebviewchromium.so, ns=vendor-classloader-namespace
linker     mark.via  open_library_in_zipfile zip_path=/product/app/webview/webview.apk
linker     mark.via  open_library_in_zipfile err 3, 1, 1
linker     mark.via  open_library_at_path /product/app/webview/webview.apk!/lib/arm64-v8a/libwebviewchromium.so FAILED
linker     mark.via  open_library_at_path /product/lib64/libwebviewchromium.so FAILED
linker     mark.via  open_library_at_path /product/lib64/libwebviewchromium.so FAILED

error 3 表明,这两个条件都有问题:entry.method != kCompressStored || (entry.offset % PAGE_SIZE) != 0
看文件:

在这里插入图片描述

rk3568_a11$ tree out/target/product/rk3566_r/product/app/webview/
out/target/product/rk3566_r/product/app/webview/
├── oat
│   ├── arm
│   │   ├── webview.odex
│   │   └── webview.vdex
│   └── arm64
│       ├── webview.odex
│       └── webview.vdex
└── webview.apk
//Failed
linker     pid-664 load_library taskName=libwebviewchromium.so
linker     pid-664 load_library(ns=vendor-classloader-namespace, task=libwebviewchromium.so, flags=0x0, search_linked_namespaces=1): calling open_library with realpath=
linker     pid-664 open_library name=libwebviewchromium.so, ns=vendor-classloader-namespace
linker     pid-664 open_library_in_zipfile zip_path=/product/app/webview/webview.apk
linker     pid-664 open_library_in_zipfile err 3, 1, 1
linker     pid-664 open_library_at_path /product/app/webview/webview.apk!/lib/armeabi-v7a/libwebviewchromium.so FAILED

//Success
linker     pid-822 load_library taskName=libwebviewchromium.so
linker     pid-822 load_library(ns=vendor-classloader-namespace, task=libwebviewchromium.so, flags=0x0, search_linked_namespaces=1): calling open_library with realpath=
linker     pid-822 open_library name=libwebviewchromium.so, ns=vendor-classloader-namespace
linker     pid-822 open_library_in_zipfile zip_path=/product/app/webview/webview.apk
linker     pid-822 open_library_at_path /product/app/webview/webview.apk!/lib/armeabi-v7a/libwebviewchromium.so SUCCESS

解决

   非逻辑问题,怀疑webview文件的问题,尝试替换掉webview试试,从另一套代码中拷贝出编译好的webview, PUSH到主板中,问题神奇地消失了。

最终发现是改了编译配置导致生成的webview.apk文件不一致导致(APK的优化对齐相关)。

在修正了文件问题后,对应目录的RELRO存在相应的文件。

rk3566:/ # ll /data/misc/shared_relro/                                                                               
total 5332
-r--r--r-- 1 shared_relro shared_relro 1892352 2023-04-24 15:53 libwebviewchromium32.relro
-r--r--r-- 1 shared_relro shared_relro 3563520 2023-04-24 15:53 libwebviewchromium64.relro

参考

Shared Libraries on Android
Shared Libraries on Android
Android WebView加载Chromium动态库的过程分析
Android系统安全 — 2.0-移动终端栈溢出的保护机制设置
在 WebView 中编译 Web 应用

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/487894.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

凌恩生物美文分享|HGTree v2.0:水平基因转移数据库

水平基因转移(HGT)是指遗传物在物种间从一个相邻生物体到另一个生物体横向传递&#xff0c;是原核生物遗传变异的重要过程。HGT是负责塑造原核生物基因组和在自然选择中生存的驱动力之一&#xff0c;对原核生物的进化有很大贡献&#xff0c;但它会使物种进化史复杂化&#xff0…

观景台售票情况数据分析【Python】

任务1&#xff1a;数据预处理 表格数据资源如下百度网盘&#x1f447; 链接&#xff1a;https://pan.baidu.com/s/1Ry8emM-daxoegF1di4FRyw 提取码&#xff1a;jimb author&#xff1a;用户名rating&#xff1a;消费后打的分time&#xff1a;消费时间year&#xff1a;消费年份…

小米强制淘汰老破小,苹果华为带了好头

了解电脑手机处理器参数的朋友应该对 x86 x64 ARM 等字样不陌生&#xff0c;它们代表着不同的平台架构指令集。 对普通用户来说只需要知道&#xff0c;x86 是32位、x64 &#xff08;又称x86_64、AMD64&#xff09;是64位。 手机上则是以 ARMv7、v8 版本号来作为32、64位分界。…

3 ROS2服务通讯基础

ROS2服务通讯基础 3.1 服务通讯介绍3.2 ROS2服务通讯的基本流程3.2.1 创建ROS2服务通讯功能包的基本流程3.2.2 创建ROS2服务通讯功能包示例 3.3 使用C/C实现ROS2服务通讯3.3.1 创建C/C服务通讯服务端功能包并编写节点文件3.3.2 配置C/C服务通讯服务端功能包3.3.3 编译并运行C/C…

符号三角形-计算机算法设计与分析【1600+字解析 dfs全排列 列举情况】【题意分析】【算法分析】【思路是怎么来的】【过程是什么】

符号三角形 题意分析思路过程分析算法分析 下图是由14个“”和14个“-”组成的符号三角形。2个同号下面都是“”&#xff0c;2个异号下面都是“-”。 在一般情况下&#xff0c;符号三角形的第一行有n个符号。符号三角形问题要求对于给定的n&#xff0c;计算有多少个不同的符号…

JMeter进阶——详解Java请求关于事务的操作 (附源码)

Jmeter事务操作 前面写过一篇文章&#xff0c;介绍Jmeter如何来调用java请求的&#xff0c;可以参考文章 详解JMeter Java请求的设计方法 但这篇文章中有一个问题&#xff0c;在方法public SampleResult runTest(JavaSamplerContext arg0) 中只对一个类的一个api 进行调用&am…

LeetCode 2106. 摘水果

【LetMeFly】2106.摘水果 力扣题目链接&#xff1a;https://leetcode.cn/problems/maximum-fruits-harvested-after-at-most-k-steps/ 在一个无限的 x 坐标轴上&#xff0c;有许多水果分布在其中某些位置。给你一个二维整数数组 fruits &#xff0c;其中 fruits[i] [positio…

Java Test: Specification and Structure Testing(line, branch, path coverage)

这篇文章梳理一下Java软件测试中的Secification test和Structure test。 Specification Test 规范测试&#xff08;specification test&#xff09;&#xff1a;又称黑盒测试&#xff08;black-box testing&#xff09;或需求驱动测试&#xff08;requirements-driven testin…

B树(B-tree、B-树)理论详解

文章目录 基本概念n阶B树的性质&#xff08;n>2&#xff09;B树的搜索B树元素的添加上溢出解决 删除删除叶子节点删除非叶子节点删除——导致下溢出删除——解决下溢出方法一删除——解决下溢出方法二 MongoDB 基本概念 B树是为磁盘或其他直接存取的辅助存储设备而设计的一…

Gitlab on k8s最佳实践

文章目录 gitlab on k8sGitLab部署helm 安装 postgresqlhelm 安装 redis 集群gitlab manifest 部署gitlab如何上传项目&#xff1f;gitlab监控metricsgitlab runner helm 部署helm部署问题k8s中gitlab exector架构图what is Gitlab Runner Helper?gitlab如何连接上k8s&#xf…

【Windows】关闭Windows Update自动更新

目录 一 服务中关闭Win10自动更新及关联服务 二 注册表中关闭Win10自动更新 三 组策略中关闭Win10自动更新 四 计划任务中关闭Win10自动更新 电脑系统盘不够用了&#xff0c;为此准备关闭Windows Update自动更新&#xff0c;以节省空间。为保证关闭之后不死灰复燃&#xff…

Ajax入门

在B/S架构中&#xff0c;浏览器端发送请求的传统方式如下&#xff1a; 1.直接在浏览器地址栏上输入url 2.超链接 3.from表单 4.在JavaScript代码中发送请求 1&#xff09;window.open(url) 2&#xff09;document.location.href url 3&#xff09;window.location.href url ……

优思学院|精益生产在制药行业的应用情况如何?

精益生产作为一项优化生产过程、提高效率的方法论&#xff0c;精益生产在制药行业得到了广泛应用。其核心理念是通过消除浪费&#xff0c;不断改进生产流程&#xff0c;实现资源的最大化利用和生产成本的最小化&#xff0c;从而提高企业的竞争力和市场占有率。 在制药行业&…

Java语言----LinkedList 和 链表的实现

目录 一.链表概念 二.链表的分类 三.无头单向非循环链表的实现 3.1创建简单链表 3.2 链表基本方法实现 3.3四大基本功能 3.3.1.增加元素结点 3.3.2.查找元素结点 3.3.3.删除元素结点 3.3.4.结点信息修改 四.LinkedList是什么&#xff1f; 五.LinkedList使用方法 总结 …

蓝牙耳机哪款性价比高?2023蓝牙耳机性价比排行

随着蓝牙耳机的使用愈发频繁&#xff0c;蓝牙耳机产品也越来越多&#xff0c;蓝牙耳机的功能、价格、外观设计等都不尽相同。接下来&#xff0c;我来给大家推荐几款性价比高的蓝牙耳机&#xff0c;感兴趣的朋友一起来看看吧。 一、南卡小音舱Lite2蓝牙耳机 参考价&#xff1a…

unity,如何让当前物体获取鼠标位置,转向鼠标在屏幕中的位置?

介绍 unity&#xff0c;如何让当前物体获取鼠标位置&#xff0c;转向鼠标在屏幕中的位置&#xff1f; 方法 void Update() {// 获取鼠标在屏幕上的位置Vector3 mousePos Input.mousePosition;// 将鼠标在屏幕上的位置转换为世界空间中的位置Vector3 worldPos Camera.main.S…

C++11多线程join()和detach()的理解

简介 每一个程序至少拥有一个线程&#xff0c;那就是执行main()函数的主线程&#xff0c;而多线程则是出现两个或两个以上的线程并行运行&#xff0c;即主线程和子线程在同一时间段同时运行。而在这个过程中会出现几种情况&#xff1a; 主线程先运行结束子线程先运行结束主子…

NLP实战:基于Pytorch的文本分类入门实战

目录 一、前期准备 1.环境准备 2.加载数据 二、代码实战 1.构建词典 2.生成数据批次和迭代器 3. 定义模型 4. 定义实例 5.定义训练函数与评估函数 6.拆分数据集并运行模型 三、使用测试数据集评估模型 四、总结 这是一个使用PyTorch实现的简单文本分类实战案例。在…

MySQL_1 数据库的基本操作

目录 一、拾枝杂谈 1.cmd验证MySQL服务 : 2.cmd连接MySQL服务 : 3.MySQL服务 : 二、数据库介绍 1.定义 : 2.SQL语句分类 : 三、数据库操作 1.数据库的创建 : 1 基本语法 2 演示 2.数据库的删除 : 1 基本语法 2 演示 3. 数据库的查询 : 1 基本语法 2 演示 4.数据库的…

【youcans 的 OpenCV 学习课】21. Haar 小波变换

专栏地址&#xff1a;『youcans 的图像处理学习课』 文章目录&#xff1a;『youcans 的图像处理学习课 - 总目录』 【youcans 的 OpenCV 学习课】21. Haar 小波变换 1. 小波变换1.1 小波变换基本概念例程 17_1&#xff1a;常用小波族的图像 1.2 连续小波变换1.3 离散小波变换&a…