Commit 51314e2bf10755bd85a9c9b7f9928f5fcb8fd7ee

Authored by 赵康
1 parent 9f8c42483b
Exists in master

3.2.0版本

增加facebook sdk登录
重构回调方式,不依赖activity

Showing 17 changed files with 554 additions and 105 deletions Inline Diff

android/GameSDKRelease/.gitignore
1 /bin/ 1 /bin/
2
2 /gen/ 3 /gen/
4
3 .classpath 5 .classpath
android/GameSDKRelease/libs/GameSDK_v3.1.1_proguard.jar
No preview for this file type
android/GameSDKRelease/libs/GameSDK_v3.2.0_proguard.jar
No preview for this file type
android/GameSDKRelease/libs/android-support-v4.jar
No preview for this file type
android/GameSDKRelease/lint.xml
1 <?xml version="1.0" encoding="UTF-8"?> File was deleted
2 <lint>
3 <issue id="MissingTranslation" severity="warning" />
4 </lint>
android/GameSDKRelease/project.properties
1 # This file is automatically generated by Android Tools. 1 # This file is automatically generated by Android Tools.
2 # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 2 # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 # 3 #
4 # This file must be checked in Version Control Systems. 4 # This file must be checked in Version Control Systems.
5 # 5 #
6 # To customize properties used by the Ant build system edit 6 # To customize properties used by the Ant build system edit
7 # "ant.properties", and override values to adapt the script to your 7 # "ant.properties", and override values to adapt the script to your
8 # project structure. 8 # project structure.
9 # 9 #
10 # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 10 # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 11 #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 12
13 # Project target. 13 # Project target.
14 target=android-18 14 target=android-18
15 android.library=true 15 android.library=true
16 android.library.reference.1=../../../../../facebook
16 17
android/GameSDKSample/.gitignore
1 /gen/ 1 /gen/
2
2 /bin/ 3 /bin/
4
5 /build
6
7 /gradle
8
9 /.gradle
10 /.idea
android/GameSDKSample/AndroidManifest.xml
1 <?xml version="1.0" encoding="utf-8"?> 1 <?xml version="1.0" encoding="utf-8"?>
2 <manifest xmlns:android="http://schemas.android.com/apk/res/android" 2 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3 package="com.loginsdk.sample" 3 package="com.loginsdk.sample"
4 android:versionCode="6" 4 android:versionCode="6"
5 android:versionName="1.6" > 5 android:versionName="1.6">
6 6
7 <uses-sdk 7 <uses-sdk
8 android:minSdkVersion="8" 8 android:minSdkVersion="9"
9 android:targetSdkVersion="8" /> 9 android:targetSdkVersion="22" />
10 10
11 <uses-permission android:name="android.permission.INTERNET" /> 11 <uses-permission android:name="android.permission.INTERNET" />
12 <uses-permission android:name="android.permission.READ_PHONE_STATE" /> 12 <uses-permission android:name="android.permission.READ_PHONE_STATE" />
13 <uses-permission android:name="android.permission.BLUETOOTH" /> 13 <uses-permission android:name="android.permission.BLUETOOTH" />
14 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> 14 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
15 <uses-permission android:name="android.permission.WRITE_SETTINGS" /> 15 <uses-permission android:name="android.permission.WRITE_SETTINGS" />
16 <uses-permission android:name="android.permission.GET_ACCOUNTS" /> 16 <uses-permission android:name="android.permission.GET_ACCOUNTS" />
17 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 17 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
18 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 18 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
19 <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" /> 19 <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
20 <!-- upay --> 20 <!-- upay -->
21 <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> 21 <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
22 <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> 22 <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
23 <uses-permission android:name="android.permission.VIBRATE" /> 23 <uses-permission android:name="android.permission.VIBRATE" />
24 <uses-permission android:name="android.permission.SEND_SMS" /> 24 <uses-permission android:name="android.permission.SEND_SMS" />
25 <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /> 25 <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
26 <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> 26 <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
27 <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> 27 <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
28 <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 28 <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
29 <!-- for card.io card scanning --> 29 <!-- for card.io card scanning -->
30 <uses-permission android:name="android.permission.CAMERA" /> 30 <uses-permission android:name="android.permission.CAMERA" />
31 <!-- coda --> 31 <!-- coda -->
32 <uses-permission android:name="android.permission.RECEIVE_SMS" /> 32 <uses-permission android:name="android.permission.RECEIVE_SMS" />
33 <uses-permission android:name="android.permission.READ_SMS" /> 33 <uses-permission android:name="android.permission.READ_SMS" />
34 <uses-permission android:name="android.permission.WRITE_SMS" /> 34 <uses-permission android:name="android.permission.WRITE_SMS" />
35 <uses-permission android:name="android.permission.GET_TASKS" /> 35 <uses-permission android:name="android.permission.GET_TASKS" />
36 36
37 <!-- VERY IMPORTANT! Don't forget this permission, or in-app billing won't work. --> 37 <!-- VERY IMPORTANT! Don't forget this permission, or in-app billing won't work. -->
38 <uses-permission android:name="com.android.vending.BILLING" /> 38 <uses-permission android:name="com.android.vending.BILLING" />
39 39
40 <application 40 <application
41 android:allowBackup="true" 41 android:allowBackup="true"
42 android:icon="@drawable/ic_launcher" 42 android:icon="@drawable/ic_launcher"
43 android:label="@string/app_name" > 43 android:label="@string/app_name">
44 <activity 44 <activity
45 android:name="com.gumptech.loginsdk.sample.MainActivity" 45 android:name="com.gumptech.loginsdk.sample.MainActivity"
46 android:configChanges="navigation|orientation|keyboard" 46 android:configChanges="navigation|orientation|keyboard"
47 android:label="@string/app_name" 47 android:label="@string/app_name"
48 android:screenOrientation="portrait" > 48 android:screenOrientation="portrait">
49 <intent-filter> 49 <intent-filter>
50 <action android:name="android.intent.action.MAIN" /> 50 <action android:name="android.intent.action.MAIN" />
51 51
52 <category android:name="android.intent.category.LAUNCHER" /> 52 <category android:name="android.intent.category.LAUNCHER" />
53 </intent-filter> 53 </intent-filter>
54 </activity> 54 </activity>
55 <activity 55 <activity
56 android:name="com.gumptech.sdk.ContainerActivity" 56 android:name="com.gumptech.sdk.ContainerActivity"
57 android:configChanges="orientation|screenLayout" 57 android:configChanges="orientation|screenLayout"
58 android:theme="@style/container_dialog" > 58 android:theme="@style/container_dialog"></activity>
59 </activity>
60 <activity 59 <activity
61 android:name="com.gumptech.sdk.PaymentActivity" 60 android:name="com.gumptech.sdk.PaymentActivity"
62 android:configChanges="orientation|screenLayout" 61 android:configChanges="orientation|screenLayout"
63 android:theme="@android:style/Theme.Translucent.NoTitleBar" > 62 android:theme="@android:style/Theme.Translucent.NoTitleBar"></activity>
64 </activity>
65 <activity 63 <activity
66 android:name="com.gumptech.sdk.ExchangeWindow" 64 android:name="com.gumptech.sdk.ExchangeWindow"
67 android:configChanges="orientation|screenLayout" 65 android:configChanges="orientation|screenLayout"
68 android:theme="@style/ex_win" > 66 android:theme="@style/ex_win"></activity>
69 </activity>
70 67
71 <service android:name="com.gumptech.sdk.PushService" > 68 <service android:name="com.gumptech.sdk.PushService"></service>
72 </service> 69
70 <activity
71 android:name="com.facebook.FacebookActivity"
72 android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
73 android:label="@string/app_name"
74 android:theme="@android:style/Theme.Translucent.NoTitleBar" />
android/GameSDKSample/GameSDKSample.iml
File was created 1 <?xml version="1.0" encoding="UTF-8"?>
2 <module external.linked.project.id="GameSDKSample" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
3 <component name="FacetManager">
4 <facet type="android-gradle" name="Android-Gradle">
5 <configuration>
6 <option name="GRADLE_PROJECT_PATH" value=":" />
7 </configuration>
8 </facet>
9 <facet type="java-gradle" name="Java-Gradle">
10 <configuration>
11 <option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
12 <option name="BUILDABLE" value="false" />
13 </configuration>
14 </facet>
15 <facet type="android" name="Android">
16 <configuration>
17 <option name="SELECTED_BUILD_VARIANT" value="release" />
18 <option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
19 <option name="ASSEMBLE_TASK_NAME" value="assembleRelease" />
20 <option name="COMPILE_JAVA_TASK_NAME" value="compileReleaseSources" />
21 <option name="SOURCE_GEN_TASK_NAME" value="generateReleaseSources" />
22 <option name="ALLOW_USER_CONFIGURATION" value="false" />
23 <option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/res" />
24 </configuration>
25 </facet>
26 </component>
27 <component name="NewModuleRootManager" inherit-compiler-output="false">
28 <output url="file://$MODULE_DIR$/build/intermediates/classes/release" />
29 <output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" />
30 <exclude-output />
31 <content url="file://$MODULE_DIR$">
32 <sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/release" isTestSource="false" generated="true" />
33 <sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/release" isTestSource="false" generated="true" />
34 <sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/release" isTestSource="false" generated="true" />
35 <sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/release" isTestSource="false" generated="true" />
36 <sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/release" type="java-resource" />
37 <sourceFolder url="file://$MODULE_DIR$/build/generated/res/generated/release" type="java-resource" />
38 <sourceFolder url="file://$MODULE_DIR$/build-types/release/res" type="java-resource" />
39 <sourceFolder url="file://$MODULE_DIR$/build-types/release/resources" type="java-resource" />
40 <sourceFolder url="file://$MODULE_DIR$/build-types/release/assets" type="java-resource" />
41 <sourceFolder url="file://$MODULE_DIR$/build-types/release/aidl" isTestSource="false" />
42 <sourceFolder url="file://$MODULE_DIR$/build-types/release/java" isTestSource="false" />
43 <sourceFolder url="file://$MODULE_DIR$/build-types/release/jni" isTestSource="false" />
44 <sourceFolder url="file://$MODULE_DIR$/build-types/release/rs" isTestSource="false" />
45 <sourceFolder url="file://$MODULE_DIR$/res" type="java-resource" />
46 <sourceFolder url="file://$MODULE_DIR$/src" type="java-resource" />
47 <sourceFolder url="file://$MODULE_DIR$/assets" type="java-resource" />
48 <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
49 <sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
50 <sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
51 <sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
52 <sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
53 <sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
54 <sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
55 <sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
56 <sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
57 <excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
58 <excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
59 <excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
60 <excludeFolder url="file://$MODULE_DIR$/build/intermediates/coverage-instrumented-classes" />
61 <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
62 <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
63 <excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
64 <excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
65 <excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
66 <excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
67 <excludeFolder url="file://$MODULE_DIR$/build/intermediates/libs" />
68 <excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
69 <excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
70 <excludeFolder url="file://$MODULE_DIR$/build/intermediates/ndk" />
71 <excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
72 <excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard" />
73 <excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
74 <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
75 <excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
76 <excludeFolder url="file://$MODULE_DIR$/build/outputs" />
77 <excludeFolder url="file://$MODULE_DIR$/build/tmp" />
78 </content>
79 <orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
80 <orderEntry type="sourceFolder" forTests="false" />
81 <orderEntry type="library" exported="" name="bolts-android-1.2.1" level="project" />
82 <orderEntry type="library" exported="" name="support-annotations-22.1.1" level="project" />
83 <orderEntry type="module" module-name="GameSDK" exported="" />
84 </component>
85 </module>
android/GameSDKSample/build.gradle
File was created 1 buildscript {
2 repositories {
3 mavenCentral()
4 }
5 dependencies {
6 classpath 'com.android.tools.build:gradle:1.2.3'
7 }
8 }
9 repositories {
10 mavenCentral()
11 }
12 apply plugin: 'com.android.application'
13
14 dependencies {
15 compile fileTree(dir: 'libs', include: '*.jar')
16 compile project(':GameSDK')
17 }
18
19 android {
20 signingConfigs {
21 letsgame {
22 keyAlias 'ZzTYEadlf2349UIkdf38934KDlsfdKqpzmdhewri387429LKDJL'
23 keyPassword 'ZDJDLL23YRPQM3BBXjdfpow3KDehwyrojafdajfjadfLDK83I'
24 storeFile file('E:/cert/letsgame.keystore')
25 storePassword 'ZDJDLL23YRPQM3BBXjdfpow3KDehwyrojafdajfjadfLDK83I'
26 }
27 }
28 compileSdkVersion 22
29 buildToolsVersion '22.0.1'
30 sourceSets {
31 main {
32 manifest.srcFile 'AndroidManifest.xml'
33 java.srcDirs = ['src']
34 resources.srcDirs = ['src']
35 aidl.srcDirs = ['src']
36 renderscript.srcDirs = ['src']
37 res.srcDirs = ['res']
38 assets.srcDirs = ['assets']
39 }
40
41 // Move the tests to tests/java, tests/res, etc...
42 instrumentTest.setRoot('tests')
43
44 // Move the build types to build-types/<type>
45 // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
46 // This moves them out of them default location under src/<type>/... which would
47 // conflict with src/ being used by the main source set.
48 // Adding new build types or product flavors should be accompanied
49 // by a similar customization.
50 debug.setRoot('build-types/debug')
51 release.setRoot('build-types/release')
52 }
53 compileOptions {
54 sourceCompatibility JavaVersion.VERSION_1_7
55 targetCompatibility JavaVersion.VERSION_1_7
56 }
57 buildTypes {
58 release {
59 signingConfig signingConfigs.letsgame
60 }
61 debug {
62 signingConfig signingConfigs.letsgame
63 }
64 }
65 defaultConfig {
66 signingConfig signingConfigs.letsgame
67 }
68 productFlavors {
69 }
70 }
71
android/GameSDKSample/gradlew
File was created 1 #!/usr/bin/env bash
2
3 ##############################################################################
4 ##
5 ## Gradle start up script for UN*X
6 ##
7 ##############################################################################
8
9 # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 DEFAULT_JVM_OPTS=""
11
12 APP_NAME="Gradle"
13 APP_BASE_NAME=`basename "$0"`
14
15 # Use the maximum available, or set MAX_FD != -1 to use that value.
16 MAX_FD="maximum"
17
18 warn ( ) {
19 echo "$*"
20 }
21
22 die ( ) {
23 echo
24 echo "$*"
25 echo
26 exit 1
27 }
28
29 # OS specific support (must be 'true' or 'false').
30 cygwin=false
31 msys=false
32 darwin=false
33 case "`uname`" in
34 CYGWIN* )
35 cygwin=true
36 ;;
37 Darwin* )
38 darwin=true
39 ;;
40 MINGW* )
41 msys=true
42 ;;
43 esac
44
45 # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 if $cygwin ; then
47 [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 fi
49
50 # Attempt to set APP_HOME
51 # Resolve links: $0 may be a link
52 PRG="$0"
53 # Need this for relative symlinks.
54 while [ -h "$PRG" ] ; do
55 ls=`ls -ld "$PRG"`
56 link=`expr "$ls" : '.*-> \(.*\)$'`
57 if expr "$link" : '/.*' > /dev/null; then
58 PRG="$link"
59 else
60 PRG=`dirname "$PRG"`"/$link"
61 fi
62 done
63 SAVED="`pwd`"
64 cd "`dirname \"$PRG\"`/" >&-
65 APP_HOME="`pwd -P`"
66 cd "$SAVED" >&-
67
68 CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69
70 # Determine the Java command to use to start the JVM.
71 if [ -n "$JAVA_HOME" ] ; then
72 if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 # IBM's JDK on AIX uses strange locations for the executables
74 JAVACMD="$JAVA_HOME/jre/sh/java"
75 else
76 JAVACMD="$JAVA_HOME/bin/java"
77 fi
78 if [ ! -x "$JAVACMD" ] ; then
79 die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80
81 Please set the JAVA_HOME variable in your environment to match the
82 location of your Java installation."
83 fi
84 else
85 JAVACMD="java"
86 which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87
88 Please set the JAVA_HOME variable in your environment to match the
89 location of your Java installation."
90 fi
91
92 # Increase the maximum file descriptors if we can.
93 if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 MAX_FD_LIMIT=`ulimit -H -n`
95 if [ $? -eq 0 ] ; then
96 if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 MAX_FD="$MAX_FD_LIMIT"
98 fi
99 ulimit -n $MAX_FD
100 if [ $? -ne 0 ] ; then
101 warn "Could not set maximum file descriptor limit: $MAX_FD"
102 fi
103 else
104 warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 fi
106 fi
107
108 # For Darwin, add options to specify how the application appears in the dock
109 if $darwin; then
110 GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 fi
112
113 # For Cygwin, switch paths to Windows format before running java
114 if $cygwin ; then
115 APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117
118 # We build the pattern for arguments to be converted via cygpath
119 ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 SEP=""
121 for dir in $ROOTDIRSRAW ; do
122 ROOTDIRS="$ROOTDIRS$SEP$dir"
123 SEP="|"
124 done
125 OURCYGPATTERN="(^($ROOTDIRS))"
126 # Add a user-defined pattern to the cygpath arguments
127 if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 fi
130 # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 i=0
132 for arg in "$@" ; do
133 CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135
136 if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 else
139 eval `echo args$i`="\"$arg\""
140 fi
141 i=$((i+1))
142 done
143 case $i in
144 (0) set -- ;;
145 (1) set -- "$args0" ;;
146 (2) set -- "$args0" "$args1" ;;
147 (3) set -- "$args0" "$args1" "$args2" ;;
148 (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 esac
155 fi
156
157 # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 function splitJvmOpts() {
159 JVM_OPTS=("$@")
160 }
161 eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163
164 exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165
android/GameSDKSample/gradlew.bat
File was created 1 @if "%DEBUG%" == "" @echo off
2 @rem ##########################################################################
3 @rem
4 @rem Gradle startup script for Windows
5 @rem
6 @rem ##########################################################################
7
8 @rem Set local scope for the variables with windows NT shell
9 if "%OS%"=="Windows_NT" setlocal
10
11 @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 set DEFAULT_JVM_OPTS=
13
14 set DIRNAME=%~dp0
15 if "%DIRNAME%" == "" set DIRNAME=.
16 set APP_BASE_NAME=%~n0
17 set APP_HOME=%DIRNAME%
18
19 @rem Find java.exe
20 if defined JAVA_HOME goto findJavaFromJavaHome
21
22 set JAVA_EXE=java.exe
23 %JAVA_EXE% -version >NUL 2>&1
24 if "%ERRORLEVEL%" == "0" goto init
25
26 echo.
27 echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 echo.
29 echo Please set the JAVA_HOME variable in your environment to match the
30 echo location of your Java installation.
31
32 goto fail
33
34 :findJavaFromJavaHome
35 set JAVA_HOME=%JAVA_HOME:"=%
36 set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37
38 if exist "%JAVA_EXE%" goto init
39
40 echo.
41 echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 echo.
43 echo Please set the JAVA_HOME variable in your environment to match the
44 echo location of your Java installation.
45
46 goto fail
47
48 :init
49 @rem Get command-line arguments, handling Windowz variants
50
51 if not "%OS%" == "Windows_NT" goto win9xME_args
52 if "%@eval[2+2]" == "4" goto 4NT_args
53
54 :win9xME_args
55 @rem Slurp the command line arguments.
56 set CMD_LINE_ARGS=
57 set _SKIP=2
58
59 :win9xME_args_slurp
60 if "x%~1" == "x" goto execute
61
62 set CMD_LINE_ARGS=%*
63 goto execute
64
65 :4NT_args
66 @rem Get arguments from the 4NT Shell from JP Software
67 set CMD_LINE_ARGS=%$
68
69 :execute
70 @rem Setup the command line
71
72 set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73
74 @rem Execute Gradle
75 "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76
77 :end
78 @rem End local scope for the variables with windows NT shell
79 if "%ERRORLEVEL%"=="0" goto mainEnd
80
81 :fail
82 rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 rem the _cmd.exe /c_ return code!
84 if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 exit /b 1
86
87 :mainEnd
88 if "%OS%"=="Windows_NT" endlocal
89
90 :omega
91
android/GameSDKSample/lint.xml
1 <?xml version="1.0" encoding="UTF-8"?> File was deleted
2 <lint>
3 <issue id="MissingTranslation" severity="warning" />
4 </lint>
android/GameSDKSample/local.properties
File was created 1 ## This file is automatically generated by Android Studio.
2 # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 #
4 # This file must *NOT* be checked into Version Control Systems,
5 # as it contains information specific to your local configuration.
6 #
7 # Location of the SDK. This is only used by Gradle.
8 # For customization when using a Version Control System, please read the
9 # header note.
10 #Thu Jul 23 18:18:45 CST 2015
11 sdk.dir=D\:\\DevTools\\android-sdk-windows
12
android/GameSDKSample/project.properties
1 # This file is automatically generated by Android Tools. 1 # This file is automatically generated by Android Tools.
2 # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 2 # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 # 3 #
4 # This file must be checked in Version Control Systems. 4 # This file must be checked in Version Control Systems.
5 # 5 #
6 # To customize properties used by the Ant build system edit 6 # To customize properties used by the Ant build system edit
7 # "ant.properties", and override values to adapt the script to your 7 # "ant.properties", and override values to adapt the script to your
8 # project structure. 8 # project structure.
9 # 9 #
10 # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 10 # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 11 #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 12
13 # Project target. 13 # Project target.
14 14
15 target=android-18 15 target=android-19
16 android.library.reference.1=../GameSDKRelease 16 android.library.reference.1=..\\GameSDKRelease
17 17
android/GameSDKSample/settings.gradle
File was created 1 include ':facebook'
2 include ':GameSDK'
3 project(':facebook').projectDir = new File('../../../../../facebook')
4 project(':GameSDK').projectDir = new File('../../../../gamesdk/GameSDK')
android/GameSDKSample/src/com/gumptech/loginsdk/sample/MainActivity.java
1 package com.gumptech.loginsdk.sample; 1 package com.gumptech.loginsdk.sample;
2 2
3 import android.app.Activity; 3 import android.app.Activity;
4 import android.content.Intent; 4 import android.content.Intent;
5 import android.os.Bundle; 5 import android.os.Bundle;
6 import android.util.Log; 6 import android.util.Log;
7 import android.view.View; 7 import android.view.View;
8 import android.widget.Button; 8 import android.widget.Button;
9 import android.widget.TextView; 9 import android.widget.TextView;
10 import android.widget.Toast; 10 import android.widget.Toast;
11 11
12 import com.gumptech.sdk.GumpSDK; 12 import com.gumptech.sdk.GumpSDK;
13 import com.gumptech.sdk.bean.GumpUser;
14 import com.gumptech.sdk.bean.PurchaseResult;
15 import com.gumptech.sdk.callback.InitializeCallback;
16 import com.gumptech.sdk.callback.LoginStateListener;
17 import com.gumptech.sdk.callback.PurchaseCallback;
13 import com.loginsdk.sample.R; 18 import com.loginsdk.sample.R;
14 19
15 public class MainActivity extends Activity implements GumpSDK.Callback { 20 public class MainActivity extends Activity implements PurchaseCallback{
16
17 private TextView tvVersion;
18 private TextView userInfo;
19
20 private Button btnLoginOrLogout;
21
22 private String appId = "10009";
23
24 @Override
25 protected void onCreate(Bundle savedInstanceState) {
26 super.onCreate(savedInstanceState);
27 setContentView(R.layout.activity_main);
28 tvVersion = (TextView) findViewById(R.id.version);
29 userInfo = (TextView) findViewById(R.id.user_info);
30 btnLoginOrLogout = (Button) findViewById(R.id.login_or_logout);
31 btnLoginOrLogout.setOnClickListener(new View.OnClickListener() {
32
33 @Override
34 public void onClick(View v) {
35 if (btnLoginOrLogout.getTag() == null || (Integer) btnLoginOrLogout.getTag() == 0)
36 GumpSDK.start(MainActivity.this);
37 else
38 GumpSDK.logout(MainActivity.this, MainActivity.this);
39 }
40 });
41 findViewById(R.id.pay).setOnClickListener(new View.OnClickListener() {
42
43 @Override
44 public void onClick(View v) {
45 Bundle payInfo = new Bundle();
46 payInfo.putString("nick", "thi");
47 payInfo.putString("product", "元宝");
48 payInfo.putFloat("amount", 0.0f);
49 payInfo.putString("extraInfo", "This is demo!");
50 payInfo.putString("serverId", "4019");
51 GumpSDK.pay(MainActivity.this, payInfo, "2263806");
52 }
53 });
54 GumpSDK.init(getApplicationContext(), appId, "483d8df877b31405c1e8fe4247f02d86", "1000");
55 GumpSDK.setLogoShow(true);
56 GumpSDK.setScreenLandscape(false);
57 tvVersion.setText("SDK Version:" + GumpSDK.getVersion());
58 GumpSDK.start(this);
59 }
60
61 @Override
62 protected void onActivityResult(int requestCode, int resultCode, Intent data) {
63 Log.d("Main", "activity requestCode:" + requestCode + ",resultCode:" + resultCode);
64 if (requestCode == GumpSDK.LOGIN_REQUEST_CODE) {
65 if (resultCode == RESULT_OK) {
66 String uid = data.getStringExtra("userId");
67 int accountType = data.getIntExtra("accountType", -1);
68 String sessionkey = data.getStringExtra("sessionKey");
69 userInfo.setText(" userid:" + uid + "\n accountType:" + accountType + "\n sessionKey:" + sessionkey);
70 btnLoginOrLogout.setText("Logout");
71 btnLoginOrLogout.setTag(1);
72 } else if (resultCode == RESULT_CANCELED) {
73 Toast.makeText(this, "operate be canceled", Toast.LENGTH_SHORT).show();
74 }
75 }
76 // @Deprecated
77 // else if (requestCode == GumpSDK.PAY_REQUEST_CODE) {
78 // if (resultCode == RESULT_OK) {
79 // int code = data.getIntExtra("code", -1);
80 // String msg = data.getStringExtra("msg");
81 // String orderId = data.getStringExtra("orderId");
82 // String extraInfo = data.getStringExtra("extraInfo");
83 // Toast.makeText(this, "pay result: " + code + "," + msg + ",orderId:" + orderId + ",extraInfo:" + extraInfo, Toast.LENGTH_SHORT).show();
84 // } else if (resultCode == RESULT_CANCELED) {
85 // Toast.makeText(this, "operate be canceled", Toast.LENGTH_SHORT).show();
86 // }
87 // }
88 super.onActivityResult(requestCode, resultCode, data);
89 }
90
91 @Override
92 public void onLogout() {
93 btnLoginOrLogout.setText("Login");
94 btnLoginOrLogout.setTag(0);
95 userInfo.append("\n User is logout");
96 }
97 21
22 private static final String TAG = "MainActivity";
23
24 private TextView tvVersion;
25 private TextView userInfo;
26
27 private Button btnLoginOrLogout;
28
29 private String appId = "10022";
30 private String appKey = "93a27b0bd99bac3e68a440b48aa421ab";
31
32 @Override
33 protected void onCreate(Bundle savedInstanceState) {
34 super.onCreate(savedInstanceState);
35 setContentView(R.layout.activity_main);
36 tvVersion = (TextView) findViewById(R.id.version);
37 userInfo = (TextView) findViewById(R.id.user_info);
38 btnLoginOrLogout = (Button) findViewById(R.id.login_or_logout);