From 643e38c181f6f96f429477c0208195cce219a94e Mon Sep 17 00:00:00 2001 From: Mohamed Date: Wed, 12 May 2021 18:57:10 +0200 Subject: [PATCH] Fixed post params --- .idea/workspace.xml | 69 ++++++- CHANGELOG.md | 5 + Demo/.gitignore | 15 -- Demo/.idea/.gitignore | 3 - Demo/.idea/compiler.xml | 6 - Demo/.idea/gradle.xml | 22 --- Demo/.idea/jarRepositories.xml | 30 --- Demo/.idea/misc.xml | 9 - Demo/.idea/vcs.xml | 6 - Demo/app/.gitignore | 1 - Demo/app/build.gradle | 50 ----- Demo/app/proguard-rules.pro | 21 -- .../datadome/demo/ExampleInstrumentedTest.kt | 24 --- Demo/app/src/main/AndroidManifest.xml | 22 --- .../java/co/datadome/demo/MainActivity.kt | 138 ------------- .../drawable-v24/ic_launcher_foreground.xml | 30 --- .../res/drawable/ic_launcher_background.xml | 170 ---------------- .../app/src/main/res/layout/activity_main.xml | 16 -- .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 - .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 - .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 3593 -> 0 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 5339 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 2636 -> 0 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 3388 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 4926 -> 0 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 7472 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 7909 -> 0 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 11873 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 10652 -> 0 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 16570 -> 0 bytes Demo/app/src/main/res/values-night/themes.xml | 16 -- Demo/app/src/main/res/values/colors.xml | 10 - Demo/app/src/main/res/values/strings.xml | 3 - Demo/app/src/main/res/values/themes.xml | 16 -- .../java/co/datadome/demo/ExampleUnitTest.kt | 17 -- Demo/build.gradle | 27 --- Demo/gradle.properties | 21 -- Demo/gradle/wrapper/gradle-wrapper.jar | Bin 54329 -> 0 bytes Demo/gradle/wrapper/gradle-wrapper.properties | 6 - Demo/gradlew | 172 ----------------- Demo/gradlew.bat | 84 -------- Demo/settings.gradle | 2 - example/ios/Podfile.lock | 2 +- .../contents.xcworkspacedata | 2 +- example/lib/main.dart | 2 +- example/pubspec.lock | 40 ++-- ios/Classes/SwiftDatadomePlugin.swift | 182 ++++++++++-------- pubspec.yaml | 2 +- 48 files changed, 186 insertions(+), 1065 deletions(-) delete mode 100644 Demo/.gitignore delete mode 100644 Demo/.idea/.gitignore delete mode 100644 Demo/.idea/compiler.xml delete mode 100644 Demo/.idea/gradle.xml delete mode 100644 Demo/.idea/jarRepositories.xml delete mode 100644 Demo/.idea/misc.xml delete mode 100644 Demo/.idea/vcs.xml delete mode 100644 Demo/app/.gitignore delete mode 100644 Demo/app/build.gradle delete mode 100644 Demo/app/proguard-rules.pro delete mode 100644 Demo/app/src/androidTest/java/co/datadome/demo/ExampleInstrumentedTest.kt delete mode 100644 Demo/app/src/main/AndroidManifest.xml delete mode 100644 Demo/app/src/main/java/co/datadome/demo/MainActivity.kt delete mode 100644 Demo/app/src/main/res/drawable-v24/ic_launcher_foreground.xml delete mode 100644 Demo/app/src/main/res/drawable/ic_launcher_background.xml delete mode 100644 Demo/app/src/main/res/layout/activity_main.xml delete mode 100644 Demo/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml delete mode 100644 Demo/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml delete mode 100644 Demo/app/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 Demo/app/src/main/res/mipmap-hdpi/ic_launcher_round.png delete mode 100644 Demo/app/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 Demo/app/src/main/res/mipmap-mdpi/ic_launcher_round.png delete mode 100644 Demo/app/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 Demo/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png delete mode 100644 Demo/app/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 Demo/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png delete mode 100644 Demo/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 Demo/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png delete mode 100644 Demo/app/src/main/res/values-night/themes.xml delete mode 100644 Demo/app/src/main/res/values/colors.xml delete mode 100644 Demo/app/src/main/res/values/strings.xml delete mode 100644 Demo/app/src/main/res/values/themes.xml delete mode 100644 Demo/app/src/test/java/co/datadome/demo/ExampleUnitTest.kt delete mode 100644 Demo/build.gradle delete mode 100644 Demo/gradle.properties delete mode 100644 Demo/gradle/wrapper/gradle-wrapper.jar delete mode 100644 Demo/gradle/wrapper/gradle-wrapper.properties delete mode 100755 Demo/gradlew delete mode 100644 Demo/gradlew.bat delete mode 100644 Demo/settings.gradle diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 251344e..bf61bd9 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,14 +6,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -50,27 +97,31 @@ - - + + + - - + + + - - + + + - - + + + diff --git a/CHANGELOG.md b/CHANGELOG.md index 76a97e5..391b651 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,12 @@ +## 1.0.3 + +* Fixed an issue when sending map/array in the request body. + ## 1.0.2 * Fixed dependencies for android with OkHTTP. + ## 1.0.1 * Migrated the repository of the android sdk from Bintray to jitpack.io. diff --git a/Demo/.gitignore b/Demo/.gitignore deleted file mode 100644 index aa724b7..0000000 --- a/Demo/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -*.iml -.gradle -/local.properties -/.idea/caches -/.idea/libraries -/.idea/modules.xml -/.idea/workspace.xml -/.idea/navEditor.xml -/.idea/assetWizardSettings.xml -.DS_Store -/build -/captures -.externalNativeBuild -.cxx -local.properties diff --git a/Demo/.idea/.gitignore b/Demo/.idea/.gitignore deleted file mode 100644 index 26d3352..0000000 --- a/Demo/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/Demo/.idea/compiler.xml b/Demo/.idea/compiler.xml deleted file mode 100644 index 61a9130..0000000 --- a/Demo/.idea/compiler.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Demo/.idea/gradle.xml b/Demo/.idea/gradle.xml deleted file mode 100644 index 23a89bb..0000000 --- a/Demo/.idea/gradle.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/Demo/.idea/jarRepositories.xml b/Demo/.idea/jarRepositories.xml deleted file mode 100644 index 92f0c06..0000000 --- a/Demo/.idea/jarRepositories.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Demo/.idea/misc.xml b/Demo/.idea/misc.xml deleted file mode 100644 index d5d35ec..0000000 --- a/Demo/.idea/misc.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/Demo/.idea/vcs.xml b/Demo/.idea/vcs.xml deleted file mode 100644 index 6c0b863..0000000 --- a/Demo/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Demo/app/.gitignore b/Demo/app/.gitignore deleted file mode 100644 index 42afabf..0000000 --- a/Demo/app/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/Demo/app/build.gradle b/Demo/app/build.gradle deleted file mode 100644 index 1edef15..0000000 --- a/Demo/app/build.gradle +++ /dev/null @@ -1,50 +0,0 @@ -plugins { - id 'com.android.application' - id 'kotlin-android' -} - -android { - compileSdkVersion 30 - buildToolsVersion "30.0.2" - - defaultConfig { - applicationId "co.datadome.demo" - minSdkVersion 19 - targetSdkVersion 30 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - kotlinOptions { - jvmTarget = '1.8' - } -} - -dependencies { - def okhttp3_version = "3.14.0" - - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation 'androidx.core:core-ktx:1.3.2' - implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'com.google.android.material:material:1.1.0' - implementation 'androidx.constraintlayout:constraintlayout:2.0.4' - testImplementation 'junit:junit:4.+' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' - implementation 'co.datadome.sdk:sdk:+' - implementation "com.squareup.okhttp3:okhttp:$okhttp3_version" - implementation "com.squareup.okhttp3:logging-interceptor:$okhttp3_version" - -} \ No newline at end of file diff --git a/Demo/app/proguard-rules.pro b/Demo/app/proguard-rules.pro deleted file mode 100644 index 481bb43..0000000 --- a/Demo/app/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/Demo/app/src/androidTest/java/co/datadome/demo/ExampleInstrumentedTest.kt b/Demo/app/src/androidTest/java/co/datadome/demo/ExampleInstrumentedTest.kt deleted file mode 100644 index 28b1f6e..0000000 --- a/Demo/app/src/androidTest/java/co/datadome/demo/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,24 +0,0 @@ -package co.datadome.demo - -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.ext.junit.runners.AndroidJUnit4 - -import org.junit.Test -import org.junit.runner.RunWith - -import org.junit.Assert.* - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("co.datadome.demo", appContext.packageName) - } -} \ No newline at end of file diff --git a/Demo/app/src/main/AndroidManifest.xml b/Demo/app/src/main/AndroidManifest.xml deleted file mode 100644 index 51b7340..0000000 --- a/Demo/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Demo/app/src/main/java/co/datadome/demo/MainActivity.kt b/Demo/app/src/main/java/co/datadome/demo/MainActivity.kt deleted file mode 100644 index ebcf499..0000000 --- a/Demo/app/src/main/java/co/datadome/demo/MainActivity.kt +++ /dev/null @@ -1,138 +0,0 @@ -package co.datadome.demo - -import android.Manifest -import android.os.AsyncTask -import androidx.appcompat.app.AppCompatActivity -import android.os.Bundle -import android.util.Log -import android.widget.Button -import android.widget.Toast -import androidx.core.app.ActivityCompat -import co.datadome.sdk.DataDomeInterceptor -import co.datadome.sdk.DataDomeSDK -import co.datadome.sdk.DataDomeSDKListener -import okhttp3.* -import java.io.IOException -import java.lang.ref.Reference -import java.lang.ref.WeakReference -import okhttp3.logging.HttpLoggingInterceptor - -class MainActivity : AppCompatActivity() { - private var dataDomeSdk: DataDomeSDK.Builder? = null - - internal class OkHttpRequestTask(dataDomeInterceptor: DataDomeInterceptor, - customId: String = "") : AsyncTask() { - private var dataDomeInterceptorRef: WeakReference - = WeakReference(dataDomeInterceptor) - - private var customTextRef: Reference = WeakReference(customId) - - override fun doInBackground(vararg args: String): Void? { - val dataDomeInterceptor = dataDomeInterceptorRef.get() - val customText = customTextRef.get() - - if (dataDomeInterceptor != null) { - val builder = OkHttpClient.Builder() - - builder.addInterceptor(dataDomeInterceptor) - - val loggingInterceptor = HttpLoggingInterceptor() - loggingInterceptor.level = HttpLoggingInterceptor.Level.BASIC - loggingInterceptor.redactHeader("Authorization") - builder.addInterceptor(loggingInterceptor) - val client = builder.build() - - val request = Request.Builder() - .header("User-Agent", args[1]) - .url(args[0]) - .build() - - try { - val callback: Callback = object: Callback { - override fun onFailure(call: Call, e: IOException) { - Log.d("DEBUG","ERROR") - } - - override fun onResponse(call: Call, response: Response) { - Log.d("DEBUG","Task $customText -> ${response.code()}") - } - } - - client.newCall(request).enqueue(callback) - } catch (e: IOException) { - Log.d("DEBUG", "ERROR") - } - - } - return null - } - } - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_main) - - dataDomeSdk = DataDomeSDK - .with(application, "test", BuildConfig.VERSION_NAME) - .listener(dataDomeSDKListener) - .agent("BLOCKUA") - - ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.CAMERA), 101) - - findViewById