Skip to content

Commit 9c9b8f2

Browse files
committed
update proguard. clean log.
1 parent eca91b1 commit 9c9b8f2

File tree

5 files changed

+11
-19
lines changed

5 files changed

+11
-19
lines changed

app/proguard-rules.pro

+5-8
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,19 @@
33
-dontusemixedcaseclassnames
44
-dontskipnonpubliclibraryclasses
55
# -dontoptimize
6-
-dontpreverify
6+
# -dontpreverify
77
-verbose
88
-ignorewarning
99

10-
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/* #Confusion algorithm
11-
-optimizations !code/simplification/cast
10+
-optimizations !field/*, !class/merging/*
1211

1312
-allowaccessmodification
1413
-useuniqueclassmembernames
1514
-keepattributes *Annotation*,Exceptions,Signature,SourceFile,LineNumberTable,InnerClass,EnclosingMethod
16-
-dontwarn android.support.**
1715
-dontskipnonpubliclibraryclasses -dontskipnonpubliclibraryclassmembers
1816

19-
-dontwarn org.xbill.**
20-
-keep class com.proxy.shadowsocksr.** { *; }
17+
-keep class com.proxy.shadowsocksr.items.SSRProfile { *; }
18+
-keep class com.proxy.shadowsocksr.items.GlobalProfile { *; }
2119

2220
# 不混淆 下面类及其子类
2321
-keep public class * extends android.app.Fragment
@@ -45,7 +43,6 @@
4543
public static final android.os.Parcelable$Creator *;
4644
}
4745

48-
4946
#不混淆Serializable的子类
5047
-keepclassmembers class * implements java.io.Serializable {
5148
static final long serialVersionUID;
@@ -117,7 +114,7 @@
117114
}
118115

119116
# Keep GSON stuff
120-
-keep class sun.misc.Unsafe { *; }
117+
# -keep class sun.misc.Unsafe { *; }
121118
-keep class com.google.gson.** { *; }
122119

123120
# Application classes that will be serialized/deserialized over Gson

app/src/main/java/com/proxy/shadowsocksr/impl/UDPRelayServer.java

-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ public void stopUDPRelayServer()
131131
remoteChannel.connect(isaRemote);
132132
boolean isProtected = onNeedProtectUDPListener
133133
.onNeedProtectUDP(remoteChannel.socket());
134-
Log.e("EXC", isProtected ? "UDP PROTECTED" : "UDP PROTECT FAILED");
135134
if (isProtected)
136135
{
137136
handler = new UDPRemoteDataHandler(localAddress, remoteChannel);

app/src/main/java/com/proxy/shadowsocksr/impl/plugin/obfs/HttpSimpleObfs.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ public class HttpSimpleObfs extends AbsObfs
1414
public HttpSimpleObfs(String usrParamStr, String rmtIP, int rmtPort, int tcpMss)
1515
{
1616
super(usrParamStr, rmtIP, rmtPort, tcpMss);
17-
obfsParam = usrParamStr == null || usrParamStr.equals("") ? "mvnrepository.com" : usrParamStr;
17+
obfsParam = usrParamStr == null || usrParamStr.equals("") ? "mvnrepository.com" :
18+
usrParamStr;
1819
}
1920

2021
private boolean headSent = false;
@@ -30,7 +31,7 @@ public HttpSimpleObfs(String usrParamStr, String rmtIP, int rmtPort, int tcpMss)
3031
headSent = true;
3132
if (data.length > 64)
3233
{
33-
int headLen = Utils.randomInt(64)+1;
34+
int headLen = Utils.randomInt(64) + 1;
3435
byte[] out = encodeHead(Arrays.copyOfRange(data, 0, headLen));
3536
byte[] end = new byte[out.length + (data.length - headLen)];
3637
System.arraycopy(out, 0, end, 0, out.length);
@@ -64,17 +65,17 @@ private byte[] encodeHead(byte[] data)
6465
//
6566
headRecv = true;
6667
int pos = -1;
67-
int cnt = data.length - 5;
68+
int cnt = data.length - 4;
6869
// //TODO may be can...
69-
for (int i = 214; i < cnt; i++)
70+
for (int i = 219; i < cnt; i++)
7071
{
7172
if (data[i] == '\r' && data[i + 1] == '\n' &&
7273
data[i + 2] == '\r' && data[i + 3] == '\n')
7374
{
7475
pos = i + 4;
7576
}
7677
}
77-
if (pos == -1)
78+
if (pos == -1 || pos==data.length)
7879
{
7980
return new byte[0];
8081
}

app/src/main/java/com/proxy/shadowsocksr/impl/plugin/proto/AuthSimpleProtocol.java

-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ private int getHeadSize(byte[] buf, int dft)
8787
data = vsp.beforeEncrypt(data);
8888
byte[] out = new byte[firstPkg.length + data.length];
8989
System.arraycopy(firstPkg, 0, out, 0, firstPkg.length);
90-
Utils.bytesHexDmp("FP", firstPkg);
9190
System.arraycopy(data, 0, out, firstPkg.length, data.length);
9291
//
9392
return out;

app/src/main/java/com/proxy/shadowsocksr/impl/plugin/proto/VerifySimpleProtocol.java

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.proxy.shadowsocksr.impl.plugin.proto;
22

3-
import android.util.Log;
4-
53
import com.proxy.shadowsocksr.impl.Utils;
64

75
import java.nio.ByteBuffer;
@@ -73,7 +71,6 @@ private byte[] packData(byte[] data)
7371
{
7472
if (buf.length - i < 7)
7573
{
76-
Log.e("EXC", "TOO SHORT");
7774
tmpBytes = Arrays.copyOfRange(buf, i, buf.length);
7875
break;
7976
}
@@ -82,7 +79,6 @@ private byte[] packData(byte[] data)
8279
//
8380
if (len < 7 || len > 8191)
8481
{
85-
Log.e("EXC", "TOO LONG OR SHORT");
8682
return new byte[0];
8783
}
8884
//

0 commit comments

Comments
 (0)