diff --git a/CHANGELOG.md b/CHANGELOG.md index 50f9f425..24ee4e7b 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,8 @@ ### BREAKING CHANGES - Plugin conversion to a [Federated Plugin](https://docs.flutter.dev/packages-and-plugins/developing-packages#federated-plugins) to better support multiple environments and implementations. -- `web_support.js` path has been changed to `packages/flutter_inappwebview_web/assets/web/web_support.js` +- Android package name has been changed to `com.pichillilorenzo.flutter_inappwebview_android`. References to old package name `com.pichillilorenzo.flutter_inappwebview` should be updated, for example inside `AndroidManifest.xml` file: ` ; ; public *; private *; } --keep class com.pichillilorenzo.flutter_inappwebview.** { *; } \ No newline at end of file +-keep class com.pichillilorenzo.flutter_inappwebview_android.** { *; } \ No newline at end of file diff --git a/flutter_inappwebview_android/android/settings.gradle b/flutter_inappwebview_android/android/settings.gradle index 62d7fc6d..5841fff0 100755 --- a/flutter_inappwebview_android/android/settings.gradle +++ b/flutter_inappwebview_android/android/settings.gradle @@ -1 +1 @@ -rootProject.name = 'flutter_inappwebview' +rootProject.name = 'flutter_inappwebview_android' diff --git a/flutter_inappwebview_android/android/src/main/AndroidManifest.xml b/flutter_inappwebview_android/android/src/main/AndroidManifest.xml index c509a1fe..c8036b21 100755 --- a/flutter_inappwebview_android/android/src/main/AndroidManifest.xml +++ b/flutter_inappwebview_android/android/src/main/AndroidManifest.xml @@ -1,32 +1,32 @@ + package="com.pichillilorenzo.flutter_inappwebview_android"> + android:name="com.pichillilorenzo.flutter_inappwebview_android.chrome_custom_tabs.ChromeCustomTabsActivity" /> + android:name="com.pichillilorenzo.flutter_inappwebview_android.chrome_custom_tabs.TrustedWebActivity" /> callback); void postWebMessage(WebMessage message, Uri targetOrigin); - void postWebMessage(com.pichillilorenzo.flutter_inappwebview.types.WebMessage message, Uri targetOrigin, ValueCallback callback) throws Exception; + void postWebMessage(com.pichillilorenzo.flutter_inappwebview_android.types.WebMessage message, Uri targetOrigin, ValueCallback callback) throws Exception; void addWebMessageListener(WebMessageListener webMessageListener) throws Exception; boolean canScrollVertically(); boolean canScrollHorizontally(); diff --git a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/InAppWebViewManager.java b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/InAppWebViewManager.java similarity index 94% rename from flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/InAppWebViewManager.java rename to flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/InAppWebViewManager.java index 8e5e7f0c..98280fc5 100755 --- a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/InAppWebViewManager.java +++ b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/InAppWebViewManager.java @@ -1,8 +1,7 @@ -package com.pichillilorenzo.flutter_inappwebview.webview; +package com.pichillilorenzo.flutter_inappwebview_android.webview; import android.content.Context; import android.content.pm.PackageInfo; -import android.net.Uri; import android.os.Build; import android.os.Message; import android.view.View; @@ -16,10 +15,9 @@ import androidx.annotation.Nullable; import androidx.webkit.WebViewCompat; import androidx.webkit.WebViewFeature; -import com.pichillilorenzo.flutter_inappwebview.InAppWebViewFlutterPlugin; -import com.pichillilorenzo.flutter_inappwebview.headless_in_app_webview.HeadlessInAppWebView; -import com.pichillilorenzo.flutter_inappwebview.types.ChannelDelegateImpl; -import com.pichillilorenzo.flutter_inappwebview.webview.in_app_webview.FlutterWebView; +import com.pichillilorenzo.flutter_inappwebview_android.InAppWebViewFlutterPlugin; +import com.pichillilorenzo.flutter_inappwebview_android.types.ChannelDelegateImpl; +import com.pichillilorenzo.flutter_inappwebview_android.webview.in_app_webview.FlutterWebView; import java.util.Collection; import java.util.HashMap; diff --git a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/JavaScriptBridgeInterface.java b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/JavaScriptBridgeInterface.java similarity index 91% rename from flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/JavaScriptBridgeInterface.java rename to flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/JavaScriptBridgeInterface.java index bfe947f9..a805b519 100755 --- a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/JavaScriptBridgeInterface.java +++ b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/JavaScriptBridgeInterface.java @@ -1,4 +1,4 @@ -package com.pichillilorenzo.flutter_inappwebview.webview; +package com.pichillilorenzo.flutter_inappwebview_android.webview; import android.os.Build; import android.os.Handler; @@ -9,13 +9,10 @@ import android.webkit.ValueCallback; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.pichillilorenzo.flutter_inappwebview.print_job.PrintJobController; -import com.pichillilorenzo.flutter_inappwebview.print_job.PrintJobManager; -import com.pichillilorenzo.flutter_inappwebview.print_job.PrintJobSettings; -import com.pichillilorenzo.flutter_inappwebview.webview.WebViewChannelDelegate; -import com.pichillilorenzo.flutter_inappwebview.webview.in_app_webview.InAppWebView; -import com.pichillilorenzo.flutter_inappwebview.plugin_scripts_js.JavaScriptBridgeJS; -import com.pichillilorenzo.flutter_inappwebview.webview.in_app_webview.InAppWebViewChromeClient; +import com.pichillilorenzo.flutter_inappwebview_android.print_job.PrintJobController; +import com.pichillilorenzo.flutter_inappwebview_android.print_job.PrintJobSettings; +import com.pichillilorenzo.flutter_inappwebview_android.webview.in_app_webview.InAppWebView; +import com.pichillilorenzo.flutter_inappwebview_android.plugin_scripts_js.JavaScriptBridgeJS; import org.json.JSONArray; import org.json.JSONException; diff --git a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/PlatformWebView.java b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/PlatformWebView.java similarity index 74% rename from flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/PlatformWebView.java rename to flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/PlatformWebView.java index a756ec4b..93ae83fa 100644 --- a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/PlatformWebView.java +++ b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/PlatformWebView.java @@ -1,4 +1,4 @@ -package com.pichillilorenzo.flutter_inappwebview.webview; +package com.pichillilorenzo.flutter_inappwebview_android.webview; import java.util.HashMap; diff --git a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/WebViewChannelDelegate.java b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/WebViewChannelDelegate.java similarity index 92% rename from flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/WebViewChannelDelegate.java rename to flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/WebViewChannelDelegate.java index 6324159f..cb1baacd 100644 --- a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/WebViewChannelDelegate.java +++ b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/WebViewChannelDelegate.java @@ -1,4 +1,4 @@ -package com.pichillilorenzo.flutter_inappwebview.webview; +package com.pichillilorenzo.flutter_inappwebview_android.webview; import android.net.Uri; import android.os.Build; @@ -12,47 +12,46 @@ import androidx.webkit.WebMessagePortCompat; import androidx.webkit.WebViewCompat; import androidx.webkit.WebViewFeature; -import com.pichillilorenzo.flutter_inappwebview.Util; -import com.pichillilorenzo.flutter_inappwebview.find_interaction.FindInteractionChannelDelegate; -import com.pichillilorenzo.flutter_inappwebview.in_app_browser.InAppBrowserActivity; -import com.pichillilorenzo.flutter_inappwebview.in_app_browser.InAppBrowserSettings; -import com.pichillilorenzo.flutter_inappwebview.print_job.PrintJobSettings; -import com.pichillilorenzo.flutter_inappwebview.types.BaseCallbackResultImpl; -import com.pichillilorenzo.flutter_inappwebview.types.ChannelDelegateImpl; -import com.pichillilorenzo.flutter_inappwebview.types.ClientCertChallenge; -import com.pichillilorenzo.flutter_inappwebview.types.ClientCertResponse; -import com.pichillilorenzo.flutter_inappwebview.types.ContentWorld; -import com.pichillilorenzo.flutter_inappwebview.types.CreateWindowAction; -import com.pichillilorenzo.flutter_inappwebview.types.CustomSchemeResponse; -import com.pichillilorenzo.flutter_inappwebview.types.DownloadStartRequest; -import com.pichillilorenzo.flutter_inappwebview.types.GeolocationPermissionShowPromptResponse; -import com.pichillilorenzo.flutter_inappwebview.types.HitTestResult; -import com.pichillilorenzo.flutter_inappwebview.types.HttpAuthResponse; -import com.pichillilorenzo.flutter_inappwebview.types.HttpAuthenticationChallenge; -import com.pichillilorenzo.flutter_inappwebview.types.JsAlertResponse; -import com.pichillilorenzo.flutter_inappwebview.types.JsBeforeUnloadResponse; -import com.pichillilorenzo.flutter_inappwebview.types.JsConfirmResponse; -import com.pichillilorenzo.flutter_inappwebview.types.JsPromptResponse; -import com.pichillilorenzo.flutter_inappwebview.types.NavigationAction; -import com.pichillilorenzo.flutter_inappwebview.types.NavigationActionPolicy; -import com.pichillilorenzo.flutter_inappwebview.types.PermissionResponse; -import com.pichillilorenzo.flutter_inappwebview.types.SafeBrowsingResponse; -import com.pichillilorenzo.flutter_inappwebview.types.ServerTrustAuthResponse; -import com.pichillilorenzo.flutter_inappwebview.types.ServerTrustChallenge; -import com.pichillilorenzo.flutter_inappwebview.types.SslCertificateExt; -import com.pichillilorenzo.flutter_inappwebview.types.SyncBaseCallbackResultImpl; -import com.pichillilorenzo.flutter_inappwebview.types.URLRequest; -import com.pichillilorenzo.flutter_inappwebview.types.UserScript; -import com.pichillilorenzo.flutter_inappwebview.types.WebMessageCompatExt; -import com.pichillilorenzo.flutter_inappwebview.types.WebMessagePort; -import com.pichillilorenzo.flutter_inappwebview.types.WebMessagePortCompatExt; -import com.pichillilorenzo.flutter_inappwebview.types.WebResourceErrorExt; -import com.pichillilorenzo.flutter_inappwebview.types.WebResourceRequestExt; -import com.pichillilorenzo.flutter_inappwebview.types.WebResourceResponseExt; -import com.pichillilorenzo.flutter_inappwebview.webview.in_app_webview.InAppWebView; -import com.pichillilorenzo.flutter_inappwebview.webview.in_app_webview.InAppWebViewSettings; -import com.pichillilorenzo.flutter_inappwebview.webview.web_message.WebMessageChannel; -import com.pichillilorenzo.flutter_inappwebview.webview.web_message.WebMessageListener; +import com.pichillilorenzo.flutter_inappwebview_android.Util; +import com.pichillilorenzo.flutter_inappwebview_android.find_interaction.FindInteractionChannelDelegate; +import com.pichillilorenzo.flutter_inappwebview_android.in_app_browser.InAppBrowserActivity; +import com.pichillilorenzo.flutter_inappwebview_android.in_app_browser.InAppBrowserSettings; +import com.pichillilorenzo.flutter_inappwebview_android.print_job.PrintJobSettings; +import com.pichillilorenzo.flutter_inappwebview_android.types.BaseCallbackResultImpl; +import com.pichillilorenzo.flutter_inappwebview_android.types.ChannelDelegateImpl; +import com.pichillilorenzo.flutter_inappwebview_android.types.ClientCertChallenge; +import com.pichillilorenzo.flutter_inappwebview_android.types.ClientCertResponse; +import com.pichillilorenzo.flutter_inappwebview_android.types.ContentWorld; +import com.pichillilorenzo.flutter_inappwebview_android.types.CreateWindowAction; +import com.pichillilorenzo.flutter_inappwebview_android.types.CustomSchemeResponse; +import com.pichillilorenzo.flutter_inappwebview_android.types.DownloadStartRequest; +import com.pichillilorenzo.flutter_inappwebview_android.types.GeolocationPermissionShowPromptResponse; +import com.pichillilorenzo.flutter_inappwebview_android.types.HitTestResult; +import com.pichillilorenzo.flutter_inappwebview_android.types.HttpAuthResponse; +import com.pichillilorenzo.flutter_inappwebview_android.types.HttpAuthenticationChallenge; +import com.pichillilorenzo.flutter_inappwebview_android.types.JsAlertResponse; +import com.pichillilorenzo.flutter_inappwebview_android.types.JsBeforeUnloadResponse; +import com.pichillilorenzo.flutter_inappwebview_android.types.JsConfirmResponse; +import com.pichillilorenzo.flutter_inappwebview_android.types.JsPromptResponse; +import com.pichillilorenzo.flutter_inappwebview_android.types.NavigationAction; +import com.pichillilorenzo.flutter_inappwebview_android.types.NavigationActionPolicy; +import com.pichillilorenzo.flutter_inappwebview_android.types.PermissionResponse; +import com.pichillilorenzo.flutter_inappwebview_android.types.SafeBrowsingResponse; +import com.pichillilorenzo.flutter_inappwebview_android.types.ServerTrustAuthResponse; +import com.pichillilorenzo.flutter_inappwebview_android.types.ServerTrustChallenge; +import com.pichillilorenzo.flutter_inappwebview_android.types.SslCertificateExt; +import com.pichillilorenzo.flutter_inappwebview_android.types.SyncBaseCallbackResultImpl; +import com.pichillilorenzo.flutter_inappwebview_android.types.URLRequest; +import com.pichillilorenzo.flutter_inappwebview_android.types.UserScript; +import com.pichillilorenzo.flutter_inappwebview_android.types.WebMessageCompatExt; +import com.pichillilorenzo.flutter_inappwebview_android.types.WebMessagePortCompatExt; +import com.pichillilorenzo.flutter_inappwebview_android.types.WebResourceErrorExt; +import com.pichillilorenzo.flutter_inappwebview_android.types.WebResourceRequestExt; +import com.pichillilorenzo.flutter_inappwebview_android.types.WebResourceResponseExt; +import com.pichillilorenzo.flutter_inappwebview_android.webview.in_app_webview.InAppWebView; +import com.pichillilorenzo.flutter_inappwebview_android.webview.in_app_webview.InAppWebViewSettings; +import com.pichillilorenzo.flutter_inappwebview_android.webview.web_message.WebMessageChannel; +import com.pichillilorenzo.flutter_inappwebview_android.webview.web_message.WebMessageListener; import java.io.IOException; import java.util.ArrayList; diff --git a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/WebViewChannelDelegateMethods.java b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/WebViewChannelDelegateMethods.java similarity index 95% rename from flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/WebViewChannelDelegateMethods.java rename to flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/WebViewChannelDelegateMethods.java index d87954f6..049a6a59 100644 --- a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/WebViewChannelDelegateMethods.java +++ b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/WebViewChannelDelegateMethods.java @@ -1,4 +1,4 @@ -package com.pichillilorenzo.flutter_inappwebview.webview; +package com.pichillilorenzo.flutter_inappwebview_android.webview; public enum WebViewChannelDelegateMethods { getUrl, diff --git a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/DisplayListenerProxy.java b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/DisplayListenerProxy.java similarity index 98% rename from flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/DisplayListenerProxy.java rename to flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/DisplayListenerProxy.java index eb92c83f..ebe487ef 100755 --- a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/DisplayListenerProxy.java +++ b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/DisplayListenerProxy.java @@ -1,4 +1,4 @@ -package com.pichillilorenzo.flutter_inappwebview.webview.in_app_webview; +package com.pichillilorenzo.flutter_inappwebview_android.webview.in_app_webview; import static android.hardware.display.DisplayManager.DisplayListener; diff --git a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/FlutterWebView.java b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/FlutterWebView.java similarity index 88% rename from flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/FlutterWebView.java rename to flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/FlutterWebView.java index e2f5153c..b7666768 100755 --- a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/FlutterWebView.java +++ b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/FlutterWebView.java @@ -1,32 +1,26 @@ -package com.pichillilorenzo.flutter_inappwebview.webview.in_app_webview; +package com.pichillilorenzo.flutter_inappwebview_android.webview.in_app_webview; import android.annotation.SuppressLint; import android.content.Context; import android.hardware.display.DisplayManager; -import android.os.Build; import android.os.Message; import android.util.Log; import android.view.View; import android.view.ViewGroup; -import android.webkit.WebChromeClient; -import android.webkit.WebSettings; import android.webkit.WebView; -import android.webkit.WebViewClient; import android.widget.FrameLayout; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.webkit.WebViewCompat; import androidx.webkit.WebViewFeature; -import com.pichillilorenzo.flutter_inappwebview.InAppWebViewFlutterPlugin; -import com.pichillilorenzo.flutter_inappwebview.find_interaction.FindInteractionController; -import com.pichillilorenzo.flutter_inappwebview.plugin_scripts_js.JavaScriptBridgeJS; -import com.pichillilorenzo.flutter_inappwebview.pull_to_refresh.PullToRefreshLayout; -import com.pichillilorenzo.flutter_inappwebview.pull_to_refresh.PullToRefreshSettings; -import com.pichillilorenzo.flutter_inappwebview.webview.PlatformWebView; -import com.pichillilorenzo.flutter_inappwebview.types.URLRequest; -import com.pichillilorenzo.flutter_inappwebview.types.UserScript; +import com.pichillilorenzo.flutter_inappwebview_android.InAppWebViewFlutterPlugin; +import com.pichillilorenzo.flutter_inappwebview_android.find_interaction.FindInteractionController; +import com.pichillilorenzo.flutter_inappwebview_android.pull_to_refresh.PullToRefreshLayout; +import com.pichillilorenzo.flutter_inappwebview_android.pull_to_refresh.PullToRefreshSettings; +import com.pichillilorenzo.flutter_inappwebview_android.webview.PlatformWebView; +import com.pichillilorenzo.flutter_inappwebview_android.types.URLRequest; +import com.pichillilorenzo.flutter_inappwebview_android.types.UserScript; import java.io.IOException; import java.util.ArrayList; diff --git a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebView.java b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/InAppWebView.java similarity index 95% rename from flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebView.java rename to flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/InAppWebView.java index 0d10d254..dd56b1d8 100755 --- a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebView.java +++ b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/InAppWebView.java @@ -1,7 +1,7 @@ -package com.pichillilorenzo.flutter_inappwebview.webview.in_app_webview; +package com.pichillilorenzo.flutter_inappwebview_android.webview.in_app_webview; import static android.content.Context.INPUT_METHOD_SERVICE; -import static com.pichillilorenzo.flutter_inappwebview.types.PreferredContentModeOptionType.fromValue; +import static com.pichillilorenzo.flutter_inappwebview_android.types.PreferredContentModeOptionType.fromValue; import android.animation.ObjectAnimator; import android.animation.PropertyValuesHolder; @@ -62,42 +62,42 @@ import androidx.webkit.WebSettingsCompat; import androidx.webkit.WebViewCompat; import androidx.webkit.WebViewFeature; -import com.pichillilorenzo.flutter_inappwebview.InAppWebViewFlutterPlugin; -import com.pichillilorenzo.flutter_inappwebview.R; -import com.pichillilorenzo.flutter_inappwebview.Util; -import com.pichillilorenzo.flutter_inappwebview.content_blocker.ContentBlocker; -import com.pichillilorenzo.flutter_inappwebview.content_blocker.ContentBlockerAction; -import com.pichillilorenzo.flutter_inappwebview.content_blocker.ContentBlockerHandler; -import com.pichillilorenzo.flutter_inappwebview.content_blocker.ContentBlockerTrigger; -import com.pichillilorenzo.flutter_inappwebview.find_interaction.FindInteractionController; -import com.pichillilorenzo.flutter_inappwebview.in_app_browser.InAppBrowserDelegate; -import com.pichillilorenzo.flutter_inappwebview.plugin_scripts_js.ConsoleLogJS; -import com.pichillilorenzo.flutter_inappwebview.plugin_scripts_js.InterceptAjaxRequestJS; -import com.pichillilorenzo.flutter_inappwebview.plugin_scripts_js.InterceptFetchRequestJS; -import com.pichillilorenzo.flutter_inappwebview.plugin_scripts_js.JavaScriptBridgeJS; -import com.pichillilorenzo.flutter_inappwebview.plugin_scripts_js.OnLoadResourceJS; -import com.pichillilorenzo.flutter_inappwebview.plugin_scripts_js.OnWindowBlurEventJS; -import com.pichillilorenzo.flutter_inappwebview.plugin_scripts_js.OnWindowFocusEventJS; -import com.pichillilorenzo.flutter_inappwebview.plugin_scripts_js.PluginScriptsUtil; -import com.pichillilorenzo.flutter_inappwebview.plugin_scripts_js.PrintJS; -import com.pichillilorenzo.flutter_inappwebview.plugin_scripts_js.PromisePolyfillJS; -import com.pichillilorenzo.flutter_inappwebview.print_job.PrintJobController; -import com.pichillilorenzo.flutter_inappwebview.print_job.PrintJobSettings; -import com.pichillilorenzo.flutter_inappwebview.pull_to_refresh.PullToRefreshLayout; -import com.pichillilorenzo.flutter_inappwebview.types.ContentWorld; -import com.pichillilorenzo.flutter_inappwebview.types.DownloadStartRequest; -import com.pichillilorenzo.flutter_inappwebview.types.PluginScript; -import com.pichillilorenzo.flutter_inappwebview.types.PreferredContentModeOptionType; -import com.pichillilorenzo.flutter_inappwebview.types.URLRequest; -import com.pichillilorenzo.flutter_inappwebview.types.UserContentController; -import com.pichillilorenzo.flutter_inappwebview.types.UserScript; -import com.pichillilorenzo.flutter_inappwebview.types.WebViewAssetLoaderExt; -import com.pichillilorenzo.flutter_inappwebview.webview.ContextMenuSettings; -import com.pichillilorenzo.flutter_inappwebview.webview.InAppWebViewInterface; -import com.pichillilorenzo.flutter_inappwebview.webview.JavaScriptBridgeInterface; -import com.pichillilorenzo.flutter_inappwebview.webview.WebViewChannelDelegate; -import com.pichillilorenzo.flutter_inappwebview.webview.web_message.WebMessageChannel; -import com.pichillilorenzo.flutter_inappwebview.webview.web_message.WebMessageListener; +import com.pichillilorenzo.flutter_inappwebview_android.InAppWebViewFlutterPlugin; +import com.pichillilorenzo.flutter_inappwebview_android.R; +import com.pichillilorenzo.flutter_inappwebview_android.Util; +import com.pichillilorenzo.flutter_inappwebview_android.content_blocker.ContentBlocker; +import com.pichillilorenzo.flutter_inappwebview_android.content_blocker.ContentBlockerAction; +import com.pichillilorenzo.flutter_inappwebview_android.content_blocker.ContentBlockerHandler; +import com.pichillilorenzo.flutter_inappwebview_android.content_blocker.ContentBlockerTrigger; +import com.pichillilorenzo.flutter_inappwebview_android.find_interaction.FindInteractionController; +import com.pichillilorenzo.flutter_inappwebview_android.in_app_browser.InAppBrowserDelegate; +import com.pichillilorenzo.flutter_inappwebview_android.plugin_scripts_js.ConsoleLogJS; +import com.pichillilorenzo.flutter_inappwebview_android.plugin_scripts_js.InterceptAjaxRequestJS; +import com.pichillilorenzo.flutter_inappwebview_android.plugin_scripts_js.InterceptFetchRequestJS; +import com.pichillilorenzo.flutter_inappwebview_android.plugin_scripts_js.JavaScriptBridgeJS; +import com.pichillilorenzo.flutter_inappwebview_android.plugin_scripts_js.OnLoadResourceJS; +import com.pichillilorenzo.flutter_inappwebview_android.plugin_scripts_js.OnWindowBlurEventJS; +import com.pichillilorenzo.flutter_inappwebview_android.plugin_scripts_js.OnWindowFocusEventJS; +import com.pichillilorenzo.flutter_inappwebview_android.plugin_scripts_js.PluginScriptsUtil; +import com.pichillilorenzo.flutter_inappwebview_android.plugin_scripts_js.PrintJS; +import com.pichillilorenzo.flutter_inappwebview_android.plugin_scripts_js.PromisePolyfillJS; +import com.pichillilorenzo.flutter_inappwebview_android.print_job.PrintJobController; +import com.pichillilorenzo.flutter_inappwebview_android.print_job.PrintJobSettings; +import com.pichillilorenzo.flutter_inappwebview_android.pull_to_refresh.PullToRefreshLayout; +import com.pichillilorenzo.flutter_inappwebview_android.types.ContentWorld; +import com.pichillilorenzo.flutter_inappwebview_android.types.DownloadStartRequest; +import com.pichillilorenzo.flutter_inappwebview_android.types.PluginScript; +import com.pichillilorenzo.flutter_inappwebview_android.types.PreferredContentModeOptionType; +import com.pichillilorenzo.flutter_inappwebview_android.types.URLRequest; +import com.pichillilorenzo.flutter_inappwebview_android.types.UserContentController; +import com.pichillilorenzo.flutter_inappwebview_android.types.UserScript; +import com.pichillilorenzo.flutter_inappwebview_android.types.WebViewAssetLoaderExt; +import com.pichillilorenzo.flutter_inappwebview_android.webview.ContextMenuSettings; +import com.pichillilorenzo.flutter_inappwebview_android.webview.InAppWebViewInterface; +import com.pichillilorenzo.flutter_inappwebview_android.webview.JavaScriptBridgeInterface; +import com.pichillilorenzo.flutter_inappwebview_android.webview.WebViewChannelDelegate; +import com.pichillilorenzo.flutter_inappwebview_android.webview.web_message.WebMessageChannel; +import com.pichillilorenzo.flutter_inappwebview_android.webview.web_message.WebMessageListener; import org.json.JSONObject; @@ -108,7 +108,6 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.UUID; import java.util.regex.Pattern; @@ -551,8 +550,8 @@ final public class InAppWebView extends InputAwareWebView implements InAppWebVie setOnLongClickListener(new OnLongClickListener() { @Override public boolean onLongClick(View v) { - com.pichillilorenzo.flutter_inappwebview.types.HitTestResult hitTestResult = - com.pichillilorenzo.flutter_inappwebview.types.HitTestResult.fromWebViewHitTestResult(getHitTestResult()); + com.pichillilorenzo.flutter_inappwebview_android.types.HitTestResult hitTestResult = + com.pichillilorenzo.flutter_inappwebview_android.types.HitTestResult.fromWebViewHitTestResult(getHitTestResult()); if (channelDelegate != null) channelDelegate.onLongPressHitTestResult(hitTestResult); return false; } @@ -1461,8 +1460,8 @@ final public class InAppWebView extends InputAwareWebView implements InAppWebVie } private void sendOnCreateContextMenuEvent() { - com.pichillilorenzo.flutter_inappwebview.types.HitTestResult hitTestResult = - com.pichillilorenzo.flutter_inappwebview.types.HitTestResult.fromWebViewHitTestResult(getHitTestResult()); + com.pichillilorenzo.flutter_inappwebview_android.types.HitTestResult hitTestResult = + com.pichillilorenzo.flutter_inappwebview_android.types.HitTestResult.fromWebViewHitTestResult(getHitTestResult()); if (channelDelegate != null) channelDelegate.onCreateContextMenu(hitTestResult); } @@ -1911,7 +1910,7 @@ final public class InAppWebView extends InputAwareWebView implements InAppWebVie } @Override - public void postWebMessage(com.pichillilorenzo.flutter_inappwebview.types.WebMessage message, Uri targetOrigin, ValueCallback callback) throws Exception { + public void postWebMessage(com.pichillilorenzo.flutter_inappwebview_android.types.WebMessage message, Uri targetOrigin, ValueCallback callback) throws Exception { throw new UnsupportedOperationException(); } @@ -1997,8 +1996,8 @@ final public class InAppWebView extends InputAwareWebView implements InAppWebVie } @Override - public void getHitTestResult(ValueCallback callback) { - callback.onReceiveValue(com.pichillilorenzo.flutter_inappwebview.types.HitTestResult.fromWebViewHitTestResult(getHitTestResult())); + public void getHitTestResult(ValueCallback callback) { + callback.onReceiveValue(com.pichillilorenzo.flutter_inappwebview_android.types.HitTestResult.fromWebViewHitTestResult(getHitTestResult())); } @Nullable diff --git a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebViewChromeClient.java b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/InAppWebViewChromeClient.java similarity index 96% rename from flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebViewChromeClient.java rename to flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/InAppWebViewChromeClient.java index 75f1fcf5..6940eafd 100755 --- a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebViewChromeClient.java +++ b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/InAppWebViewChromeClient.java @@ -1,9 +1,8 @@ -package com.pichillilorenzo.flutter_inappwebview.webview.in_app_webview; +package com.pichillilorenzo.flutter_inappwebview_android.webview.in_app_webview; import android.Manifest; import android.annotation.TargetApi; import android.app.Activity; -import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.pm.PackageManager; @@ -20,7 +19,6 @@ import android.os.Parcelable; import android.provider.MediaStore; import android.util.Log; import android.view.Gravity; -import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; @@ -36,8 +34,6 @@ import android.webkit.WebView; import android.widget.EditText; import android.widget.FrameLayout; import android.widget.LinearLayout; -import android.widget.ProgressBar; -import android.widget.RelativeLayout; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -46,19 +42,19 @@ import androidx.appcompat.app.AlertDialog; import androidx.core.content.ContextCompat; import androidx.core.content.FileProvider; -import com.pichillilorenzo.flutter_inappwebview.InAppWebViewFileProvider; -import com.pichillilorenzo.flutter_inappwebview.types.CreateWindowAction; -import com.pichillilorenzo.flutter_inappwebview.in_app_browser.ActivityResultListener; -import com.pichillilorenzo.flutter_inappwebview.in_app_browser.InAppBrowserDelegate; -import com.pichillilorenzo.flutter_inappwebview.InAppWebViewFlutterPlugin; -import com.pichillilorenzo.flutter_inappwebview.types.GeolocationPermissionShowPromptResponse; -import com.pichillilorenzo.flutter_inappwebview.types.JsAlertResponse; -import com.pichillilorenzo.flutter_inappwebview.types.JsBeforeUnloadResponse; -import com.pichillilorenzo.flutter_inappwebview.types.JsConfirmResponse; -import com.pichillilorenzo.flutter_inappwebview.types.JsPromptResponse; -import com.pichillilorenzo.flutter_inappwebview.types.PermissionResponse; -import com.pichillilorenzo.flutter_inappwebview.types.URLRequest; -import com.pichillilorenzo.flutter_inappwebview.webview.WebViewChannelDelegate; +import com.pichillilorenzo.flutter_inappwebview_android.InAppWebViewFileProvider; +import com.pichillilorenzo.flutter_inappwebview_android.types.CreateWindowAction; +import com.pichillilorenzo.flutter_inappwebview_android.in_app_browser.ActivityResultListener; +import com.pichillilorenzo.flutter_inappwebview_android.in_app_browser.InAppBrowserDelegate; +import com.pichillilorenzo.flutter_inappwebview_android.InAppWebViewFlutterPlugin; +import com.pichillilorenzo.flutter_inappwebview_android.types.GeolocationPermissionShowPromptResponse; +import com.pichillilorenzo.flutter_inappwebview_android.types.JsAlertResponse; +import com.pichillilorenzo.flutter_inappwebview_android.types.JsBeforeUnloadResponse; +import com.pichillilorenzo.flutter_inappwebview_android.types.JsConfirmResponse; +import com.pichillilorenzo.flutter_inappwebview_android.types.JsPromptResponse; +import com.pichillilorenzo.flutter_inappwebview_android.types.PermissionResponse; +import com.pichillilorenzo.flutter_inappwebview_android.types.URLRequest; +import com.pichillilorenzo.flutter_inappwebview_android.webview.WebViewChannelDelegate; import java.io.ByteArrayOutputStream; import java.io.File; @@ -66,9 +62,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; -import java.util.HashSet; import java.util.Map; -import java.util.Set; import io.flutter.plugin.common.PluginRegistry; @@ -1200,9 +1194,18 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR // for versions 6.0+ (23) we use the FileProvider to avoid runtime permissions String fileProviderAuthority = activity.getApplicationContext().getPackageName() + "." + InAppWebViewFileProvider.fileProviderAuthorityExtension; - return FileProvider.getUriForFile(activity.getApplicationContext(), - fileProviderAuthority, - capturedFile); + try { + return FileProvider.getUriForFile(activity.getApplicationContext(), + fileProviderAuthority, + capturedFile); + } catch (Exception e) { + e.printStackTrace(); + String errorMessage = e.getMessage(); + if (errorMessage != null) { + Log.e(LOG_TAG, errorMessage); + } + } + return null; } @Nullable diff --git a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebViewClient.java b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/InAppWebViewClient.java similarity index 93% rename from flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebViewClient.java rename to flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/InAppWebViewClient.java index 7e52593c..ba2ba48c 100755 --- a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebViewClient.java +++ b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/InAppWebViewClient.java @@ -1,4 +1,4 @@ -package com.pichillilorenzo.flutter_inappwebview.webview.in_app_webview; +package com.pichillilorenzo.flutter_inappwebview_android.webview.in_app_webview; import android.annotation.SuppressLint; import android.annotation.TargetApi; @@ -29,26 +29,26 @@ import androidx.annotation.RequiresApi; import androidx.webkit.WebResourceRequestCompat; import androidx.webkit.WebViewFeature; -import com.pichillilorenzo.flutter_inappwebview.Util; -import com.pichillilorenzo.flutter_inappwebview.credential_database.CredentialDatabase; -import com.pichillilorenzo.flutter_inappwebview.in_app_browser.InAppBrowserDelegate; -import com.pichillilorenzo.flutter_inappwebview.plugin_scripts_js.JavaScriptBridgeJS; -import com.pichillilorenzo.flutter_inappwebview.types.ClientCertChallenge; -import com.pichillilorenzo.flutter_inappwebview.types.ClientCertResponse; -import com.pichillilorenzo.flutter_inappwebview.types.CustomSchemeResponse; -import com.pichillilorenzo.flutter_inappwebview.types.HttpAuthResponse; -import com.pichillilorenzo.flutter_inappwebview.types.HttpAuthenticationChallenge; -import com.pichillilorenzo.flutter_inappwebview.types.NavigationAction; -import com.pichillilorenzo.flutter_inappwebview.types.NavigationActionPolicy; -import com.pichillilorenzo.flutter_inappwebview.types.ServerTrustAuthResponse; -import com.pichillilorenzo.flutter_inappwebview.types.ServerTrustChallenge; -import com.pichillilorenzo.flutter_inappwebview.types.URLCredential; -import com.pichillilorenzo.flutter_inappwebview.types.URLProtectionSpace; -import com.pichillilorenzo.flutter_inappwebview.types.URLRequest; -import com.pichillilorenzo.flutter_inappwebview.types.WebResourceErrorExt; -import com.pichillilorenzo.flutter_inappwebview.types.WebResourceRequestExt; -import com.pichillilorenzo.flutter_inappwebview.types.WebResourceResponseExt; -import com.pichillilorenzo.flutter_inappwebview.webview.WebViewChannelDelegate; +import com.pichillilorenzo.flutter_inappwebview_android.Util; +import com.pichillilorenzo.flutter_inappwebview_android.credential_database.CredentialDatabase; +import com.pichillilorenzo.flutter_inappwebview_android.in_app_browser.InAppBrowserDelegate; +import com.pichillilorenzo.flutter_inappwebview_android.plugin_scripts_js.JavaScriptBridgeJS; +import com.pichillilorenzo.flutter_inappwebview_android.types.ClientCertChallenge; +import com.pichillilorenzo.flutter_inappwebview_android.types.ClientCertResponse; +import com.pichillilorenzo.flutter_inappwebview_android.types.CustomSchemeResponse; +import com.pichillilorenzo.flutter_inappwebview_android.types.HttpAuthResponse; +import com.pichillilorenzo.flutter_inappwebview_android.types.HttpAuthenticationChallenge; +import com.pichillilorenzo.flutter_inappwebview_android.types.NavigationAction; +import com.pichillilorenzo.flutter_inappwebview_android.types.NavigationActionPolicy; +import com.pichillilorenzo.flutter_inappwebview_android.types.ServerTrustAuthResponse; +import com.pichillilorenzo.flutter_inappwebview_android.types.ServerTrustChallenge; +import com.pichillilorenzo.flutter_inappwebview_android.types.URLCredential; +import com.pichillilorenzo.flutter_inappwebview_android.types.URLProtectionSpace; +import com.pichillilorenzo.flutter_inappwebview_android.types.URLRequest; +import com.pichillilorenzo.flutter_inappwebview_android.types.WebResourceErrorExt; +import com.pichillilorenzo.flutter_inappwebview_android.types.WebResourceRequestExt; +import com.pichillilorenzo.flutter_inappwebview_android.types.WebResourceResponseExt; +import com.pichillilorenzo.flutter_inappwebview_android.webview.WebViewChannelDelegate; import java.io.ByteArrayInputStream; import java.net.URI; @@ -588,7 +588,7 @@ public class InAppWebViewClient extends WebViewClient { final InAppWebView webView = (InAppWebView) view; final WebViewChannelDelegate.SafeBrowsingHitCallback resultCallback = new WebViewChannelDelegate.SafeBrowsingHitCallback() { @Override - public boolean nonNullSuccess(@NonNull com.pichillilorenzo.flutter_inappwebview.types.SafeBrowsingResponse response) { + public boolean nonNullSuccess(@NonNull com.pichillilorenzo.flutter_inappwebview_android.types.SafeBrowsingResponse response) { Integer action = response.getAction(); if (action != null) { boolean report = response.isReport(); @@ -611,7 +611,7 @@ public class InAppWebViewClient extends WebViewClient { } @Override - public void defaultBehaviour(@Nullable com.pichillilorenzo.flutter_inappwebview.types.SafeBrowsingResponse result) { + public void defaultBehaviour(@Nullable com.pichillilorenzo.flutter_inappwebview_android.types.SafeBrowsingResponse result) { InAppWebViewClient.super.onSafeBrowsingHit(view, request, threatType, callback); } diff --git a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebViewClientCompat.java b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/InAppWebViewClientCompat.java similarity index 93% rename from flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebViewClientCompat.java rename to flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/InAppWebViewClientCompat.java index 64d858b4..2c4e0201 100755 --- a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebViewClientCompat.java +++ b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/InAppWebViewClientCompat.java @@ -1,4 +1,4 @@ -package com.pichillilorenzo.flutter_inappwebview.webview.in_app_webview; +package com.pichillilorenzo.flutter_inappwebview_android.webview.in_app_webview; import android.annotation.SuppressLint; import android.annotation.TargetApi; @@ -29,26 +29,26 @@ import androidx.webkit.WebResourceRequestCompat; import androidx.webkit.WebViewClientCompat; import androidx.webkit.WebViewFeature; -import com.pichillilorenzo.flutter_inappwebview.Util; -import com.pichillilorenzo.flutter_inappwebview.credential_database.CredentialDatabase; -import com.pichillilorenzo.flutter_inappwebview.in_app_browser.InAppBrowserDelegate; -import com.pichillilorenzo.flutter_inappwebview.plugin_scripts_js.JavaScriptBridgeJS; -import com.pichillilorenzo.flutter_inappwebview.types.ClientCertChallenge; -import com.pichillilorenzo.flutter_inappwebview.types.ClientCertResponse; -import com.pichillilorenzo.flutter_inappwebview.types.CustomSchemeResponse; -import com.pichillilorenzo.flutter_inappwebview.types.HttpAuthResponse; -import com.pichillilorenzo.flutter_inappwebview.types.HttpAuthenticationChallenge; -import com.pichillilorenzo.flutter_inappwebview.types.NavigationAction; -import com.pichillilorenzo.flutter_inappwebview.types.NavigationActionPolicy; -import com.pichillilorenzo.flutter_inappwebview.types.ServerTrustAuthResponse; -import com.pichillilorenzo.flutter_inappwebview.types.ServerTrustChallenge; -import com.pichillilorenzo.flutter_inappwebview.types.URLCredential; -import com.pichillilorenzo.flutter_inappwebview.types.URLProtectionSpace; -import com.pichillilorenzo.flutter_inappwebview.types.URLRequest; -import com.pichillilorenzo.flutter_inappwebview.types.WebResourceErrorExt; -import com.pichillilorenzo.flutter_inappwebview.types.WebResourceRequestExt; -import com.pichillilorenzo.flutter_inappwebview.types.WebResourceResponseExt; -import com.pichillilorenzo.flutter_inappwebview.webview.WebViewChannelDelegate; +import com.pichillilorenzo.flutter_inappwebview_android.Util; +import com.pichillilorenzo.flutter_inappwebview_android.credential_database.CredentialDatabase; +import com.pichillilorenzo.flutter_inappwebview_android.in_app_browser.InAppBrowserDelegate; +import com.pichillilorenzo.flutter_inappwebview_android.plugin_scripts_js.JavaScriptBridgeJS; +import com.pichillilorenzo.flutter_inappwebview_android.types.ClientCertChallenge; +import com.pichillilorenzo.flutter_inappwebview_android.types.ClientCertResponse; +import com.pichillilorenzo.flutter_inappwebview_android.types.CustomSchemeResponse; +import com.pichillilorenzo.flutter_inappwebview_android.types.HttpAuthResponse; +import com.pichillilorenzo.flutter_inappwebview_android.types.HttpAuthenticationChallenge; +import com.pichillilorenzo.flutter_inappwebview_android.types.NavigationAction; +import com.pichillilorenzo.flutter_inappwebview_android.types.NavigationActionPolicy; +import com.pichillilorenzo.flutter_inappwebview_android.types.ServerTrustAuthResponse; +import com.pichillilorenzo.flutter_inappwebview_android.types.ServerTrustChallenge; +import com.pichillilorenzo.flutter_inappwebview_android.types.URLCredential; +import com.pichillilorenzo.flutter_inappwebview_android.types.URLProtectionSpace; +import com.pichillilorenzo.flutter_inappwebview_android.types.URLRequest; +import com.pichillilorenzo.flutter_inappwebview_android.types.WebResourceErrorExt; +import com.pichillilorenzo.flutter_inappwebview_android.types.WebResourceRequestExt; +import com.pichillilorenzo.flutter_inappwebview_android.types.WebResourceResponseExt; +import com.pichillilorenzo.flutter_inappwebview_android.webview.WebViewChannelDelegate; import java.io.ByteArrayInputStream; import java.net.URI; @@ -603,7 +603,7 @@ public class InAppWebViewClientCompat extends WebViewClientCompat { final InAppWebView webView = (InAppWebView) view; final WebViewChannelDelegate.SafeBrowsingHitCallback resultCallback = new WebViewChannelDelegate.SafeBrowsingHitCallback() { @Override - public boolean nonNullSuccess(@NonNull com.pichillilorenzo.flutter_inappwebview.types.SafeBrowsingResponse response) { + public boolean nonNullSuccess(@NonNull com.pichillilorenzo.flutter_inappwebview_android.types.SafeBrowsingResponse response) { Integer action = response.getAction(); if (action != null) { boolean report = response.isReport(); @@ -638,7 +638,7 @@ public class InAppWebViewClientCompat extends WebViewClientCompat { } @Override - public void defaultBehaviour(@Nullable com.pichillilorenzo.flutter_inappwebview.types.SafeBrowsingResponse result) { + public void defaultBehaviour(@Nullable com.pichillilorenzo.flutter_inappwebview_android.types.SafeBrowsingResponse result) { InAppWebViewClientCompat.super.onSafeBrowsingHit(view, request, threatType, callback); } diff --git a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebViewRenderProcessClient.java b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/InAppWebViewRenderProcessClient.java similarity index 94% rename from flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebViewRenderProcessClient.java rename to flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/InAppWebViewRenderProcessClient.java index 4db53aa1..1fe8c509 100644 --- a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebViewRenderProcessClient.java +++ b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/InAppWebViewRenderProcessClient.java @@ -1,4 +1,4 @@ -package com.pichillilorenzo.flutter_inappwebview.webview.in_app_webview; +package com.pichillilorenzo.flutter_inappwebview_android.webview.in_app_webview; import android.util.Log; import android.webkit.WebView; @@ -9,7 +9,7 @@ import androidx.webkit.WebViewFeature; import androidx.webkit.WebViewRenderProcess; import androidx.webkit.WebViewRenderProcessClient; -import com.pichillilorenzo.flutter_inappwebview.webview.WebViewChannelDelegate; +import com.pichillilorenzo.flutter_inappwebview_android.webview.WebViewChannelDelegate; public class InAppWebViewRenderProcessClient extends WebViewRenderProcessClient { diff --git a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebViewSettings.java b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/InAppWebViewSettings.java similarity index 98% rename from flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebViewSettings.java rename to flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/InAppWebViewSettings.java index ecc08969..d1d08a9e 100755 --- a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InAppWebViewSettings.java +++ b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/InAppWebViewSettings.java @@ -1,4 +1,4 @@ -package com.pichillilorenzo.flutter_inappwebview.webview.in_app_webview; +package com.pichillilorenzo.flutter_inappwebview_android.webview.in_app_webview; import static android.webkit.WebSettings.LayoutAlgorithm.NARROW_COLUMNS; import static android.webkit.WebSettings.LayoutAlgorithm.NORMAL; @@ -13,9 +13,9 @@ import androidx.annotation.Nullable; import androidx.webkit.WebSettingsCompat; import androidx.webkit.WebViewFeature; -import com.pichillilorenzo.flutter_inappwebview.ISettings; -import com.pichillilorenzo.flutter_inappwebview.types.PreferredContentModeOptionType; -import com.pichillilorenzo.flutter_inappwebview.webview.InAppWebViewInterface; +import com.pichillilorenzo.flutter_inappwebview_android.ISettings; +import com.pichillilorenzo.flutter_inappwebview_android.types.PreferredContentModeOptionType; +import com.pichillilorenzo.flutter_inappwebview_android.webview.InAppWebViewInterface; import java.util.ArrayList; import java.util.HashMap; diff --git a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InputAwareWebView.java b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/InputAwareWebView.java similarity index 99% rename from flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InputAwareWebView.java rename to flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/InputAwareWebView.java index 0613f133..e4c5e96d 100755 --- a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/InputAwareWebView.java +++ b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/InputAwareWebView.java @@ -1,4 +1,4 @@ -package com.pichillilorenzo.flutter_inappwebview.webview.in_app_webview; +package com.pichillilorenzo.flutter_inappwebview_android.webview.in_app_webview; import static android.content.Context.INPUT_METHOD_SERVICE; diff --git a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/ThreadedInputConnectionProxyAdapterView.java b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/ThreadedInputConnectionProxyAdapterView.java similarity index 97% rename from flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/ThreadedInputConnectionProxyAdapterView.java rename to flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/ThreadedInputConnectionProxyAdapterView.java index bf401488..91a45465 100755 --- a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/in_app_webview/ThreadedInputConnectionProxyAdapterView.java +++ b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/in_app_webview/ThreadedInputConnectionProxyAdapterView.java @@ -1,4 +1,4 @@ -package com.pichillilorenzo.flutter_inappwebview.webview.in_app_webview; +package com.pichillilorenzo.flutter_inappwebview_android.webview.in_app_webview; import android.os.Handler; import android.os.IBinder; diff --git a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/web_message/WebMessageChannel.java b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/web_message/WebMessageChannel.java similarity index 90% rename from flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/web_message/WebMessageChannel.java rename to flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/web_message/WebMessageChannel.java index b5e15e26..b7d059c2 100644 --- a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/web_message/WebMessageChannel.java +++ b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/web_message/WebMessageChannel.java @@ -1,4 +1,4 @@ -package com.pichillilorenzo.flutter_inappwebview.webview.web_message; +package com.pichillilorenzo.flutter_inappwebview_android.webview.web_message; import android.webkit.ValueCallback; @@ -9,13 +9,13 @@ import androidx.webkit.WebMessagePortCompat; import androidx.webkit.WebViewCompat; import androidx.webkit.WebViewFeature; -import com.pichillilorenzo.flutter_inappwebview.plugin_scripts_js.JavaScriptBridgeJS; -import com.pichillilorenzo.flutter_inappwebview.types.Disposable; -import com.pichillilorenzo.flutter_inappwebview.types.WebMessageCompatExt; -import com.pichillilorenzo.flutter_inappwebview.types.WebMessagePortCompatExt; -import com.pichillilorenzo.flutter_inappwebview.webview.InAppWebViewInterface; -import com.pichillilorenzo.flutter_inappwebview.types.WebMessagePort; -import com.pichillilorenzo.flutter_inappwebview.webview.in_app_webview.InAppWebView; +import com.pichillilorenzo.flutter_inappwebview_android.plugin_scripts_js.JavaScriptBridgeJS; +import com.pichillilorenzo.flutter_inappwebview_android.types.Disposable; +import com.pichillilorenzo.flutter_inappwebview_android.types.WebMessageCompatExt; +import com.pichillilorenzo.flutter_inappwebview_android.types.WebMessagePortCompatExt; +import com.pichillilorenzo.flutter_inappwebview_android.webview.InAppWebViewInterface; +import com.pichillilorenzo.flutter_inappwebview_android.types.WebMessagePort; +import com.pichillilorenzo.flutter_inappwebview_android.webview.in_app_webview.InAppWebView; import java.util.ArrayList; import java.util.Arrays; @@ -23,7 +23,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel; public class WebMessageChannel implements Disposable { diff --git a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/web_message/WebMessageChannelChannelDelegate.java b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/web_message/WebMessageChannelChannelDelegate.java similarity index 86% rename from flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/web_message/WebMessageChannelChannelDelegate.java rename to flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/web_message/WebMessageChannelChannelDelegate.java index cbc538d5..f801a82d 100644 --- a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/web_message/WebMessageChannelChannelDelegate.java +++ b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/web_message/WebMessageChannelChannelDelegate.java @@ -1,12 +1,11 @@ -package com.pichillilorenzo.flutter_inappwebview.webview.web_message; +package com.pichillilorenzo.flutter_inappwebview_android.webview.web_message; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.pichillilorenzo.flutter_inappwebview.types.ChannelDelegateImpl; -import com.pichillilorenzo.flutter_inappwebview.types.Disposable; -import com.pichillilorenzo.flutter_inappwebview.types.WebMessageCompatExt; -import com.pichillilorenzo.flutter_inappwebview.webview.in_app_webview.InAppWebView; +import com.pichillilorenzo.flutter_inappwebview_android.types.ChannelDelegateImpl; +import com.pichillilorenzo.flutter_inappwebview_android.types.WebMessageCompatExt; +import com.pichillilorenzo.flutter_inappwebview_android.webview.in_app_webview.InAppWebView; import java.util.HashMap; import java.util.Map; diff --git a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/web_message/WebMessageListener.java b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/web_message/WebMessageListener.java similarity index 92% rename from flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/web_message/WebMessageListener.java rename to flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/web_message/WebMessageListener.java index 5cb35a80..fe7326f7 100644 --- a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/web_message/WebMessageListener.java +++ b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/web_message/WebMessageListener.java @@ -1,4 +1,4 @@ -package com.pichillilorenzo.flutter_inappwebview.webview.web_message; +package com.pichillilorenzo.flutter_inappwebview_android.webview.web_message; import android.net.Uri; import android.text.TextUtils; @@ -11,14 +11,14 @@ import androidx.webkit.WebMessageCompat; import androidx.webkit.WebViewCompat; import androidx.webkit.WebViewFeature; -import com.pichillilorenzo.flutter_inappwebview.Util; -import com.pichillilorenzo.flutter_inappwebview.plugin_scripts_js.JavaScriptBridgeJS; -import com.pichillilorenzo.flutter_inappwebview.types.Disposable; -import com.pichillilorenzo.flutter_inappwebview.types.WebMessageCompatExt; -import com.pichillilorenzo.flutter_inappwebview.webview.InAppWebViewInterface; -import com.pichillilorenzo.flutter_inappwebview.types.PluginScript; -import com.pichillilorenzo.flutter_inappwebview.types.UserScriptInjectionTime; -import com.pichillilorenzo.flutter_inappwebview.webview.in_app_webview.InAppWebView; +import com.pichillilorenzo.flutter_inappwebview_android.Util; +import com.pichillilorenzo.flutter_inappwebview_android.plugin_scripts_js.JavaScriptBridgeJS; +import com.pichillilorenzo.flutter_inappwebview_android.types.Disposable; +import com.pichillilorenzo.flutter_inappwebview_android.types.WebMessageCompatExt; +import com.pichillilorenzo.flutter_inappwebview_android.webview.InAppWebViewInterface; +import com.pichillilorenzo.flutter_inappwebview_android.types.PluginScript; +import com.pichillilorenzo.flutter_inappwebview_android.types.UserScriptInjectionTime; +import com.pichillilorenzo.flutter_inappwebview_android.webview.in_app_webview.InAppWebView; import java.util.ArrayList; import java.util.HashSet; @@ -27,7 +27,6 @@ import java.util.Map; import java.util.Set; import io.flutter.plugin.common.BinaryMessenger; -import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel; public class WebMessageListener implements Disposable { diff --git a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/web_message/WebMessageListenerChannelDelegate.java b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/web_message/WebMessageListenerChannelDelegate.java similarity index 76% rename from flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/web_message/WebMessageListenerChannelDelegate.java rename to flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/web_message/WebMessageListenerChannelDelegate.java index c0f8ada8..92c7aaae 100644 --- a/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/webview/web_message/WebMessageListenerChannelDelegate.java +++ b/flutter_inappwebview_android/android/src/main/java/com/pichillilorenzo/flutter_inappwebview_android/webview/web_message/WebMessageListenerChannelDelegate.java @@ -1,14 +1,11 @@ -package com.pichillilorenzo.flutter_inappwebview.webview.web_message; +package com.pichillilorenzo.flutter_inappwebview_android.webview.web_message; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.webkit.WebMessageCompat; -import com.pichillilorenzo.flutter_inappwebview.headless_in_app_webview.HeadlessInAppWebView; -import com.pichillilorenzo.flutter_inappwebview.types.ChannelDelegateImpl; -import com.pichillilorenzo.flutter_inappwebview.types.Disposable; -import com.pichillilorenzo.flutter_inappwebview.types.WebMessageCompatExt; -import com.pichillilorenzo.flutter_inappwebview.webview.in_app_webview.InAppWebView; +import com.pichillilorenzo.flutter_inappwebview_android.types.ChannelDelegateImpl; +import com.pichillilorenzo.flutter_inappwebview_android.types.WebMessageCompatExt; +import com.pichillilorenzo.flutter_inappwebview_android.webview.in_app_webview.InAppWebView; import java.util.HashMap; import java.util.Map; diff --git a/flutter_inappwebview_android/android/src/main/res/layout/activity_web_view.xml b/flutter_inappwebview_android/android/src/main/res/layout/activity_web_view.xml index 7dcc1374..d7d7e21a 100755 --- a/flutter_inappwebview_android/android/src/main/res/layout/activity_web_view.xml +++ b/flutter_inappwebview_android/android/src/main/res/layout/activity_web_view.xml @@ -7,18 +7,18 @@ android:layout_height="match_parent" android:clickable="true" android:focusableInTouchMode="true" - tools:context=".in_app_browser.InAppBrowserActivity" + tools:context="com.pichillilorenzo.flutter_inappwebview_android.in_app_browser.InAppBrowserActivity" android:focusable="true"> - - - + + tools:context="com.pichillilorenzo.flutter_inappwebview_android.in_app_browser.InAppBrowserActivity">