{"id":17,"date":"2014-01-13T16:29:53","date_gmt":"2014-01-13T08:29:53","guid":{"rendered":"http:\/\/xiaoding.org\/?p=17"},"modified":"2014-01-13T16:29:53","modified_gmt":"2014-01-13T08:29:53","slug":"12306%e6%89%8b%e6%9c%ba%e7%89%88app%e9%80%86%e5%90%91%e7%a0%94%e7%a9%b6","status":"publish","type":"post","link":"https:\/\/xiaoding.org\/?p=17","title":{"rendered":"12306\u624b\u673a\u7248App\u9006\u5411\u7814\u7a76"},"content":{"rendered":"<p>\u62bd\u7a7a\u7814\u7a76\u4e86\u4e00\u4e0b 12306 \u653e\u51fa\u7684 Android \u7248\u624b\u673a App\uff0c\u672c\u60f3\u6316\u4e00\u6316\u6709\u6ca1\u6709\u624b\u673a\u7248\u534f\u8bae\u53ef\u4f9b\u8c03\u7528\uff0c\u4e0d\u8fc7\u5c31\u7ed3\u679c\u6765\u770b\u610f\u4e49\u5df2\u7ecf\u4e0d\u5927\u3002\u4ee5\u4e0b\u7b80\u5355\u8bb0\u4e00\u4e0b\u8fc7\u7a0b\u3002<\/p>\n<p>12306 \u7684 apk \u5b89\u88c5\u5305\u53ef\u4ee5\u7528 WinRAR \u6253\u5f00\uff0c\u89e3\u538b\u51fa classes.dex\uff0c\u7136\u540e\u7528<a href=\"http:\/\/code.google.com\/p\/dex2jar\/\" target=\"_blank\"> dex2jar<\/a> \u8f6c\u6362\u6210 jar \u5305\uff0c\u5c31\u53ef\u4ee5\u653e\u5230 <a href=\"http:\/\/jd.benow.ca\/\" target=\"_blank\">jd-gui<\/a> \u91cc\u770b java \u6e90\u4ee3\u7801\u4e86\uff0c\u6e90\u4ee3\u7801\u672a\u7ecf\u6df7\u6dc6\uff0c\u770b\u8d77\u6765\u5341\u5206\u65b9\u4fbf\u3002<\/p>\n<p>\u5728 jd-gui \u91cc\u53ef\u4ee5\u770b\u5230\u6709\u597d\u51e0\u4e2a java package\uff0ccn.domob \u8fd9\u4e2a\u5305\u662f\u591a\u76df\u7684\u5e7f\u544a\u8054\u76df\u4ee3\u7801\uff0c12306 App \u7684\u754c\u9762\u4e0a\u672a\u89c1\u5230\u6709\u5e7f\u544a\uff0c\u4f30\u8ba1\u662f\u7528\u6765\u505a\u7edf\u8ba1\u5206\u6790\u7684\u3002\u6709 com.worklight \u8fd9\u4e2a\u5305\uff0c\u53ef\u4ee5\u8bc1\u660e\u662f\u7528\u4e86 IBM Worklight \u8fd9\u4e2a\u6846\u67b6\u3002\u771f\u6b63\u5b9e\u6253\u5b9e\u6709\u5185\u5bb9\u7684\u5c31\u662f com.MobileTicket \u8fd9\u4e00\u4e2a\u5305\uff0c\u5176\u5b83\u7684\u90fd\u662f\u5f15\u5165\u7684\u5e93\uff0c\u5e76\u975e 12306 \u76f8\u5173\u7684\u7a0b\u5e8f\u4ee3\u7801\u3002\u9605\u8bfb\u5165\u53e3\u7c7b MobileTicket.class \u7684\u4ee3\u7801\uff0c\u53ef\u4ee5\u53d1\u73b0\u5176\u8c03\u7528\u4e86\u672c\u5730\u7684\u6d4f\u89c8\u5668\u663e\u793a\u4e00\u4e2a\u7f51\u9875\u3002\u4e5f\u5c31\u662f\u8bf4\uff1a12306 App \u7684\u4e3b\u754c\u9762\u5176\u5b9e\u662f\u7531\u7f51\u9875\u7ec4\u6210\u7684\uff0c\u6574\u4e2a\u7a0b\u5e8f\u7684\u903b\u8f91\u5b9e\u73b0\u4e5f\u90fd\u653e\u5728\u7f51\u9875\u91cc\u4e86\uff0cjava \u6e90\u4ee3\u7801\u7684\u5e72\u8d27\u5176\u5b9e\u5f88\u5c11\u3002<\/p>\n<pre class=\"lang:java decode:true \" title=\"MobileTicket\u7c7b\u521d\u59cb\u5316\u76f8\u5173\u4ee3\u7801\">  protected void bindBrowser(CordovaWebView paramCordovaWebView, boolean paramBoolean)\r\n  {\r\n    super.bindBrowser(paramCordovaWebView, paramBoolean);\r\n    mDService = new DService(this, \"56OJyf1IuNPVnYbzz4\", \"16TLwHboApIGwNU-ypi0ThBk\");\r\n    mDViewManager = new DViewManager(this, mDService);\r\n    mDViewManager.doAppStartReport();\r\n    paramCordovaWebView.pluginManager.addService(\"WebResourcesDownloader\", \"com.worklight.androidgap.plugin.SSLWebResourcesDownloaderPlugin\");\r\n    paramCordovaWebView.pluginManager.addService(\"NativeBusyIndicator\", \"com.worklight.androidgap.plugin.MyBusyIndicator\");\r\n  }\r\n\r\n  public void init()\r\n  {\r\n    SSLWLWebView localSSLWLWebView = new SSLWLWebView(this);\r\n    if (Build.VERSION.SDK_INT &lt; 11) {}\r\n    for (Object localObject = new CordovaWebViewClient(this, localSSLWLWebView);; localObject = new IceCreamCordovaWebViewClient(this, localSSLWLWebView))\r\n    {\r\n      super.init(localSSLWLWebView, (CordovaWebViewClient)localObject, new CordovaChromeClient(this, localSSLWLWebView));\r\n      return;\r\n    }\r\n  }<\/pre>\n<p>\u77e5\u9053\u662f\u600e\u4e48\u56de\u4e8b\uff0c\u5c31\u5f97\u63d0\u53d6\u7f51\u9875\u8d44\u6e90\u4e86\u3002apk \u5b89\u88c5\u5305\u4e2d\u7684 assets\/www \u76ee\u5f55\u91cc\u6709\u4e24\u4e2a resources.zip \u6587\u4ef6\uff0c\u4f46\u4f3c\u4e4e\u7ecf\u8fc7\u7279\u6b8a\u5904\u7406\uff0c\u76f4\u63a5\u7528 WinRAR \u89e3\u538b\u7f29\u65e0\u6cd5\u6253\u5f00\u3002\u53e6\u8f9f\u595a\u5f84\uff0c\u628a\u624b\u673a\u7a0b\u5e8f\u5b89\u88c5\u5230 Android \u624b\u673a\u91cc\uff08\u6a21\u62df\u5668\u4e5f\u884c\uff09\uff0c\u7136\u540e\u7528\u624b\u673a\u6587\u4ef6\u7ba1\u7406\u5668\u6253\u5f00 \/data\/data\/com.MobileTicket \u8fd9\u4e2a\u6570\u636e\u76ee\u5f55\uff0c\u5c31\u80fd\u770b\u5230\u7a0b\u5e8f\u4f7f\u7528\u7684\u5173\u952e\u6570\u636e\u4e86\u3002\u7f51\u9875\u5c31\u5b58\u5728 files\/www\/default \u8fd9\u91cc\u3002<\/p>\n<p>\u770b\u4e86\u770b\u4ee3\u7801\uff0c\u662f\u57fa\u4e8e worklight \u6846\u67b6\u7528 MVC \u7684\u65b9\u5f0f\u5b9e\u73b0\u7684\uff0cview \u90fd\u662f html \u7f51\u9875\uff0cjs \u6765\u5b9e\u73b0 model \u548c controller\uff0c12306 \u7684\u7a0b\u5e8f\u733f\u5f88\u539a\u9053\uff0cjs \u90fd\u6ca1\u6709\u6df7\u6dc6\uff0c\u8fde\u4e2d\u6587\u6ce8\u91ca\u90fd\u5728\uff0c\u8bfb\u8d77\u6765\u5341\u5206\u65b9\u4fbf\uff0c\u563f\u563f\u3002\u6bd4\u8f83\u5173\u952e\u7684\u6709 MobileTicket.js util.js \u8fd8\u6709 controller \u76ee\u5f55\u91cc\u7684\u5404\u4e2a js\uff0c\u770b\u770b\u6587\u4ef6\u540d\u5c31\u77e5\u9053\u662f\u7528\u6765\u5e72\u4ec0\u4e48\u7684\u5f88\u597d\u8bfb\u3002<\/p>\n<p>\u8fd9\u91cc\u6709\u4e00\u4e2a\u6bd4\u8f83\u5173\u952e\u7684 CheckCodePlugin\uff08\u6b64 check code \u5e76\u975e\u6211\u4eec\u770b\u5230\u7684\u56db\u4f4d\u9a8c\u8bc1\u7801\uff0c\u800c\u662f\u8bf7\u6c42\u91cc\u81ea\u5e26\u7684\u4e00\u4e2a\u53c2\u6570\uff09\uff0c\u901a\u8fc7\u7f51\u7edc\u6293\u5305\u4e5f\u4f1a\u53d1\u73b0\u6bcf\u6b21\u90fd\u4f1a\u63d0\u4ea4\u4e00\u4e2a\u8bf7\u6c42\u7684\u53c2\u6570\u662fcheck_code\uff0c\u800c\u8fd9\u4e2a\u4e1c\u4e1c\u5b9e\u73b0\u4e0a\u8c8c\u4f3c\u662f\u7531 libcheckcode.so \u8fd9\u4e2a native \u5e93\u6765\u5b9e\u73b0\u7684\uff08CheckCodePlugin.js \u4e2d\u6709\u4e00\u4efd\u8c03\u8bd5\u7248\u672c\uff0c\u4f46\u672a\u53ef\u77e5\u8c03\u8bd5\u7248\u672c\u4e0e\u5b9e\u73b0\u7248\u672c\u6709\u4f55\u4e0d\u540c\uff09\u3002\u628a libcheckcode.so \u653e\u5230 IDA Pro \u91cc\u8fdb\u884c\u53cd\u6c47\u7f16\u5206\u6790\uff0c\u5728\u5bfc\u51fa\u8868\u4e2d\u80fd\u770b\u5230 main, MD5_Init, MD5_Update \u7b49\u51e0\u4e2a\u6a21\u5757\uff0c\u770b\u4e86\u770b\u6c47\u7f16\u4ee3\u7801\uff0c\u4e5f\u5c31\u662f\u7b80\u5355\u5730\u505a\u4e86\u4e2a MD5 Hash\uff0c\u770b\u6765 libcheckcode.so \u4e0e js \u7684\u884c\u4e3a\u5e94\u8be5\u662f\u4e00\u81f4\u7684\u3002\u5f88\u597d\u5947\u4e3a\u4ec0\u4e48\u505a MD5 \u8fd9\u6d3b\u513f\u975e\u8981\u7528\u4e00\u4e2a native \u7684\u5e93\u6765\u5b8c\u6210\uff0c\u4e3a\u4e86\u6545\u5f04\u7384\u865a\uff1f\u4e5f\u8bb8\u662f\u4e3a\u4e86\u4fdd\u5bc6\u6216\u8005\u51c6\u5907\u4ee5\u540e\u6362\u6210\u66f4\u590d\u6742\u7684 checkcode \u7b97\u6cd5\u3002<\/p>\n<p>\u5173\u4e8e\u6293\u5305\uff0c12306 App \u9700\u8981\u8bfb\u53d6\u672c\u5730\u7f51\u9875\uff0c\u5355\u7eaf\u7ed9 Android \u8bbe\u7f6e\u7cfb\u7edf\u7ea7\u4ee3\u7406\u7136\u540e\u5728 PC \u4e0a\u7528 Fiddler \u6293\u5305\u7684\u8bdd\uff0c\u6253\u5f00\u7a0b\u5e8f\u4fbf\u4f1a\u8df3\u51fa\u9519\u8bef\uff0c\u56e0\u4e3a\u65e0\u6cd5\u8bfb\u53d6\u672c\u5730\u7684 file:\/\/\/ \u5f00\u5934\u7684 URL \uff08\u5176\u5b9e\u5c31\u662f\u672c\u5730\u7f51\u9875\uff09\u3002\u5982\u6b64\uff0c\u9700\u8981\u7528 ProxyDroid \u8fd9\u6837\u7684\u4ee3\u7406 App\uff0c\u4f7f\u4e4b\u5ffd\u7565\u6389 localhost \u548c intranet address\uff0c\u7136\u540e\u5728 Fiddler \u4e2d\u542f\u7528 HTTPS \u5206\u6790\uff0c\u5c31\u53ef\u4ee5\u8f7b\u677e\u6293\u5230 12306 \u624b\u673a App \u7684\u534f\u8bae\u3002<\/p>\n<p>\u534f\u8bae\u4e2d\u6700\u5f00\u59cb\u6709 IBM Worklight \u6846\u67b6\u81ea\u5e26\u7684\u9a8c\u8bc1\u8fc7\u7a0b\uff0c\u7531\u4e8e\u6b64\u9a8c\u8bc1\u8fc7\u7a0b\u7531 Worklight \u6846\u67b6\u5b9e\u73b0\uff0c\u5206\u6790\u8d77\u6765\u8f83\u4e3a\u590d\u6742\u3002App \u91cc\u7528\u5230\u4e86\u00a0wl_antiXSRFRealm\uff0cwl_deviceNoProvisioningRealm \u548c\u00a0wl_authenticityRealm\uff0c\u8fd9\u4e9b\u5b9e\u73b0\u90fd\u53ef\u4ee5\u5728 apk java \u6e90\u4ee3\u7801\u7684\u00a0com.worklight.wlclient.challengehandler \u5305\u4e2d\u627e\u5230\u3002<\/p>\n<p>\u4ee5\u4e0a\u662f\u4e3b\u8981\u7684\u7814\u7a76\u5fc3\u5f97\u3002\u6700\u5f00\u59cb\u4ee5\u4e3a libcheckcode.so \u662f\u7528\u6765\u751f\u6210\u56fe\u7247\u9a8c\u8bc1\u7801\u7684\uff0c\u8fd9\u6837 12306 App \u5b9e\u9645\u4e0a\u4e0d\u9700\u8981\u4ece\u670d\u52a1\u5668\u53d6\u5f97\u9a8c\u8bc1\u7801\uff0c\u800c\u662f\u5728\u672c\u5730\u5b8c\u6210\uff0c\u6ca1\u60f3\u5230\u8fd9\u4e2a\u731c\u6d4b\u662f\u9519\u8bef\u7684\u3002\u5b9e\u9645\u4e0a App \u4ecd\u7136\u8981\u4ece\u670d\u52a1\u5668\u8bf7\u6c42\u9a8c\u8bc1\u7801\uff0c\u8fd9\u4e00\u6d41\u7a0b\u5728 orderManager.js \u4e2d\u53ef\u4ee5\u770b\u5230 refreshCaptcha() \u5373\u662f\u3002\u603b\u7ed3\u4e00\u4e0b\uff0c\u624b\u673a\u534f\u8bae\u7684\u4f18\u52bf\u662f\u9a8c\u8bc1\u7801\u7b80\u5355\u5bb9\u6613\u7834\u89e3\uff0c\u4f46\u662f\u4ee3\u4ef7\u662f worklight \u6846\u67b6\u590d\u6742\uff0c\u521d\u59cb\u9a8c\u8bc1\u8fc7\u7a0b\u4e0d\u597d\u6a21\u62df\uff0c\u4e14\u5bb9\u6613\u88ab\u670d\u52a1\u5668\u7aef\u7684\u534f\u8bae\u5347\u7ea7\u6240\u53cd\u5236\uff0c\u5199\u4e00\u4e2a\u624b\u673a\u534f\u8bae\u7684\u5237\u7968\u8f6f\u4ef6\u4ecd\u7136\u662f\u5341\u5206\u8d39\u529b\u4e14\u4e0d\u8ba8\u597d\u7684\u4e8b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u62bd\u7a7a\u7814\u7a76\u4e86\u4e00\u4e0b 12306 \u653e\u51fa\u7684 Android \u7248\u624b\u673a App\uff0c\u672c\u60f3\u6316\u4e00\u6316\u6709\u6ca1\u6709\u624b\u673a\u7248\u534f\u8bae\u53ef\u4f9b\u8c03\u7528\uff0c\u4e0d\u8fc7\u5c31 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/xiaoding.org\/?p=17\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201c12306\u624b\u673a\u7248App\u9006\u5411\u7814\u7a76\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[3,4],"class_list":["post-17","post","type-post","status-publish","format-standard","hentry","category-tech-misc","tag-3","tag-4"],"_links":{"self":[{"href":"https:\/\/xiaoding.org\/index.php?rest_route=\/wp\/v2\/posts\/17","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xiaoding.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xiaoding.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xiaoding.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xiaoding.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17"}],"version-history":[{"count":0,"href":"https:\/\/xiaoding.org\/index.php?rest_route=\/wp\/v2\/posts\/17\/revisions"}],"wp:attachment":[{"href":"https:\/\/xiaoding.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xiaoding.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xiaoding.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}