Commit 1b1227b3bf825db11723447e3776b60ab4dda2ac
1 parent
bb06908ca0
Exists in
master
更新银联sdk到3.1.0,解决android5.0崩溃问题
Showing 10 changed files with 2 additions and 2 deletions Inline Diff
- InlandSDKDemo/src/com/gump/inland/sdk/demo/MainActivity.java
- InlandSDKRelease/libs/InlandSDK_v1.0.0_proguard.jar
- InlandSDKRelease/libs/InlandSDK_v1.0.1_proguard.jar
- InlandSDKRelease/libs/UPPayAssistEx.jar
- InlandSDKRelease/libs/UPPayPluginExStd.jar
- InlandSDKRelease/libs/arm64-v8a/libentryexstd.so
- InlandSDKRelease/libs/armeabi-v7a/libentryexstd.so
- InlandSDKRelease/libs/armeabi/libentryexstd.so
- InlandSDKRelease/libs/mips/libentryexstd.so
- InlandSDKRelease/libs/x86/libentryexstd.so
InlandSDKDemo/src/com/gump/inland/sdk/demo/MainActivity.java
| 1 | package com.gump.inland.sdk.demo; | 1 | package com.gump.inland.sdk.demo; |
| 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 | 10 | ||
| 11 | import com.gump.inland.gamesdk.InlandSDK; | 11 | import com.gump.inland.gamesdk.InlandSDK; |
| 12 | import com.gump.inland.gamesdk.InlandSDKCallback; | 12 | import com.gump.inland.gamesdk.InlandSDKCallback; |
| 13 | import com.gump.inland.gamesdk.InlandSDKException; | 13 | import com.gump.inland.gamesdk.InlandSDKException; |
| 14 | import com.gump.inland.gamesdk.bean.GumpUser; | 14 | import com.gump.inland.gamesdk.bean.GumpUser; |
| 15 | import com.gump.inland.gamesdk.bean.PayRequest; | 15 | import com.gump.inland.gamesdk.bean.PayRequest; |
| 16 | import com.gump.inland.gamesdk.callback.PurchaseCallback; | 16 | import com.gump.inland.gamesdk.callback.PurchaseCallback; |
| 17 | import com.gump.inland.gamesdk.passport.Passport; | 17 | import com.gump.inland.gamesdk.passport.Passport; |
| 18 | import com.ninjaonline.R; | 18 | import com.ninjaonline.R; |
| 19 | 19 | ||
| 20 | public class MainActivity extends Activity { | 20 | public class MainActivity extends Activity { |
| 21 | 21 | ||
| 22 | private static final String TAG = "MainActivity"; | 22 | private static final String TAG = "MainActivity"; |
| 23 | private TextView tvSDKInfo; | 23 | private TextView tvSDKInfo; |
| 24 | private TextView tvUserInfo; | 24 | private TextView tvUserInfo; |
| 25 | private TextView tvPurchaseResult; | 25 | private TextView tvPurchaseResult; |
| 26 | private Button btnLogin; | 26 | private Button btnLogin; |
| 27 | private Button btnPay; | 27 | private Button btnPay; |
| 28 | 28 | ||
| 29 | @Override | 29 | @Override |
| 30 | protected void onCreate(Bundle savedInstanceState) { | 30 | protected void onCreate(Bundle savedInstanceState) { |
| 31 | super.onCreate(savedInstanceState); | 31 | super.onCreate(savedInstanceState); |
| 32 | setContentView(R.layout.activity_main); | 32 | setContentView(R.layout.activity_main); |
| 33 | tvSDKInfo = (TextView) findViewById(R.id.sdk_info); | 33 | tvSDKInfo = (TextView) findViewById(R.id.sdk_info); |
| 34 | tvUserInfo = (TextView) findViewById(R.id.user_info); | 34 | tvUserInfo = (TextView) findViewById(R.id.user_info); |
| 35 | tvPurchaseResult = (TextView) findViewById(R.id.purchase_result); | 35 | tvPurchaseResult = (TextView) findViewById(R.id.purchase_result); |
| 36 | btnLogin = (Button) findViewById(R.id.login); | 36 | btnLogin = (Button) findViewById(R.id.login); |
| 37 | btnPay = (Button) findViewById(R.id.purchase); | 37 | btnPay = (Button) findViewById(R.id.purchase); |
| 38 | 38 | ||
| 39 | Log.d(TAG, "MainActivity onCreate"); | 39 | Log.d(TAG, "MainActivity onCreate"); |
| 40 | InlandSDK.setIsDebugEnable(true); | 40 | InlandSDK.setIsDebugEnable(false); |
| 41 | InlandSDK.setScreenLandscape(false); | 41 | InlandSDK.setScreenLandscape(false); |
| 42 | InlandSDK.initializeSDK("10000", "dkfjgljdlgjldjgl","1001"); | 42 | InlandSDK.initializeSDK("10000", "dkfjgljdlgjldjgl","1001"); |
| 43 | Passport.getInstance().registerCallback(new InlandSDKCallback<GumpUser>() { | 43 | Passport.getInstance().registerCallback(new InlandSDKCallback<GumpUser>() { |
| 44 | 44 | ||
| 45 | @Override | 45 | @Override |
| 46 | public void onSuccess(GumpUser result) { | 46 | public void onSuccess(GumpUser result) { |
| 47 | Log.d(TAG, "gumpUser:" + result.toString()); | 47 | Log.d(TAG, "gumpUser:" + result.toString()); |
| 48 | btnLogin.setVisibility(View.GONE); | 48 | btnLogin.setVisibility(View.GONE); |
| 49 | tvUserInfo.setText(formatUserInfo(result)); | 49 | tvUserInfo.setText(formatUserInfo(result)); |
| 50 | btnPay.setVisibility(View.VISIBLE); | 50 | btnPay.setVisibility(View.VISIBLE); |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | @Override | 53 | @Override |
| 54 | public void onError(InlandSDKException error) { | 54 | public void onError(InlandSDKException error) { |
| 55 | Log.d(TAG, "login error:" + error.getMessage()); | 55 | Log.d(TAG, "login error:" + error.getMessage()); |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | @Override | 58 | @Override |
| 59 | public void onCancel() { | 59 | public void onCancel() { |
| 60 | Log.d(TAG, "login be canceled"); | 60 | Log.d(TAG, "login be canceled"); |
| 61 | } | 61 | } |
| 62 | }); | 62 | }); |
| 63 | 63 | ||
| 64 | tvSDKInfo.setText(getSDKInfo()); | 64 | tvSDKInfo.setText(getSDKInfo()); |
| 65 | btnLogin.setOnClickListener(new View.OnClickListener() { | 65 | btnLogin.setOnClickListener(new View.OnClickListener() { |
| 66 | 66 | ||
| 67 | @Override | 67 | @Override |
| 68 | public void onClick(View v) { | 68 | public void onClick(View v) { |
| 69 | Passport.getInstance().login(MainActivity.this); | 69 | Passport.getInstance().login(MainActivity.this); |
| 70 | } | 70 | } |
| 71 | }); | 71 | }); |
| 72 | btnPay.setOnClickListener(new View.OnClickListener() { | 72 | btnPay.setOnClickListener(new View.OnClickListener() { |
| 73 | 73 | ||
| 74 | @Override | 74 | @Override |
| 75 | public void onClick(View v) { | 75 | public void onClick(View v) { |
| 76 | PayRequest payRequest = new PayRequest(); | 76 | PayRequest payRequest = new PayRequest(); |
| 77 | payRequest.setPrice(1); | 77 | payRequest.setPrice(1); |
| 78 | payRequest.setProduct("玄冥剑"); | 78 | payRequest.setProduct("玄冥剑"); |
| 79 | payRequest.setExtOrder("p100201508311730"); | 79 | payRequest.setExtOrder("p100201508311731"); |
| 80 | payRequest.setGumpUid(Passport.getInstance().getGumpUser().getUid()); | 80 | payRequest.setGumpUid(Passport.getInstance().getGumpUser().getUid()); |
| 81 | InlandSDK.purchase(MainActivity.this, payRequest, new PurchaseCallback() { | 81 | InlandSDK.purchase(MainActivity.this, payRequest, new PurchaseCallback() { |
| 82 | 82 | ||
| 83 | @Override | 83 | @Override |
| 84 | public void onPurchaseError(Exception e) { | 84 | public void onPurchaseError(Exception e) { |
| 85 | Log.w(TAG, "purchase error:" + e.getMessage()); | 85 | Log.w(TAG, "purchase error:" + e.getMessage()); |
| 86 | tvPurchaseResult.setText("purchase occured an error:" + e.getMessage()); | 86 | tvPurchaseResult.setText("purchase occured an error:" + e.getMessage()); |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | @Override | 89 | @Override |
| 90 | public void onPurchaseSuccess(String gumpTransId, String extOrder) { | 90 | public void onPurchaseSuccess(String gumpTransId, String extOrder) { |
| 91 | Log.d(TAG, "purchase success:" + gumpTransId + ",extorder:" + extOrder); | 91 | Log.d(TAG, "purchase success:" + gumpTransId + ",extorder:" + extOrder); |
| 92 | tvPurchaseResult.setText("purchase " + gumpTransId + " success,extorder:" + extOrder); | 92 | tvPurchaseResult.setText("purchase " + gumpTransId + " success,extorder:" + extOrder); |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | @Override | 95 | @Override |
| 96 | public void onPurchaseCanceled() { | 96 | public void onPurchaseCanceled() { |
| 97 | Log.d(TAG, "purchase be canceled"); | 97 | Log.d(TAG, "purchase be canceled"); |
| 98 | tvPurchaseResult.setText("purchase be canceled"); | 98 | tvPurchaseResult.setText("purchase be canceled"); |
| 99 | } | 99 | } |
| 100 | }); | 100 | }); |
| 101 | } | 101 | } |
| 102 | }); | 102 | }); |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | @Override | 105 | @Override |
| 106 | protected void onActivityResult(int requestCode, int resultCode, Intent data) { | 106 | protected void onActivityResult(int requestCode, int resultCode, Intent data) { |
| 107 | if (!InlandSDK.onActivityResult(requestCode, resultCode, data)) | 107 | if (!InlandSDK.onActivityResult(requestCode, resultCode, data)) |
| 108 | super.onActivityResult(requestCode, resultCode, data); | 108 | super.onActivityResult(requestCode, resultCode, data); |
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | private String getSDKInfo() { | 111 | private String getSDKInfo() { |
| 112 | StringBuilder str = new StringBuilder(); | 112 | StringBuilder str = new StringBuilder(); |
| 113 | str.append("SDK version:"); | 113 | str.append("SDK version:"); |
| 114 | str.append(InlandSDK.getVersion()); | 114 | str.append(InlandSDK.getVersion()); |
| 115 | str.append("\nappId:"); | 115 | str.append("\nappId:"); |
| 116 | str.append(InlandSDK.getAppId()); | 116 | str.append(InlandSDK.getAppId()); |
| 117 | str.append("\nappKey:"); | 117 | str.append("\nappKey:"); |
| 118 | str.append(InlandSDK.getAppKey()); | 118 | str.append(InlandSDK.getAppKey()); |
| 119 | return str.toString(); | 119 | return str.toString(); |
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | private String formatUserInfo(GumpUser user) { | 122 | private String formatUserInfo(GumpUser user) { |
| 123 | StringBuilder str = new StringBuilder(); | 123 | StringBuilder str = new StringBuilder(); |
| 124 | str.append("Logined User information:\n"); | 124 | str.append("Logined User information:\n"); |
| 125 | str.append("userId:" + user.getUid()); | 125 | str.append("userId:" + user.getUid()); |
| 126 | str.append("\nacccountType:" + user.getAccountType()); | 126 | str.append("\nacccountType:" + user.getAccountType()); |
| 127 | str.append("\nsessionKey:" + user.getSessionKey()); | 127 | str.append("\nsessionKey:" + user.getSessionKey()); |
| 128 | return str.toString(); | 128 | return str.toString(); |
| 129 | } | 129 | } |
| 130 | } | 130 | } |
| 131 | 131 |
InlandSDKRelease/libs/InlandSDK_v1.0.0_proguard.jar
No preview for this file type
InlandSDKRelease/libs/InlandSDK_v1.0.1_proguard.jar
No preview for this file type
InlandSDKRelease/libs/UPPayAssistEx.jar
No preview for this file type
InlandSDKRelease/libs/UPPayPluginExStd.jar
No preview for this file type
InlandSDKRelease/libs/arm64-v8a/libentryexstd.so
No preview for this file type
InlandSDKRelease/libs/armeabi-v7a/libentryexstd.so
No preview for this file type
InlandSDKRelease/libs/armeabi/libentryexstd.so
No preview for this file type
InlandSDKRelease/libs/mips/libentryexstd.so
No preview for this file type
InlandSDKRelease/libs/x86/libentryexstd.so
No preview for this file type