Commit 17ae4653 authored by Max Lv's avatar Max Lv

catch exceptions

parent ce3575fa
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.github.shadowsocks" package="com.github.shadowsocks"
android:installLocation="auto" android:installLocation="auto"
android:versionCode="2" android:versionCode="3"
android:versionName="1.0.1"> android:versionName="1.0.2">
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
......
...@@ -162,10 +162,10 @@ ...@@ -162,10 +162,10 @@
net = require("net"); net = require("net");
console.log("calculating ciphers");
console.log = function() {}; console.log = function() {};
console.log("calculating ciphers");
tables = getTable(KEY); tables = getTable(KEY);
encryptTable = tables[0]; encryptTable = tables[0];
...@@ -189,8 +189,13 @@ ...@@ -189,8 +189,13 @@
if (stage === 5) { if (stage === 5) {
encrypt(encryptTable, data); encrypt(encryptTable, data);
// Android Patch // Android Patch
if (data == null || !remote.write(data)) { try {
if (remote == null || !remote.write(data)) {
connection.pause();
}
} catch (e) {
connection.pause(); connection.pause();
console.warn("unexpected exception: " + e);
} }
return; return;
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.github.shadowsocks</groupId> <groupId>com.github.shadowsocks</groupId>
<artifactId>shadowsocks</artifactId> <artifactId>shadowsocks</artifactId>
<version>1.0.1</version> <version>1.0.2</version>
<packaging>apk</packaging> <packaging>apk</packaging>
<name>Shadowsocks</name> <name>Shadowsocks</name>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment