将支付相关的异常抛出,改为异常输出
This commit is contained in:
parent
9c38f40098
commit
eb9f615f70
@ -26,7 +26,7 @@ public class HwBuilder {
|
|||||||
Object invite = clz.getConstructor(Activity.class).newInstance(mActivity);
|
Object invite = clz.getConstructor(Activity.class).newInstance(mActivity);
|
||||||
invite.getClass().getMethod("pay", String.class).invoke(invite, changeid);
|
invite.getClass().getMethod("pay", String.class).invoke(invite, changeid);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ public class HwBuilder {
|
|||||||
Object invite = clz.getConstructor(Activity.class).newInstance(mActivity);
|
Object invite = clz.getConstructor(Activity.class).newInstance(mActivity);
|
||||||
invite.getClass().getMethod("consume").invoke(invite);
|
invite.getClass().getMethod("consume").invoke(invite);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,13 +49,13 @@ public class HwBuilder {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public JSONObject getPayResult(Intent intent) {
|
public JSONObject getPayResult(Intent intent) {
|
||||||
JSONObject object;
|
JSONObject object = null;
|
||||||
try {
|
try {
|
||||||
Class<?> clz = mActivity.getClassLoader().loadClass("com.shayu.lib_huawei.utils.HuaWeiPayManage");
|
Class<?> clz = mActivity.getClassLoader().loadClass("com.shayu.lib_huawei.utils.HuaWeiPayManage");
|
||||||
Object invite = clz.getConstructor(Activity.class).newInstance(mActivity);
|
Object invite = clz.getConstructor(Activity.class).newInstance(mActivity);
|
||||||
object = (JSONObject) invite.getClass().getMethod("getPayResult", Intent.class).invoke(invite, intent);
|
object = (JSONObject) invite.getClass().getMethod("getPayResult", Intent.class).invoke(invite, intent);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ public class GoogleUtils {
|
|||||||
googlePay = clz.getConstructor(Activity.class).newInstance(mActivity);
|
googlePay = clz.getConstructor(Activity.class).newInstance(mActivity);
|
||||||
flag = (boolean) googlePay.getClass().getMethod("getGoogleService").invoke(googlePay);
|
flag = (boolean) googlePay.getClass().getMethod("getGoogleService").invoke(googlePay);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
@ -87,13 +87,13 @@ public class GoogleUtils {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public JSONObject getLoginResult(Intent intent) {
|
public JSONObject getLoginResult(Intent intent) {
|
||||||
JSONObject object;
|
JSONObject object = null;
|
||||||
try {
|
try {
|
||||||
Class<?> clz = mActivity.getClassLoader().loadClass("com.shayu.lib_google.utils.GoogleManage");
|
Class<?> clz = mActivity.getClassLoader().loadClass("com.shayu.lib_google.utils.GoogleManage");
|
||||||
Object invite = clz.getConstructor(Activity.class).newInstance(mActivity);
|
Object invite = clz.getConstructor(Activity.class).newInstance(mActivity);
|
||||||
object = (JSONObject) invite.getClass().getMethod("getLoginResult", Intent.class).invoke(invite, intent);
|
object = (JSONObject) invite.getClass().getMethod("getLoginResult", Intent.class).invoke(invite, intent);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
@ -108,7 +108,7 @@ public class GoogleUtils {
|
|||||||
googlePay = clz.getConstructor(Activity.class).newInstance(mActivity);
|
googlePay = clz.getConstructor(Activity.class).newInstance(mActivity);
|
||||||
googlePay.getClass().getMethod("initGooglePay").invoke(googlePay);
|
googlePay.getClass().getMethod("initGooglePay").invoke(googlePay);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,7 +120,10 @@ public class GoogleUtils {
|
|||||||
Object invite = clz.getConstructor(Activity.class).newInstance(mActivity);
|
Object invite = clz.getConstructor(Activity.class).newInstance(mActivity);
|
||||||
adId = (String) invite.getClass().getMethod("getAdid").invoke(googlePay);
|
adId = (String) invite.getClass().getMethod("getAdid").invoke(googlePay);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
e.printStackTrace();
|
||||||
|
return "";
|
||||||
|
|
||||||
|
/*throw new RuntimeException(e);*/
|
||||||
}
|
}
|
||||||
return adId;
|
return adId;
|
||||||
}
|
}
|
||||||
@ -132,7 +135,7 @@ public class GoogleUtils {
|
|||||||
try {
|
try {
|
||||||
googlePay.getClass().getMethod("checkSku", String.class).invoke(googlePay, skuId);
|
googlePay.getClass().getMethod("checkSku", String.class).invoke(googlePay, skuId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,7 +150,7 @@ public class GoogleUtils {
|
|||||||
try {
|
try {
|
||||||
googlePay.getClass().getMethod("initResultCode").invoke(googlePay);
|
googlePay.getClass().getMethod("initResultCode").invoke(googlePay);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
timer = new Timer();
|
timer = new Timer();
|
||||||
@ -170,7 +173,7 @@ public class GoogleUtils {
|
|||||||
billingListener.onPayFailed(mActivity.getString(R.string.pay_fail));
|
billingListener.onPayFailed(mActivity.getString(R.string.pay_fail));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -183,7 +186,7 @@ public class GoogleUtils {
|
|||||||
Object invite = clz.getConstructor(Context.class).newInstance(context);
|
Object invite = clz.getConstructor(Context.class).newInstance(context);
|
||||||
invite.getClass().getMethod("initializeApp").invoke(invite);
|
invite.getClass().getMethod("initializeApp").invoke(invite);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,7 +204,7 @@ public class GoogleUtils {
|
|||||||
timer.cancel();
|
timer.cancel();
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -214,7 +217,7 @@ public class GoogleUtils {
|
|||||||
googlePay = clz.getConstructor(Activity.class).newInstance(activity);
|
googlePay = clz.getConstructor(Activity.class).newInstance(activity);
|
||||||
googlePay.getClass().getMethod("initToken").invoke(googlePay);
|
googlePay.getClass().getMethod("initToken").invoke(googlePay);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -224,7 +227,7 @@ public class GoogleUtils {
|
|||||||
googlePay = clz.getConstructor(Activity.class).newInstance(mActivity);
|
googlePay = clz.getConstructor(Activity.class).newInstance(mActivity);
|
||||||
googlePay.getClass().getMethod("consumeAll").invoke(googlePay);
|
googlePay.getClass().getMethod("consumeAll").invoke(googlePay);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,7 +240,7 @@ public class GoogleUtils {
|
|||||||
.getMethod("setFirebaseCrashData", String.class, String.class, String.class, String.class, String.class, String.class, String.class, String.class, String.class)
|
.getMethod("setFirebaseCrashData", String.class, String.class, String.class, String.class, String.class, String.class, String.class, String.class, String.class)
|
||||||
.invoke(googlePay, uid, userData, isGoogle, cpu, runTime, enterRoom, slidingRoom, playSvga, ActivitySize);
|
.invoke(googlePay, uid, userData, isGoogle, cpu, runTime, enterRoom, slidingRoom, playSvga, ActivitySize);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,7 +258,7 @@ public class GoogleUtils {
|
|||||||
timer.cancel();
|
timer.cancel();
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -135,7 +135,7 @@ public class GoogleBillingManage implements PurchasesUpdatedListener {
|
|||||||
object.put("orderList", orderList);
|
object.put("orderList", orderList);
|
||||||
object.put("tradeNo", tradeNo);
|
object.put("tradeNo", tradeNo);
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
throw new RuntimeException(e);
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
@ -196,11 +196,12 @@ public class GoogleBillingManage implements PurchasesUpdatedListener {
|
|||||||
try {
|
try {
|
||||||
return AdvertisingIdClient.getAdvertisingIdInfo(mContext).getId();
|
return AdvertisingIdClient.getAdvertisingIdInfo(mContext).getId();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
e.printStackTrace();
|
||||||
|
return "";
|
||||||
} catch (GooglePlayServicesNotAvailableException e) {
|
} catch (GooglePlayServicesNotAvailableException e) {
|
||||||
throw new RuntimeException(e);
|
e.printStackTrace(); return "";
|
||||||
} catch (GooglePlayServicesRepairableException e) {
|
} catch (GooglePlayServicesRepairableException e) {
|
||||||
throw new RuntimeException(e);
|
e.printStackTrace(); return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -221,7 +222,7 @@ public class GoogleBillingManage implements PurchasesUpdatedListener {
|
|||||||
object.put("resultToken", resultToken);
|
object.put("resultToken", resultToken);
|
||||||
object.put("resultOrderId", resultOrderId);
|
object.put("resultOrderId", resultOrderId);
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
throw new RuntimeException(e);
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ public class HuaWeiPayManage {
|
|||||||
object.put("inAppPurchaseData", purchaseResultInfo.getInAppPurchaseData());
|
object.put("inAppPurchaseData", purchaseResultInfo.getInAppPurchaseData());
|
||||||
object.put("inAppPurchaseDataSignature", purchaseResultInfo.getInAppDataSignature());
|
object.put("inAppPurchaseDataSignature", purchaseResultInfo.getInAppDataSignature());
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
throw new RuntimeException(e);
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
@ -136,14 +136,14 @@ public class MyWalletActivity extends AbsActivity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
throw new RuntimeException(e);
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
throw new RuntimeException(e);
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -491,7 +491,7 @@ public class MyWalletActivity extends AbsActivity {
|
|||||||
|
|
||||||
|
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
throw new RuntimeException(e);
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user