Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
17 changes: 4 additions & 13 deletions LINE_SDK_Unity/Assets/Plugins/Android/mainTemplate.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ allprojects {
}
}

apply plugin: 'com.android.application'
apply plugin: 'com.android.library'

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
Expand All @@ -51,9 +51,10 @@ android {
}

defaultConfig {
consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD**
minSdkVersion **MINSDKVERSION**
targetSdkVersion **TARGETSDKVERSION**
applicationId '**APPLICATIONID**'

ndk {
abiFilters **ABIFILTERS**
}
Expand Down Expand Up @@ -83,17 +84,7 @@ android {
}
}
**PACKAGING_OPTIONS**
bundle {
language {
enableSplit = false
}
density {
enableSplit = false
}
abi {
enableSplit = true
}
}

}

**SOURCE_BUILD_SETUP**
7 changes: 4 additions & 3 deletions LINE_SDK_Unity/Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
15 changes: 12 additions & 3 deletions LINE_SDK_Unity/Packages/packages-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,23 @@
"url": "https://packages.unity.com"
},
"com.unity.ide.rider": {
"version": "1.1.4",
"version": "1.2.1",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.test-framework": "1.1.1"
},
"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,
Expand All @@ -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": {
Expand All @@ -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": {
Expand Down
1 change: 1 addition & 0 deletions LINE_SDK_Unity/ProjectSettings/GraphicsSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions LINE_SDK_Unity/ProjectSettings/ProjectVersion.txt
Original file line number Diff line number Diff line change
@@ -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)
6 changes: 3 additions & 3 deletions linesdk-android-unity-wrapper/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Binary file modified linesdk-android-unity-wrapper/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -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
72 changes: 42 additions & 30 deletions linesdk-android-unity-wrapper/gradlew
Original file line number Diff line number Diff line change
@@ -1,25 +1,43 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################

# 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
Expand All @@ -30,6 +48,7 @@ die ( ) {
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
Expand All @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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" "$@"
14 changes: 4 additions & 10 deletions linesdk-android-unity-wrapper/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ data class CallbackPayload(
private fun <T> getErrorJsonString(lineApiResponse: LineApiResponse<T>): String {
val error = ErrorForUnity(
lineApiResponse.responseCode.ordinal,
lineApiResponse.errorData?.message ?: "error"
lineApiResponse.errorData.message ?: "error"
)
return gson.toJson(error)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Scope>

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?) {
Expand Down Expand Up @@ -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 {
Expand All @@ -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"
Expand Down Expand Up @@ -113,4 +122,4 @@ class LineSdkWrapperActivity : Activity() {
)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ data class LoginResultForUnity(
accessToken,
scope,
lineProfile,
lineLoginResult.friendshipStatusChanged ?: false,
lineLoginResult.friendshipStatusChanged,
lineLoginResult.nonce
)
}
Expand Down