code: @Implementation(minSdk = P)
    protected static void nativeSetApkAssets(long ptr, @NonNull android.content.res.ApkAssets[] apk_assets_array,
        boolean invalidate_caches) {
      ATRACE_NAME("AssetManager::SetApkAssets");
  
      int apk_assets_len = apk_assets_array.length;
      List<CppApkAssets> apk_assets = new ArrayList<>();
      // apk_assets.reserve(apk_assets_len);
      for (int i = 0; i < apk_assets_len; i++) {
        android.content.res.ApkAssets apkAssets = apk_assets_array[i]; // env.GetObjectArrayElement(apk_assets_array, i);
        if (apkAssets == null) {
          throw new NullPointerException(String.format("ApkAssets at index %d is null", i));
        }
  
        long apk_assets_native_ptr = ((ShadowArscApkAssets9) Shadow.extract(apkAssets)).getNativePtr();
        // if (env.ExceptionCheck()) {
        //   return;
        // }
        apk_assets.add(Registries.NATIVE_APK_ASSETS_REGISTRY.getNativeObject(apk_assets_native_ptr));
      }
  
      CppAssetManager2 assetmanager = AssetManagerFromLong(ptr);
      assetmanager.SetApkAssets(apk_assets, invalidate_caches);
    }
docs: jobjectArray apk_assets_array, jboolean invalidate_caches) {