Commit 677ee12b7d61691330aa1992d2c7a08bc38dab75
1 parent
45e6983e8e
Exists in
master
v3.3.13
修改webview对sslError的处理,默认拒止
Showing 5 changed files with 7 additions and 7 deletions Inline Diff
android/GameSDKRelease/libs/GameSDK_v3.3.12_proguard.jar
No preview for this file type
android/GameSDKRelease/libs/GameSDK_v3.3.13_proguard.jar
No preview for this file type
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.gumpsdk.wuruid" | 3 | package="com.gumpsdk.gp.demo" |
| 4 | android:versionCode="6" | 4 | android:versionCode="14" |
| 5 | android:versionName="1.6" > | 5 | android:versionName="1.8" > |
| 6 | 6 | ||
| 7 | <uses-sdk | 7 | <uses-sdk |
| 8 | android:minSdkVersion="9" | 8 | android:minSdkVersion="9" |
| 9 | android:targetSdkVersion="22" /> | 9 | android:targetSdkVersion="20" /> |
| 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 | <uses-permission android:name="android.permission.SEND_SMS"/> | 20 | <uses-permission android:name="android.permission.SEND_SMS"/> |
| 21 | 21 | ||
| 22 | <!-- VERY IMPORTANT! Don't forget this permission, or in-app billing won't work. --> | 22 | <!-- VERY IMPORTANT! Don't forget this permission, or in-app billing won't work. --> |
| 23 | <uses-permission android:name="com.android.vending.BILLING" /> | 23 | <uses-permission android:name="com.android.vending.BILLING" /> |
| 24 | 24 | ||
| 25 | <application | 25 | <application |
| 26 | android:allowBackup="true" | 26 | android:allowBackup="true" |
| 27 | android:icon="@drawable/ic_launcher" | 27 | android:icon="@drawable/ic_launcher" |
| 28 | android:label="@string/app_name" > | 28 | android:label="@string/app_name" > |
| 29 | <activity | 29 | <activity |
| 30 | android:name="com.gumptech.loginsdk.sample.MainActivity" | 30 | android:name="com.gumptech.loginsdk.sample.MainActivity" |
| 31 | android:configChanges="orientation|screenSize|keyboardHidden|keyboard|screenLayout" | 31 | android:configChanges="orientation|screenSize|keyboardHidden|keyboard|screenLayout" |
| 32 | android:label="@string/app_name" | 32 | android:label="@string/app_name" |
| 33 | android:screenOrientation="landscape" > | 33 | android:screenOrientation="landscape" > |
| 34 | <intent-filter> | 34 | <intent-filter> |
| 35 | <action android:name="android.intent.action.MAIN" /> | 35 | <action android:name="android.intent.action.MAIN" /> |
| 36 | 36 | ||
| 37 | <category android:name="android.intent.category.LAUNCHER" /> | 37 | <category android:name="android.intent.category.LAUNCHER" /> |
| 38 | </intent-filter> | 38 | </intent-filter> |
| 39 | </activity> | 39 | </activity> |
| 40 | <activity | 40 | <activity |
| 41 | android:name="com.gumptech.sdk.ContainerActivity" | 41 | android:name="com.gumptech.sdk.ContainerActivity" |
| 42 | android:configChanges="orientation|screenSize|keyboardHidden|keyboard|screenLayout" | 42 | android:configChanges="orientation|screenSize|keyboardHidden|keyboard|screenLayout" |
| 43 | android:windowSoftInputMode="stateAlwaysHidden|adjustPan" | 43 | android:windowSoftInputMode="stateAlwaysHidden|adjustPan" |
| 44 | android:theme="@style/Theme.TransparentWin" > | 44 | android:theme="@style/Theme.TransparentWin" > |
| 45 | </activity> | 45 | </activity> |
| 46 | <activity | 46 | <activity |
| 47 | android:name="com.gumptech.sdk.PaymentActivity" | 47 | android:name="com.gumptech.sdk.PaymentActivity" |
| 48 | android:configChanges="orientation|screenSize|keyboardHidden|keyboard|screenLayout" | 48 | android:configChanges="orientation|screenSize|keyboardHidden|keyboard|screenLayout" |
| 49 | android:launchMode="singleTask" | 49 | android:launchMode="singleTask" |
| 50 | android:theme="@android:style/Theme.Translucent.NoTitleBar" > | 50 | android:theme="@android:style/Theme.Translucent.NoTitleBar" > |
| 51 | <intent-filter> | 51 | <intent-filter> |
| 52 | <category android:name="android.intent.category.DEFAULT" /> | 52 | <category android:name="android.intent.category.DEFAULT" /> |
| 53 | 53 | ||
| 54 | <action android:name="android.intent.action.VIEW" /> | 54 | <action android:name="android.intent.action.VIEW" /> |
| 55 | 55 | ||
| 56 | <category android:name="android.intent.category.BROWSABLE" /> | 56 | <category android:name="android.intent.category.BROWSABLE" /> |
| 57 | 57 | ||
| 58 | <data | 58 | <data |
| 59 | android:host="com.gump.sdk" | 59 | android:host="com.gump.sdk" |
| 60 | android:scheme="gump10031" /> | 60 | android:scheme="gump10031" /> |
| 61 | </intent-filter> | 61 | </intent-filter> |
| 62 | </activity> | 62 | </activity> |
| 63 | <activity | 63 | <activity |
| 64 | android:name="com.gumptech.sdk.ExchangeWindow" | 64 | android:name="com.gumptech.sdk.ExchangeWindow" |
| 65 | android:configChanges="orientation|screenSize|keyboardHidden|keyboard|screenLayout" | 65 | android:configChanges="orientation|screenSize|keyboardHidden|keyboard|screenLayout" |
| 66 | android:theme="@style/Theme.WinForExchange" > | 66 | android:theme="@style/Theme.WinForExchange" > |
| 67 | </activity> | 67 | </activity> |
| 68 | 68 | ||
| 69 | <service android:name="com.gumptech.sdk.PushService" > | 69 | <service android:name="com.gumptech.sdk.PushService" > |
| 70 | </service> | 70 | </service> |
| 71 | 71 | ||
| 72 | <!-- facebook --> | 72 | <!-- facebook --> |
| 73 | <activity | 73 | <activity |
| 74 | android:name="com.facebook.FacebookActivity" | 74 | android:name="com.facebook.FacebookActivity" |
| 75 | android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" | 75 | android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" |
| 76 | android:label="@string/app_name" | 76 | android:label="@string/app_name" |
| 77 | android:theme="@android:style/Theme.Translucent.NoTitleBar" /> | 77 | android:theme="@android:style/Theme.Translucent.NoTitleBar" /> |
| 78 | <!-- vk --> | 78 | <!-- vk --> |
| 79 | <!-- <activity android:name="com.vk.sdk.VKOpenAuthActivity" /> --> | 79 | <!-- <activity android:name="com.vk.sdk.VKOpenAuthActivity" /> --> |
| 80 | <!-- <activity --> | 80 | <!-- <activity --> |
| 81 | <!-- android:name="com.vk.sdk.VKServiceActivity" --> | 81 | <!-- android:name="com.vk.sdk.VKServiceActivity" --> |
| 82 | <!-- android:label="ServiceActivity" --> | 82 | <!-- android:label="ServiceActivity" --> |
| 83 | <!-- android:theme="@style/VK.Transparent" /> --> | 83 | <!-- android:theme="@style/VK.Transparent" /> --> |
| 84 | </application> | 84 | </application> |
| 85 | 85 | ||
| 86 | </manifest> | 86 | </manifest> |
android/GameSDKSample/res/drawable-xhdpi/gump_push_icon.png
9.91 KB
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.Context; | 4 | import android.content.Context; |
| 5 | import android.os.Bundle; | 5 | import android.os.Bundle; |
| 6 | import android.text.ClipboardManager; | 6 | import android.text.ClipboardManager; |
| 7 | import android.util.Log; | 7 | import android.util.Log; |
| 8 | import android.view.View; | 8 | import android.view.View; |
| 9 | import android.widget.Button; | 9 | import android.widget.Button; |
| 10 | import android.widget.TextView; | 10 | import android.widget.TextView; |
| 11 | import android.widget.Toast; | 11 | import android.widget.Toast; |
| 12 | 12 | ||
| 13 | import com.gumptech.sdk.GumpPreference; | 13 | import com.gumptech.sdk.GumpPreference; |
| 14 | import com.gumptech.sdk.GumpSDK; | 14 | import com.gumptech.sdk.GumpSDK; |
| 15 | import com.gumptech.sdk.bean.GumpUser; | 15 | import com.gumptech.sdk.bean.GumpUser; |
| 16 | import com.gumptech.sdk.bean.PurchaseResult; | 16 | import com.gumptech.sdk.bean.PurchaseResult; |
| 17 | import com.gumptech.sdk.callback.InitializeCallback; | 17 | import com.gumptech.sdk.callback.InitializeCallback; |
| 18 | import com.gumptech.sdk.callback.LoginStateListener; | 18 | import com.gumptech.sdk.callback.LoginStateListener; |
| 19 | import com.gumptech.sdk.callback.PurchaseCallback; | 19 | import com.gumptech.sdk.callback.PurchaseCallback; |
| 20 | import com.gumpsdk.wuruid.R; | 20 | import com.gumpsdk.gp.demo.R; |
| 21 | 21 | ||
| 22 | public class MainActivity extends Activity implements PurchaseCallback{ | 22 | public class MainActivity extends Activity implements PurchaseCallback{ |
| 23 | 23 | ||
| 24 | private static final String TAG = "MainActivity"; | 24 | private static final String TAG = "MainActivity"; |
| 25 | 25 | ||
| 26 | private TextView tvVersion; | 26 | private TextView tvVersion; |
| 27 | private TextView userInfo; | 27 | private TextView userInfo; |
| 28 | 28 | ||
| 29 | private Button btnLoginOrLogout; | 29 | private Button btnLoginOrLogout; |
| 30 | 30 | ||
| 31 | private String appId = "10022"; | 31 | private String appId = "10022"; |
| 32 | private String appKey = "93a27b0bd99bac3e68a440b48aa421ab"; | 32 | private String appKey = "93a27b0bd99bac3e68a440b48aa421ab"; |
| 33 | private String sessionKey; | 33 | private String sessionKey; |
| 34 | 34 | ||
| 35 | @Override | 35 | @Override |
| 36 | protected void onCreate(Bundle savedInstanceState) { | 36 | protected void onCreate(Bundle savedInstanceState) { |
| 37 | super.onCreate(savedInstanceState); | 37 | super.onCreate(savedInstanceState); |
| 38 | setContentView(R.layout.activity_main); | 38 | setContentView(R.layout.activity_main); |
| 39 | tvVersion = (TextView) findViewById(R.id.version); | 39 | tvVersion = (TextView) findViewById(R.id.version); |
| 40 | userInfo = (TextView) findViewById(R.id.user_info); | 40 | userInfo = (TextView) findViewById(R.id.user_info); |
| 41 | btnLoginOrLogout = (Button) findViewById(R.id.login_or_logout); | 41 | btnLoginOrLogout = (Button) findViewById(R.id.login_or_logout); |
| 42 | btnLoginOrLogout.setOnClickListener(new View.OnClickListener() { | 42 | btnLoginOrLogout.setOnClickListener(new View.OnClickListener() { |
| 43 | 43 | ||
| 44 | @Override | 44 | @Override |
| 45 | public void onClick(View v) { | 45 | public void onClick(View v) { |
| 46 | if (btnLoginOrLogout.getTag() == null || (Integer) btnLoginOrLogout.getTag() == 0) | 46 | if (btnLoginOrLogout.getTag() == null || (Integer) btnLoginOrLogout.getTag() == 0) |
| 47 | GumpSDK.start(MainActivity.this); | 47 | GumpSDK.start(MainActivity.this); |
| 48 | else | 48 | else |
| 49 | GumpSDK.logout(MainActivity.this); | 49 | GumpSDK.logout(MainActivity.this); |
| 50 | } | 50 | } |
| 51 | }); | 51 | }); |
| 52 | findViewById(R.id.pay).setOnClickListener(new View.OnClickListener() { | 52 | findViewById(R.id.pay).setOnClickListener(new View.OnClickListener() { |
| 53 | 53 | ||
| 54 | @Override | 54 | @Override |
| 55 | public void onClick(View v) { | 55 | public void onClick(View v) { |
| 56 | Bundle payInfo = new Bundle(); | 56 | Bundle payInfo = new Bundle(); |
| 57 | payInfo.putString("nick", "thi"); | 57 | payInfo.putString("nick", "thi"); |
| 58 | payInfo.putString("product", "元宝"); | 58 | payInfo.putString("product", "元宝"); |
| 59 | payInfo.putFloat("amount", 0.1f); | 59 | payInfo.putFloat("amount", 0.1f); |
| 60 | payInfo.putString("extraInfo", "This is demo!"); | 60 | payInfo.putString("extraInfo", "This is demo!"); |
| 61 | payInfo.putString("serverId", "100"); | 61 | payInfo.putString("serverId", "100"); |
| 62 | payInfo.putString("sessionKey", sessionKey); | 62 | payInfo.putString("sessionKey", sessionKey); |
| 63 | GumpSDK.pay(MainActivity.this, payInfo, MainActivity.this); | 63 | GumpSDK.pay(MainActivity.this, payInfo, MainActivity.this); |
| 64 | } | 64 | } |
| 65 | }); | 65 | }); |
| 66 | /** | 66 | /** |
| 67 | * 设置否是开启debug模式 | 67 | * 设置否是开启debug模式 |
| 68 | */ | 68 | */ |
| 69 | GumpSDK.setDebugState(true); | 69 | GumpSDK.setDebugState(false); |
| 70 | /** | 70 | /** |
| 71 | * 设置是否启用facebook登录 | 71 | * 设置是否启用facebook登录 |
| 72 | */ | 72 | */ |
| 73 | GumpSDK.setFBEnable(true); | 73 | GumpSDK.setFBEnable(true); |
| 74 | /** | 74 | /** |
| 75 | * 设置是否启用Vk登录 | 75 | * 设置是否启用Vk登录 |
| 76 | */ | 76 | */ |
| 77 | GumpSDK.setVKEnable(false); | 77 | GumpSDK.setVKEnable(false); |
| 78 | /** | 78 | /** |
| 79 | * 设置屏幕方向 | 79 | * 设置屏幕方向 |
| 80 | */ | 80 | */ |
| 81 | GumpSDK.setScreenLandscape(true); | 81 | GumpSDK.setScreenLandscape(true); |
| 82 | /** | 82 | /** |
| 83 | * 设置用户登录状态监听器 | 83 | * 设置用户登录状态监听器 |
| 84 | */ | 84 | */ |
| 85 | 85 | ||
| 86 | // GumpSDK.forceFBWithWeb(); | 86 | // GumpSDK.forceFBWithWeb(); |
| 87 | GumpSDK.setUserStateListener(new LoginStateListener() { | 87 | GumpSDK.setUserStateListener(new LoginStateListener() { |
| 88 | @Override | 88 | @Override |
| 89 | public void onLoginSuccess(GumpUser user) { | 89 | public void onLoginSuccess(GumpUser user) { |
| 90 | ClipboardManager cm = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); | 90 | ClipboardManager cm = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); |
| 91 | cm.setText(user.getSessionKey()); | 91 | cm.setText(user.getSessionKey()); |
| 92 | sessionKey = user.getSessionKey(); | 92 | sessionKey = user.getSessionKey(); |
| 93 | String userType=null; | 93 | String userType=null; |
| 94 | switch(user.getAccountType()){ | 94 | switch(user.getAccountType()){ |
| 95 | case GumpPreference.ACCOUNT_TYPE_FB: | 95 | case GumpPreference.ACCOUNT_TYPE_FB: |
| 96 | userType = "Facebook登录"; | 96 | userType = "Facebook登录"; |
| 97 | break; | 97 | break; |
| 98 | case GumpPreference.ACCOUNT_TYPE_QUICK_REG: | 98 | case GumpPreference.ACCOUNT_TYPE_QUICK_REG: |
| 99 | userType = "快速登录"; | 99 | userType = "快速登录"; |
| 100 | break; | 100 | break; |
| 101 | case GumpPreference.ACCOUNT_TYPE_REG: | 101 | case GumpPreference.ACCOUNT_TYPE_REG: |
| 102 | userType = "gump注册用户"; | 102 | userType = "gump注册用户"; |
| 103 | break; | 103 | break; |
| 104 | case GumpPreference.ACCOUNT_TYPE_VK: | 104 | case GumpPreference.ACCOUNT_TYPE_VK: |
| 105 | userType = "vk登录"; | 105 | userType = "vk登录"; |
| 106 | break; | 106 | break; |
| 107 | } | 107 | } |
| 108 | userInfo.setText(" Userid:" + user.getUid() + "\n accountType:(" + user.getAccountType()+") "+userType + "\n sessionKey:" + user.getSessionKey()); | 108 | userInfo.setText(" Userid:" + user.getUid() + "\n accountType:(" + user.getAccountType()+") "+userType + "\n sessionKey:" + user.getSessionKey()); |
| 109 | btnLoginOrLogout.setText("Logout"); | 109 | btnLoginOrLogout.setText("Logout"); |
| 110 | btnLoginOrLogout.setTag(1); | 110 | btnLoginOrLogout.setTag(1); |
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | @Override | 113 | @Override |
| 114 | public void onLoginFailed(int code, String msg) { | 114 | public void onLoginFailed(int code, String msg) { |
| 115 | userInfo.setText(msg); | 115 | userInfo.setText(msg); |
| 116 | Toast.makeText(MainActivity.this, "Login failed:code="+code+",message="+msg, Toast.LENGTH_SHORT).show(); | 116 | Toast.makeText(MainActivity.this, "Login failed:code="+code+",message="+msg, Toast.LENGTH_SHORT).show(); |
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | @Override | 119 | @Override |
| 120 | public void onLoginCanceled() { | 120 | public void onLoginCanceled() { |
| 121 | Toast.makeText(MainActivity.this, "operate be canceled", Toast.LENGTH_SHORT).show(); | 121 | Toast.makeText(MainActivity.this, "operate be canceled", Toast.LENGTH_SHORT).show(); |
| 122 | } | 122 | } |
| 123 | 123 | ||
| 124 | @Override | 124 | @Override |
| 125 | public void onLogout() { | 125 | public void onLogout() { |
| 126 | btnLoginOrLogout.setText("Login"); | 126 | btnLoginOrLogout.setText("Login"); |
| 127 | btnLoginOrLogout.setTag(0); | 127 | btnLoginOrLogout.setTag(0); |
| 128 | userInfo.setText("User is logout"); | 128 | userInfo.setText("User is logout"); |
| 129 | } | 129 | } |
| 130 | }); | 130 | }); |
| 131 | /** | 131 | /** |
| 132 | * 初始化sdk | 132 | * 初始化sdk |
| 133 | */ | 133 | */ |
| 134 | GumpSDK.init(getApplicationContext(), appId, appKey, "1000", new InitializeCallback() { | 134 | GumpSDK.init(getApplicationContext(), appId, appKey, "1000", new InitializeCallback() { |
| 135 | @Override | 135 | @Override |
| 136 | public void initComplete(int result) { | 136 | public void initComplete(int result) { |
| 137 | if (result == GumpSDK.CODE.OK) { | 137 | if (result == GumpSDK.CODE.OK) { |
| 138 | btnLoginOrLogout.setEnabled(true); | 138 | btnLoginOrLogout.setEnabled(true); |
| 139 | } | 139 | } |
| 140 | } | 140 | } |
| 141 | }); | 141 | }); |
| 142 | 142 | ||
| 143 | 143 | ||
| 144 | tvVersion.setText("SDK Version:" + GumpSDK.getVersion()); | 144 | tvVersion.setText("SDK Version:" + GumpSDK.getVersion()); |
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | @Override | 147 | @Override |
| 148 | public void onPurchaseCompleted(PurchaseResult result) { | 148 | public void onPurchaseCompleted(PurchaseResult result) { |
| 149 | Log.i(TAG,"purchase completed"); | 149 | Log.i(TAG,"purchase completed"); |
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | @Override | 152 | @Override |
| 153 | public void onPurchaseError(int code, String msg) { | 153 | public void onPurchaseError(int code, String msg) { |
| 154 | Log.i(TAG,"purchase error"); | 154 | Log.i(TAG,"purchase error"); |
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | @Override | 157 | @Override |
| 158 | public void onPurchaseCanceled() { | 158 | public void onPurchaseCanceled() { |
| 159 | Log.i(TAG,"purchase canceled"); | 159 | Log.i(TAG,"purchase canceled"); |
| 160 | } | 160 | } |
| 161 | } | 161 | } |
| 162 | 162 |