From 17ae4653958b0b351c6a2a0d3b96c9853eab42ac Mon Sep 17 00:00:00 2001 From: Max Lv Date: Sun, 16 Dec 2012 18:37:05 +0800 Subject: [PATCH] catch exceptions --- AndroidManifest.xml | 4 ++-- assets/local.js | 11 ++++++++--- pom.xml | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index b7a84c17..f14f04c3 100755 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="3" + android:versionName="1.0.2"> diff --git a/assets/local.js b/assets/local.js index 19cad5fe..cdb3937a 100644 --- a/assets/local.js +++ b/assets/local.js @@ -162,10 +162,10 @@ net = require("net"); - console.log("calculating ciphers"); - console.log = function() {}; + console.log("calculating ciphers"); + tables = getTable(KEY); encryptTable = tables[0]; @@ -189,8 +189,13 @@ if (stage === 5) { encrypt(encryptTable, data); // Android Patch - if (data == null || !remote.write(data)) { + try { + if (remote == null || !remote.write(data)) { + connection.pause(); + } + } catch (e) { connection.pause(); + console.warn("unexpected exception: " + e); } return; } diff --git a/pom.xml b/pom.xml index 9dd25894..a200a095 100755 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.github.shadowsocks shadowsocks - 1.0.1 + 1.0.2 apk Shadowsocks