Skip to content

Commit

Permalink
Merge branch 'release/1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken committed Jun 6, 2015
2 parents 8f8c9c7 + b9721b5 commit 804adfe
Show file tree
Hide file tree
Showing 13 changed files with 244 additions and 3,798 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
v1.2.0 (2015-6-07)
-----------
* Change: json instead of realm for profile store
* Change: Remove libsuperuser


v1.1.7 (2015-5-22)
-----------
* Change: Remove snackbar action
Expand Down
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,38 @@ A [xsocks](https://github.com/lparam/xsocks) client for Android.
* JDK 1.8+
* Android SDK r22+
* Android NDK r9+
* Android Studio 1.0+
* Android Studio 1.0+ (optional)

### BUILD

* Set environment variable `ANDROID_HOME`
* Set environment variable `ANDROID_NDK_HOME`
* Create your key following the instructions at http://developer.android.com/guide/publishing/app-signing.html#cert
* Create your sign.gradle file like this
```bash
android {
signingConfigs {
release {
storeFile file('/home/user/keystore/android.key')
storePassword "password"
keyAlias 'Android App Key'
keyPassword "password"
}
}
}
```
* Build native binaries
```bash
git submodule update --init
make
```

#### Gradle Build
```bash
gradle clean assembleRelease
```

#### Android Studio
* Import the project in Android Studio
* Make Project in Android Studio

Expand Down
20 changes: 14 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,23 @@ android {
applicationId "io.github.xsocks"
minSdkVersion 18
targetSdkVersion 22
versionCode 117
versionName '1.1.7'
versionCode 120
versionName '1.2.0'
}
lintOptions {
abortOnError true
disable 'MissingTranslation'
}
buildTypes {
release {
signingConfig signingConfigs.release
try {
signingConfig signingConfigs.release
} catch (ex) {
logger.error('signing error: ' + ex)
}
zipAlignEnabled true
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
applicationVariants.all { variant ->
Expand All @@ -43,6 +48,11 @@ android {
}
productFlavors {
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}

def appendVersionNameVersionCode(variant, output, defaultConfig) {
Expand All @@ -56,16 +66,14 @@ def appendVersionNameVersionCode(variant, output, defaultConfig) {

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'io.reactivex:rxjava:1.0.10'
compile 'io.reactivex:rxandroid:0.24.0'
compile 'io.reactivex:rxjava-async-util:0.21.0'
compile 'eu.chainfire:libsuperuser:1.0.0.201504231659'
compile('com.mikepenz.materialdrawer:library:2.9.7@aar') {
transitive = true
}
compile 'com.nispok:snackbar:2.10.8'
compile 'io.realm:realm-android:0.80.2'
compile 'commons-net:commons-net:3.3'
compile 'dnsjava:dnsjava:2.1.7'
compile 'com.google.code.gson:gson:2.3.1'
Expand Down
32 changes: 9 additions & 23 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /home/lparam/android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# realm
-keepnames public class * extends io.realm.RealmObject
-keep class io.realm.** { *; }
-dontwarn javax.**
-dontwarn io.realm.**

# retrolambda
-dontwarn java.lang.invoke.*
Expand All @@ -30,3 +7,12 @@

# rxjava
-dontwarn rx.internal.util.unsafe.*

# snackbar
-dontwarn com.nispok.snackbar.*

# materialdrawer
-dontwarn com.mikepenz.materialdrawer.*

# iconics
-dontwarn com.mikepenz.iconics.*
Original file line number Diff line number Diff line change
@@ -1,105 +1,117 @@
package io.github.xsocks.database;
package io.github.xsocks.model;

import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;
import io.realm.annotations.RealmClass;
import com.google.gson.annotations.SerializedName;

@RealmClass
public class Profile extends RealmObject {
@PrimaryKey
public class Profile {
@SerializedName("id")
private int id = 0;
@SerializedName("name")
private String name = "Untitled";
@SerializedName("host")
private String host = "";
@SerializedName("localPort")
private int localPort = 1080;
@SerializedName("remotePort")
private int remotePort = 1073;
@SerializedName("password")
private String password = "";
@SerializedName("route")
private String route = "all";
@SerializedName("global")
private boolean global = true;
@SerializedName("bypass")
private boolean bypass = false;
@SerializedName("udpdns")
private boolean udpdns = false;
private String individual = "";

public int getId() { return this.id; }
public void setId(int id) {
this.id = id;
}

public void setId(final int id) { this.id = id; }
public void setName(String name) {
this.name = name;
}

public String getName() {
return name;
public void setHost(String host) {
this.host = host;
}

public void setName(final String name) {
this.name = name;
public void setLocalPort(int localPort) {
this.localPort = localPort;
}

public String getHost() {
return host;
public void setRemotePort(int remotePort) {
this.remotePort = remotePort;
}

public void setHost(String host) {
this.host = host;
public void setPassword(String password) {
this.password = password;
}

public int getLocalPort() {
return localPort;
public void setRoute(String route) {
this.route = route;
}

public void setLocalPort(int localPort) {
this.localPort = localPort;
public void setGlobal(boolean global) {
this.global = global;
}

public int getRemotePort() {
return remotePort;
public void setBypass(boolean bypass) {
this.bypass = bypass;
}

public void setRemotePort(int remotePort) {
this.remotePort = remotePort;
public void setUdpdns(boolean udpdns) {
this.udpdns = udpdns;
}

public String getPassword() {
return password;
public int getId() {
return this.id;
}

public void setPassword(String password) {
this.password = password;
public String getName() {
return this.name;
}

public String getRoute() {
return route;
public String getHost() {
return this.host;
}

public void setRoute(String route) {
this.route = route;
public int getLocalPort() {
return localPort;
}

public boolean isGlobal() {
return global;
public int getRemotePort() {
return remotePort;
}

public void setGlobal(boolean global) {
this.global = global;
public String getPassword() {
return password;
}

public boolean isBypass() {
return bypass;
public String getRoute() {
return route;
}

public void setBypass(boolean bypass) {
this.bypass = bypass;
public boolean isGlobal() {
return global;
}

public boolean isBypass() {
return bypass;
}

public boolean isUdpdns() {
return udpdns;
}

public void setUdpdns(boolean udpdns) {
this.udpdns = udpdns;
public void setIndividual(String individual) {
this.individual = individual;
}

public String getIndividual() {

return individual;
}

public void setIndividual(String individual) {
this.individual = individual;
}
}
51 changes: 51 additions & 0 deletions app/src/main/java/io/github/xsocks/model/Profiles.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package io.github.xsocks.model;

import com.google.gson.annotations.SerializedName;

import java.util.ArrayList;
import java.util.List;

public class Profiles {
@SerializedName("profiles")
private List<Profile> profiles;

public List<Profile> getProfiles() {
return profiles;
}

public Profiles() {
profiles = new ArrayList<>();
}

public void remove(int id) {
for (Profile p : profiles) {
if (p.getId() == id) {
profiles.remove(p);
break;
}
}
}

public Profile getProfile(int id) {
for (Profile p : profiles) {
if (p.getId() == id) {
return p;
}
}
return null;
}

public int getMaxId() {
int max = 0;
for (Profile p : profiles) {
if (p.getId() > max) {
max = p.getId();
}
}
return max;
}

public void addProfile(Profile profile) {
profiles.add(profile);
}
}
Loading

0 comments on commit 804adfe

Please sign in to comment.