Commit 188bc4cf8dc907e2767f4b85387eab3c4e24cd24

Authored by 赵康
1 parent 38e7800dc3
Exists in master

v4.3.3:增加微信登录

Showing 10 changed files with 81 additions and 9 deletions Side-by-side Diff

GameSDK-release4.3.2.aar
No preview for this file type
GameSDK-release4.3.3.aar
No preview for this file type
GameSDKDemo/.gitignore
1 1 /build
2   -*.iml
3 2 \ No newline at end of file
  3 +*.iml
  4 +local.properties
4 5 \ No newline at end of file
GameSDKDemo/build.gradle
1 1 apply plugin: 'com.android.application'
2 2  
  3 +/*gump test config,you could ignore it
  4 +* gump打包测试使用,你可以自行配置,或者直接删除这部分内容
  5 +*/
  6 +def keystorePSW = ''
  7 +def keystoreAlias = ''
  8 +def keystoreAliasPSW = ''
  9 +// default keystore file, PLZ config file path in local.properties
  10 +def keyfile = file('s.keystore.temp')
  11 +
  12 +Properties properties = new Properties()
  13 +// local.properties file in the root director
  14 +properties.load(project.file('local.properties').newDataInputStream())
  15 +def keystoreFilepath = properties.getProperty("keystore.path")
  16 +
  17 +if (keystoreFilepath) {
  18 + keystorePSW = properties.getProperty("keystore.password")
  19 + keystoreAlias = properties.getProperty("keystore.alias")
  20 + keystoreAliasPSW = properties.getProperty("keystore.key_passwd")
  21 + keyfile = file(keystoreFilepath)
  22 +}
  23 +/*
  24 + * gump test config,you could ignore it
  25 + * gump打包测试使用,你可以自行配置,或者直接删除这部分内容
  26 + */
  27 +
