Skip to content

Commit

Permalink
changed
Browse files Browse the repository at this point in the history
  • Loading branch information
DaVinci9196 committed Jan 16, 2025
1 parent ff10391 commit 3b83367
Showing 1 changed file with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@
import android.content.Context;
import android.content.ContextWrapper;
import android.os.Build;
import android.util.Log;
import android.webkit.WebSettings;
import androidx.annotation.Keep;
import android.webkit.WebView;

import java.io.File;
import androidx.annotation.Keep;

@Keep
public class ModuleDescriptor {
private static final String TAG = "ModuleDescriptor";
public static final String MODULE_ID = "com.google.android.gms.ads.dynamite";
public static final int MODULE_VERSION = 230500001;

Expand All @@ -31,14 +29,12 @@ public static void init(Context context) {
if (context instanceof ContextWrapper) {
context = ((ContextWrapper) context).getBaseContext();
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
File webViewDataDir = new File(context.getDataDir(), "app_webview");
if (webViewDataDir.exists()) {
Log.d(TAG, "WebView data directory is initialized");
WebSettings.getDefaultUserAgent(context);
} else {
Log.d(TAG, "WebView data directory is not initialized.");
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
try {
WebView.setDataDirectorySuffix(context.getPackageName());
return;
} catch (Exception ignored) {}
}
WebSettings.getDefaultUserAgent(context);
}
}

0 comments on commit 3b83367

Please sign in to comment.