WXPayEntryActivity.smali 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. .class public L${packageName}/wxapi/WXPayEntryActivity;
  2. .super Landroid/app/Activity;
  3. .source "WXPayEntryActivity.java"
  4. # interfaces
  5. .implements Lcom/tencent/mm/opensdk/openapi/IWXAPIEventHandler;
  6. # static fields
  7. .field private static final TAG:Ljava/lang/String;
  8. # instance fields
  9. .field private api:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
  10. # direct methods
  11. .method static constructor <clinit>()V
  12. .locals 1
  13. .line 20
  14. const-class v0, Lcom/jmhy/sdk/template/wxapi/WXPayEntryActivity;
  15. invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;
  16. move-result-object v0
  17. sput-object v0, Lcom/jmhy/sdk/template/wxapi/WXPayEntryActivity;->TAG:Ljava/lang/String;
  18. return-void
  19. .end method
  20. .method public constructor <init>()V
  21. .locals 0
  22. .line 19
  23. invoke-direct {p0}, Landroid/app/Activity;-><init>()V
  24. return-void
  25. .end method
  26. .method private sendPayResult(I)V
  27. .locals 3
  28. .param p1, "code" # I
  29. .line 52
  30. invoke-static {}, Lcom/jmhy/sdk/utils/thirdPlatform/WechatPlatform;->getPayListener()Lcom/jmhy/sdk/utils/thirdPlatform/PayListener;
  31. move-result-object v0
  32. .line 53
  33. .local v0, "listener":Lcom/jmhy/sdk/utils/thirdPlatform/PayListener;
  34. if-nez v0, :cond_0
  35. .line 54
  36. sget-object v1, Lcom/jmhy/sdk/template/wxapi/WXPayEntryActivity;->TAG:Ljava/lang/String;
  37. const-string v2, "onReq PayListener is null"
  38. invoke-static {v1, v2}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
  39. .line 55
  40. return-void
  41. .line 58
  42. :cond_0
  43. const/4 v1, -0x2
  44. if-eq p1, v1, :cond_2
  45. if-eqz p1, :cond_1
  46. .line 66
  47. invoke-interface {v0}, Lcom/jmhy/sdk/utils/thirdPlatform/PayListener;->onFailure()V
  48. goto :goto_0
  49. .line 60
  50. :cond_1
  51. invoke-interface {v0}, Lcom/jmhy/sdk/utils/thirdPlatform/PayListener;->onSuccess()V
  52. .line 61
  53. goto :goto_0
  54. .line 63
  55. :cond_2
  56. invoke-interface {v0}, Lcom/jmhy/sdk/utils/thirdPlatform/PayListener;->onCancel()V
  57. .line 64
  58. nop
  59. .line 68
  60. :goto_0
  61. return-void
  62. .end method
  63. # virtual methods
  64. .method public onCreate(Landroid/os/Bundle;)V
  65. .locals 2
  66. .param p1, "savedInstanceState" # Landroid/os/Bundle;
  67. .line 26
  68. invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V
  69. .line 28
  70. sget-object v0, Lcom/jmhy/sdk/utils/thirdPlatform/WechatPlatform;->WECHAT_APP_ID:Ljava/lang/String;
  71. invoke-static {p0, v0}, Lcom/tencent/mm/opensdk/openapi/WXAPIFactory;->createWXAPI(Landroid/content/Context;Ljava/lang/String;)Lcom/tencent/mm/opensdk/openapi/IWXAPI;
  72. move-result-object v0
  73. iput-object v0, p0, Lcom/jmhy/sdk/template/wxapi/WXPayEntryActivity;->api:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
  74. .line 29
  75. iget-object v0, p0, Lcom/jmhy/sdk/template/wxapi/WXPayEntryActivity;->api:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
  76. invoke-virtual {p0}, Lcom/jmhy/sdk/template/wxapi/WXPayEntryActivity;->getIntent()Landroid/content/Intent;
  77. move-result-object v1
  78. invoke-interface {v0, v1, p0}, Lcom/tencent/mm/opensdk/openapi/IWXAPI;->handleIntent(Landroid/content/Intent;Lcom/tencent/mm/opensdk/openapi/IWXAPIEventHandler;)Z
  79. .line 30
  80. return-void
  81. .end method
  82. .method protected onNewIntent(Landroid/content/Intent;)V
  83. .locals 1
  84. .param p1, "intent" # Landroid/content/Intent;
  85. .line 34
  86. invoke-super {p0, p1}, Landroid/app/Activity;->onNewIntent(Landroid/content/Intent;)V
  87. .line 35
  88. invoke-virtual {p0, p1}, Lcom/jmhy/sdk/template/wxapi/WXPayEntryActivity;->setIntent(Landroid/content/Intent;)V
  89. .line 36
  90. iget-object v0, p0, Lcom/jmhy/sdk/template/wxapi/WXPayEntryActivity;->api:Lcom/tencent/mm/opensdk/openapi/IWXAPI;
  91. invoke-interface {v0, p1, p0}, Lcom/tencent/mm/opensdk/openapi/IWXAPI;->handleIntent(Landroid/content/Intent;Lcom/tencent/mm/opensdk/openapi/IWXAPIEventHandler;)Z
  92. .line 37
  93. return-void
  94. .end method
  95. .method public onReq(Lcom/tencent/mm/opensdk/modelbase/BaseReq;)V
  96. .locals 3
  97. .param p1, "req" # Lcom/tencent/mm/opensdk/modelbase/BaseReq;
  98. .line 41
  99. sget-object v0, Lcom/jmhy/sdk/template/wxapi/WXPayEntryActivity;->TAG:Ljava/lang/String;
  100. new-instance v1, Ljava/lang/StringBuilder;
  101. invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
  102. const-string v2, "onReq req="
  103. invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  104. invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;
  105. move-result-object v2
  106. invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  107. invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  108. move-result-object v1
  109. invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
  110. .line 42
  111. return-void
  112. .end method
  113. .method public onResp(Lcom/tencent/mm/opensdk/modelbase/BaseResp;)V
  114. .locals 3
  115. .param p1, "resp" # Lcom/tencent/mm/opensdk/modelbase/BaseResp;
  116. .line 46
  117. sget-object v0, Lcom/jmhy/sdk/template/wxapi/WXPayEntryActivity;->TAG:Ljava/lang/String;
  118. new-instance v1, Ljava/lang/StringBuilder;
  119. invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
  120. const-string v2, "onResp errCode = "
  121. invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  122. iget v2, p1, Lcom/tencent/mm/opensdk/modelbase/BaseResp;->errCode:I
  123. invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
  124. const-string v2, ",resp.getType()="
  125. invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  126. invoke-virtual {p1}, Lcom/tencent/mm/opensdk/modelbase/BaseResp;->getType()I
  127. move-result v2
  128. invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
  129. invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
  130. move-result-object v1
  131. invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
  132. .line 47
  133. iget v0, p1, Lcom/tencent/mm/opensdk/modelbase/BaseResp;->errCode:I
  134. invoke-direct {p0, v0}, Lcom/jmhy/sdk/template/wxapi/WXPayEntryActivity;->sendPayResult(I)V
  135. .line 48
  136. invoke-virtual {p0}, Lcom/jmhy/sdk/template/wxapi/WXPayEntryActivity;->finish()V
  137. .line 49
  138. return-void
  139. .end method