3 28 repositories {
4 29 flatDir {
5 30 dirs 'libs'
... ... @@ -10,32 +35,45 @@ android {
10 35 compileSdkVersion 22
11 36 buildToolsVersion "26.0.2"
12 37  
  38 + signingConfigs {
  39 + release {
  40 + storeFile keyfile
  41 + storePassword keystorePSW
  42 + keyPassword keystoreAliasPSW
  43 + keyAlias keystoreAlias
  44 + }
  45 + }
  46 +
13 47 defaultConfig {
14 48 minSdkVersion 9
15 49 targetSdkVersion 22
16 50 versionCode 5
17 51 versionName "1.3"
18 52 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  53 + signingConfig signingConfigs.release
19 54 }
20   -
21 55 buildTypes {
22 56 release {
23 57 minifyEnabled false
24 58 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  59 + zipAlignEnabled true
  60 + }
  61 + debug {
  62 + signingConfig signingConfigs.release
25 63 }
26 64 }
27 65 lintOptions {
28 66 abortOnError false
29 67 }
  68 +
30 69 }
31 70  
32 71 dependencies {
33   - compile fileTree(dir: 'libs', include: ['*.jar'])
  72 + compile fileTree(include: ['*.jar'], dir: 'libs')
34 73 testCompile 'junit:junit:4.12'
35 74 compile 'com.android.support:appcompat-v7:22.2.0'
36 75 //微信
37   -// compile 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+'
  76 + compile 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+'
38 77 // compile project(':GameSDK')
39   - compile(name: 'GameSDK-release4.3.2', ext: 'aar')
40   -
  78 + compile(name: 'GameSDK-release4.3.3', ext: 'aar')
41 79 }
GameSDKDemo/libs/GameSDK-release4.3.2.aar
No preview for this file type
GameSDKDemo/libs/GameSDK-release4.3.3.aar
No preview for this file type
GameSDKDemo/src/main/AndroidManifest.xml
... ... @@ -71,6 +71,10 @@
71 71 <service android:name="com.gumptech.sdk.PushService">
72 72 </service>
73 73  
  74 + <!--wechat-->
  75 + <activity
  76 + android:name=".wxapi.WXEntryActivity"
  77 + android:exported="true"></activity>
74 78 <!-- vk -->
75 79 <!-- <activity android:name="com.vk.com.gumptech.sdk.VKOpenAuthActivity" /> -->
76 80 <!-- <activity -->
GameSDKDemo/src/main/java/com/gumptech/sdk/demo/MainActivity.java
... ... @@ -97,7 +97,7 @@ public class MainActivity extends Activity implements PurchaseCallback {
97 97 * 设置启用Wechat登录
98 98 *
99 99 */
100   -// GumpSDK.getSettings().requestThirdSupport(SDKSettings.THIRD_SUPPORT_WECHAT);
  100 + GumpSDK.getSettings().requestThirdSupport(SDKSettings.THIRD_SUPPORT_WECHAT);
101 101  
102 102 /**
103 103 * 设置启用google登录
GameSDKDemo/src/main/java/com/gumptech/sdk/demo/wxapi/WXEntryActivity.java
... ... @@ -0,0 +1,18 @@
  1 +package com.gumptech.sdk.demo.wxapi;
  2 +
  3 +import android.os.Bundle;
  4 +import android.support.annotation.Nullable;
  5 +
  6 +import com.gumptech.sdk.WXCallbackActivity;
  7 +
  8 +/**
  9 + * Created by King on 2018/2/7.
  10 + */
  11 +
  12 +public class WXEntryActivity extends WXCallbackActivity {
  13 +
  14 + @Override
  15 + protected void onCreate(@Nullable Bundle bundle) {
  16 + super.onCreate(bundle);
  17 + }
  18 +}
1 1 # Gump SDK 4 for Android接入文档
2 2  
3   -V4.3.1
4   -2018年1月16日
  3 +V4.3.3
  4 +2018年2月08日
5 5  
6 6 ## 版本概述
7 7  
... ... @@ -28,6 +28,10 @@ V4.3.1
28 28  
29 29 compile project(':vksdk_library')
30 30  
  31 +选择接入微信登录时,需要增加微信依赖,如下:
  32 +
  33 + compile 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+'
  34 +
31 35 ### 2.修改AndroidManifest.xml文件
32 36 首先添加必要的权限,如下所示:
33 37  
... ... @@ -81,6 +85,10 @@ V4.3.1
81 85 android:name="com.vk.sdk.VKServiceActivity"
82 86 android:label="ServiceActivity"
83 87 android:theme="@style/VK.Transparent" />
  88 + <!--wechat接入使用,不接入不需要配置-->
  89 + <activity
  90 + android:name=".wxapi.WXEntryActivity"
  91 + android:exported="true"></activity>
84 92  
85 93 ### 3.向Gump平台索要游戏ID(AppID),完成代码接入
86 94 正式开始接入逻辑代码前,先介绍下一些附加设置,以方便代码接入
... ... @@ -148,6 +156,9 @@ InitializeCallback为初始化回调接口,此接口只有一个回调方法init
148 156 gumpUser.getAccountType();//用户类型,此类型数据可从GumpPreference常量获取
149 157 gumpUser.getSessionKey();//登录的sesionKey
150 158  
  159 +***注意:若需要使用微信登录,需要在packageName.wxapi下增加一个名为WXEntryActivity并继承com.gumptech.sdk.WXCallbackActivity的Activity,并参考AndroidManifest.xml设置的说明,做相应的配置,packageName为应用的包名,此Activity不须任何实现。***
  160 +
  161 +***以GumpSDKDemo为例,包名为com.gumptech.sdk.demo,则WXEntryActivity的完整包路径为:com.gumptech.sdk.demo.wxapi.WXEntryActivity***
151 162  
152 163 #### 3.支付功能
153 164 1)使用gump通行证登录,其中除nick外所有参数为必传参数