From 373db277885606f493acae5faa86011c59442f9c Mon Sep 17 00:00:00 2001 From: fhuya Date: Wed, 15 Apr 2020 22:32:46 -0700 Subject: [PATCH] Migrate legacy apache dependency to the GodotPayment plugin This is the only location in the codebase where it's being used, so no need to make the main lib have a dependency on it. (cherry picked from commit c591cb8fda5409d1bdc86bcda037578046117eb1) --- platform/android/java/lib/build.gradle | 1 - platform/android/java/plugins/godotpayment/build.gradle | 1 + .../org/godotengine/godot/plugin/payment/ValidateTask.java | 4 ++-- .../godot/plugin/payment}/utils/CustomSSLSocketFactory.java | 3 ++- .../godot/plugin/payment}/utils/HttpRequester.java | 3 ++- .../godot/plugin/payment}/utils/RequestParams.java | 3 +-- 6 files changed, 8 insertions(+), 7 deletions(-) rename platform/android/java/{lib/src/org/godotengine/godot => plugins/godotpayment/src/main/java/org/godotengine/godot/plugin/payment}/utils/CustomSSLSocketFactory.java (98%) rename platform/android/java/{lib/src/org/godotengine/godot => plugins/godotpayment/src/main/java/org/godotengine/godot/plugin/payment}/utils/HttpRequester.java (98%) rename platform/android/java/{lib/src/org/godotengine/godot => plugins/godotpayment/src/main/java/org/godotengine/godot/plugin/payment}/utils/RequestParams.java (98%) diff --git a/platform/android/java/lib/build.gradle b/platform/android/java/lib/build.gradle index c69e19fbfa1..6bb438c249a 100644 --- a/platform/android/java/lib/build.gradle +++ b/platform/android/java/lib/build.gradle @@ -12,7 +12,6 @@ def pathToRootDir = "../../../../" android { compileSdkVersion versions.compileSdk buildToolsVersion versions.buildTools - useLibrary 'org.apache.http.legacy' defaultConfig { minSdkVersion versions.minSdk diff --git a/platform/android/java/plugins/godotpayment/build.gradle b/platform/android/java/plugins/godotpayment/build.gradle index 4f376c4587a..ffab86e26e8 100644 --- a/platform/android/java/plugins/godotpayment/build.gradle +++ b/platform/android/java/plugins/godotpayment/build.gradle @@ -3,6 +3,7 @@ apply plugin: 'com.android.library' android { compileSdkVersion versions.compileSdk buildToolsVersion versions.buildTools + useLibrary 'org.apache.http.legacy' defaultConfig { minSdkVersion versions.minSdk diff --git a/platform/android/java/plugins/godotpayment/src/main/java/org/godotengine/godot/plugin/payment/ValidateTask.java b/platform/android/java/plugins/godotpayment/src/main/java/org/godotengine/godot/plugin/payment/ValidateTask.java index 179cc08ed13..d42ded0c9b0 100644 --- a/platform/android/java/plugins/godotpayment/src/main/java/org/godotengine/godot/plugin/payment/ValidateTask.java +++ b/platform/android/java/plugins/godotpayment/src/main/java/org/godotengine/godot/plugin/payment/ValidateTask.java @@ -34,8 +34,8 @@ import android.app.Activity; import android.app.ProgressDialog; import android.os.AsyncTask; import java.lang.ref.WeakReference; -import org.godotengine.godot.utils.HttpRequester; -import org.godotengine.godot.utils.RequestParams; +import org.godotengine.godot.plugin.payment.utils.HttpRequester; +import org.godotengine.godot.plugin.payment.utils.RequestParams; import org.json.JSONException; import org.json.JSONObject; diff --git a/platform/android/java/lib/src/org/godotengine/godot/utils/CustomSSLSocketFactory.java b/platform/android/java/plugins/godotpayment/src/main/java/org/godotengine/godot/plugin/payment/utils/CustomSSLSocketFactory.java similarity index 98% rename from platform/android/java/lib/src/org/godotengine/godot/utils/CustomSSLSocketFactory.java rename to platform/android/java/plugins/godotpayment/src/main/java/org/godotengine/godot/plugin/payment/utils/CustomSSLSocketFactory.java index c78e8c1c660..9571769cd35 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/utils/CustomSSLSocketFactory.java +++ b/platform/android/java/plugins/godotpayment/src/main/java/org/godotengine/godot/plugin/payment/utils/CustomSSLSocketFactory.java @@ -28,7 +28,8 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot.utils; +package org.godotengine.godot.plugin.payment.utils; + import java.io.IOException; import java.net.Socket; import java.net.UnknownHostException; diff --git a/platform/android/java/lib/src/org/godotengine/godot/utils/HttpRequester.java b/platform/android/java/plugins/godotpayment/src/main/java/org/godotengine/godot/plugin/payment/utils/HttpRequester.java similarity index 98% rename from platform/android/java/lib/src/org/godotengine/godot/utils/HttpRequester.java rename to platform/android/java/plugins/godotpayment/src/main/java/org/godotengine/godot/plugin/payment/utils/HttpRequester.java index 68f9a835971..dcb983201ee 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/utils/HttpRequester.java +++ b/platform/android/java/plugins/godotpayment/src/main/java/org/godotengine/godot/plugin/payment/utils/HttpRequester.java @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot.utils; +package org.godotengine.godot.plugin.payment.utils; import android.content.Context; import android.content.SharedPreferences; @@ -61,6 +61,7 @@ import org.apache.http.params.HttpParams; import org.apache.http.params.HttpProtocolParams; import org.apache.http.protocol.HTTP; import org.apache.http.util.EntityUtils; +import org.godotengine.godot.utils.Crypt; /** * diff --git a/platform/android/java/lib/src/org/godotengine/godot/utils/RequestParams.java b/platform/android/java/plugins/godotpayment/src/main/java/org/godotengine/godot/plugin/payment/utils/RequestParams.java similarity index 98% rename from platform/android/java/lib/src/org/godotengine/godot/utils/RequestParams.java rename to platform/android/java/plugins/godotpayment/src/main/java/org/godotengine/godot/plugin/payment/utils/RequestParams.java index 25fa10647d7..4be8b37473e 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/utils/RequestParams.java +++ b/platform/android/java/plugins/godotpayment/src/main/java/org/godotengine/godot/plugin/payment/utils/RequestParams.java @@ -28,10 +28,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -package org.godotengine.godot.utils; +package org.godotengine.godot.plugin.payment.utils; import java.util.ArrayList; -import java.util.Date; import java.util.HashMap; import java.util.List; import org.apache.http.NameValuePair;