diff --git a/LINE_SDK_Unity/Assets/Plugins/Android/line-sdk-unity-wrapper-release.aar b/LINE_SDK_Unity/Assets/Plugins/Android/line-sdk-unity-wrapper-release.aar index 750bbff..cb621ac 100644 Binary files a/LINE_SDK_Unity/Assets/Plugins/Android/line-sdk-unity-wrapper-release.aar and b/LINE_SDK_Unity/Assets/Plugins/Android/line-sdk-unity-wrapper-release.aar differ diff --git a/LINE_SDK_Unity/Assets/Plugins/Android/mainTemplate.gradle b/LINE_SDK_Unity/Assets/Plugins/Android/mainTemplate.gradle index d9db3eb..6cda436 100644 --- a/LINE_SDK_Unity/Assets/Plugins/Android/mainTemplate.gradle +++ b/LINE_SDK_Unity/Assets/Plugins/Android/mainTemplate.gradle @@ -28,7 +28,7 @@ allprojects { } } -apply plugin: 'com.android.application' +apply plugin: 'com.android.library' dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) @@ -51,9 +51,10 @@ android { } defaultConfig { +consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD** minSdkVersion **MINSDKVERSION** targetSdkVersion **TARGETSDKVERSION** - applicationId '**APPLICATIONID**' + ndk { abiFilters **ABIFILTERS** } @@ -83,17 +84,7 @@ android { } } **PACKAGING_OPTIONS** - bundle { - language { - enableSplit = false - } - density { - enableSplit = false - } - abi { - enableSplit = true - } - } + } **SOURCE_BUILD_SETUP** diff --git a/LINE_SDK_Unity/Packages/manifest.json b/LINE_SDK_Unity/Packages/manifest.json index 00b19ca..77bb9cb 100644 --- a/LINE_SDK_Unity/Packages/manifest.json +++ b/LINE_SDK_Unity/Packages/manifest.json @@ -2,10 +2,11 @@ "dependencies": { "com.unity.2d.sprite": "1.0.0", "com.unity.2d.tilemap": "1.0.0", - "com.unity.ide.rider": "1.1.4", + "com.unity.ide.rider": "1.2.1", + "com.unity.ide.visualstudio": "2.0.8", "com.unity.ide.vscode": "1.2.3", - "com.unity.test-framework": "1.1.20", - "com.unity.textmeshpro": "2.0.1", + "com.unity.test-framework": "1.1.24", + "com.unity.textmeshpro": "2.1.4", "com.unity.ugui": "1.0.0", "com.unity.xr.legacyinputhelpers": "2.1.7", "com.unity.modules.ai": "1.0.0", diff --git a/LINE_SDK_Unity/Packages/packages-lock.json b/LINE_SDK_Unity/Packages/packages-lock.json index 695b658..3f6927b 100644 --- a/LINE_SDK_Unity/Packages/packages-lock.json +++ b/LINE_SDK_Unity/Packages/packages-lock.json @@ -20,7 +20,7 @@ "url": "https://packages.unity.com" }, "com.unity.ide.rider": { - "version": "1.1.4", + "version": "1.2.1", "depth": 0, "source": "registry", "dependencies": { @@ -28,6 +28,15 @@ }, "url": "https://packages.unity.com" }, + "com.unity.ide.visualstudio": { + "version": "2.0.8", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.test-framework": "1.1.9" + }, + "url": "https://packages.unity.com" + }, "com.unity.ide.vscode": { "version": "1.2.3", "depth": 0, @@ -36,7 +45,7 @@ "url": "https://packages.unity.com" }, "com.unity.test-framework": { - "version": "1.1.20", + "version": "1.1.24", "depth": 0, "source": "registry", "dependencies": { @@ -47,7 +56,7 @@ "url": "https://packages.unity.com" }, "com.unity.textmeshpro": { - "version": "2.0.1", + "version": "2.1.4", "depth": 0, "source": "registry", "dependencies": { diff --git a/LINE_SDK_Unity/ProjectSettings/GraphicsSettings.asset b/LINE_SDK_Unity/ProjectSettings/GraphicsSettings.asset index 79eba95..abfa703 100644 --- a/LINE_SDK_Unity/ProjectSettings/GraphicsSettings.asset +++ b/LINE_SDK_Unity/ProjectSettings/GraphicsSettings.asset @@ -38,6 +38,7 @@ GraphicsSettings: - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 16003, guid: 0000000000000000f000000000000000, type: 0} m_PreloadedShaders: [] m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} diff --git a/LINE_SDK_Unity/ProjectSettings/ProjectVersion.txt b/LINE_SDK_Unity/ProjectSettings/ProjectVersion.txt index acbe3fd..3886c07 100644 --- a/LINE_SDK_Unity/ProjectSettings/ProjectVersion.txt +++ b/LINE_SDK_Unity/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 2019.4.19f1 -m_EditorVersionWithRevision: 2019.4.19f1 (ca5b14067cec) +m_EditorVersion: 2019.4.28f1 +m_EditorVersionWithRevision: 2019.4.28f1 (1381962e9d08) diff --git a/linesdk-android-unity-wrapper/build.gradle b/linesdk-android-unity-wrapper/build.gradle index 07282e6..4a04479 100644 --- a/linesdk-android-unity-wrapper/build.gradle +++ b/linesdk-android-unity-wrapper/build.gradle @@ -23,12 +23,12 @@ allprojects { android { - compileSdkVersion 27 - buildToolsVersion '27.0.3' + compileSdkVersion 30 + buildToolsVersion '30.0.3' defaultConfig { minSdkVersion 17 - targetSdkVersion 27 + targetSdkVersion 30 versionCode 1 versionName "1.0" diff --git a/linesdk-android-unity-wrapper/gradle/wrapper/gradle-wrapper.jar b/linesdk-android-unity-wrapper/gradle/wrapper/gradle-wrapper.jar index 13372ae..758de96 100644 Binary files a/linesdk-android-unity-wrapper/gradle/wrapper/gradle-wrapper.jar and b/linesdk-android-unity-wrapper/gradle/wrapper/gradle-wrapper.jar differ diff --git a/linesdk-android-unity-wrapper/gradle/wrapper/gradle-wrapper.properties b/linesdk-android-unity-wrapper/gradle/wrapper/gradle-wrapper.properties index 2ce490d..2d80b69 100644 --- a/linesdk-android-unity-wrapper/gradle/wrapper/gradle-wrapper.properties +++ b/linesdk-android-unity-wrapper/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Tue May 29 11:51:59 CST 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip diff --git a/linesdk-android-unity-wrapper/gradlew b/linesdk-android-unity-wrapper/gradlew index 9d82f78..cccdd3d 100755 --- a/linesdk-android-unity-wrapper/gradlew +++ b/linesdk-android-unity-wrapper/gradlew @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh ############################################################################## ## @@ -6,20 +6,38 @@ ## ############################################################################## -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" -warn ( ) { +warn () { echo "$*" } -die ( ) { +die () { echo echo "$*" echo @@ -30,6 +48,7 @@ die ( ) { cygwin=false msys=false darwin=false +nonstop=false case "`uname`" in CYGWIN* ) cygwin=true @@ -40,26 +59,11 @@ case "`uname`" in MINGW* ) msys=true ;; + NONSTOP* ) + nonstop=true + ;; esac -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -85,7 +89,7 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then @@ -150,11 +154,19 @@ if $cygwin ; then esac fi -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " } -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" +exec "$JAVACMD" "$@" diff --git a/linesdk-android-unity-wrapper/gradlew.bat b/linesdk-android-unity-wrapper/gradlew.bat index aec9973..e95643d 100644 --- a/linesdk-android-unity-wrapper/gradlew.bat +++ b/linesdk-android-unity-wrapper/gradlew.bat @@ -8,14 +8,14 @@ @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome @@ -46,10 +46,9 @@ echo location of your Java installation. goto fail :init -@rem Get command-line arguments, handling Windowz variants +@rem Get command-line arguments, handling Windows variants if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args :win9xME_args @rem Slurp the command line arguments. @@ -60,11 +59,6 @@ set _SKIP=2 if "x%~1" == "x" goto execute set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ :execute @rem Setup the command line diff --git a/linesdk-android-unity-wrapper/src/main/java/com/linecorp/linesdk/unitywrapper/CallbackPayload.kt b/linesdk-android-unity-wrapper/src/main/java/com/linecorp/linesdk/unitywrapper/CallbackPayload.kt index a6486fb..32418d0 100644 --- a/linesdk-android-unity-wrapper/src/main/java/com/linecorp/linesdk/unitywrapper/CallbackPayload.kt +++ b/linesdk-android-unity-wrapper/src/main/java/com/linecorp/linesdk/unitywrapper/CallbackPayload.kt @@ -54,7 +54,7 @@ data class CallbackPayload( private fun getErrorJsonString(lineApiResponse: LineApiResponse): String { val error = ErrorForUnity( lineApiResponse.responseCode.ordinal, - lineApiResponse.errorData?.message ?: "error" + lineApiResponse.errorData.message ?: "error" ) return gson.toJson(error) } diff --git a/linesdk-android-unity-wrapper/src/main/java/com/linecorp/linesdk/unitywrapper/activity/LineSdkWrapperActivity.kt b/linesdk-android-unity-wrapper/src/main/java/com/linecorp/linesdk/unitywrapper/activity/LineSdkWrapperActivity.kt index c6e0679..b79de83 100644 --- a/linesdk-android-unity-wrapper/src/main/java/com/linecorp/linesdk/unitywrapper/activity/LineSdkWrapperActivity.kt +++ b/linesdk-android-unity-wrapper/src/main/java/com/linecorp/linesdk/unitywrapper/activity/LineSdkWrapperActivity.kt @@ -15,29 +15,13 @@ import com.linecorp.linesdk.unitywrapper.model.LoginResultForUnity import com.linecorp.linesdk.unitywrapper.util.Log class LineSdkWrapperActivity : Activity() { - private var onlyWebLogin: Boolean = false - private lateinit var channelId: String private lateinit var identifier: String - private lateinit var scope: List override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - //setContentView(R.layout.activity_line_sdk_wrapper) - parseIntent() - startLineSdkLoginActivity() - } - - private fun parseIntent() { identifier = intent.getStringExtra(KEY_IDENTIFIER) ?: "" - channelId = intent.getStringExtra(KEY_CHANNEL_ID) ?: "" - onlyWebLogin = intent.getBooleanExtra(KEY_ONLY_WEB_LOGIN, false) - - val scopeString = intent.getStringExtra(KEY_SCOPE) ?: "" - Log.d(TAG, scopeString) - - scope = Scope.parseToList(scopeString) - Log.d(TAG, scope.toString()) + startLineSdkLoginActivity() } override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { @@ -71,7 +55,24 @@ class LineSdkWrapperActivity : Activity() { } private fun startLineSdkLoginActivity() { - val lineAuthenticationParams = LineAuthenticationParams.Builder().scopes(scope).build() + val channelId = intent.getStringExtra(KEY_CHANNEL_ID) ?: "" + val onlyWebLogin = intent.getBooleanExtra(KEY_ONLY_WEB_LOGIN, false) + val botPrompt = parseBotPrompt(intent.getStringExtra(KEY_BOT_PROMPT)) + + val scopeString = intent.getStringExtra(KEY_SCOPE) ?: "" + Log.d(TAG, scopeString) + + val scope = Scope.parseToList(scopeString) + Log.d(TAG, scope.toString()) + + val builder = LineAuthenticationParams.Builder() + builder.scopes(scope) + if (botPrompt != null) { + builder.botPrompt(botPrompt) + } + + val lineAuthenticationParams = builder.build() + val loginIntent = if (onlyWebLogin) { LineLoginApi.getLoginIntentWithoutLineAppAuth(this, channelId, lineAuthenticationParams) } else { @@ -81,6 +82,14 @@ class LineSdkWrapperActivity : Activity() { startActivityForResult(loginIntent, REQUEST_CODE_LOGIN) } + private fun parseBotPrompt(name: String?): LineAuthenticationParams.BotPrompt? { + val nonNullName = name ?: return null + + return LineAuthenticationParams.BotPrompt.values().firstOrNull { + it.name.equals(nonNullName, ignoreCase = true) + } + } + companion object { private const val KEY_IDENTIFIER = "identifier" private const val KEY_CHANNEL_ID = "channelId" @@ -113,4 +122,4 @@ class LineSdkWrapperActivity : Activity() { ) } } -} +} \ No newline at end of file diff --git a/linesdk-android-unity-wrapper/src/main/java/com/linecorp/linesdk/unitywrapper/model/LoginResultForUnity.kt b/linesdk-android-unity-wrapper/src/main/java/com/linecorp/linesdk/unitywrapper/model/LoginResultForUnity.kt index d655394..7ec835f 100644 --- a/linesdk-android-unity-wrapper/src/main/java/com/linecorp/linesdk/unitywrapper/model/LoginResultForUnity.kt +++ b/linesdk-android-unity-wrapper/src/main/java/com/linecorp/linesdk/unitywrapper/model/LoginResultForUnity.kt @@ -24,7 +24,7 @@ data class LoginResultForUnity( accessToken, scope, lineProfile, - lineLoginResult.friendshipStatusChanged ?: false, + lineLoginResult.friendshipStatusChanged, lineLoginResult.nonce ) }