remove unified preference
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
package com.github.shadowsocks.aidl;
|
||||
|
||||
parcelable Config;
|
||||
@@ -1,88 +0,0 @@
|
||||
package com.github.shadowsocks.aidl;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
public class Config implements Parcelable {
|
||||
|
||||
public boolean isGlobalProxy = true;
|
||||
public boolean isGFWList = true;
|
||||
public boolean isBypassApps = false;
|
||||
public boolean isTrafficStat = false;
|
||||
public boolean isUdpDns = false;
|
||||
|
||||
public String profileName = "Untitled";
|
||||
public String proxy = "127.0.0.1";
|
||||
public String sitekey = "null";
|
||||
|
||||
public String encMethod = "rc4";
|
||||
public String proxiedAppString = "";
|
||||
|
||||
public int remotePort = 1984;
|
||||
public int localPort = 1080;
|
||||
|
||||
public static final Parcelable.Creator<Config> CREATOR = new Parcelable.Creator<Config>() {
|
||||
public Config createFromParcel(Parcel in) {
|
||||
return new Config(in);
|
||||
}
|
||||
|
||||
public Config[] newArray(int size) {
|
||||
return new Config[size];
|
||||
}
|
||||
};
|
||||
|
||||
public Config(boolean isGlobalProxy, boolean isGFWList, boolean isBypassApps,
|
||||
boolean isTrafficStat, boolean isUdpDns, String profileName, String proxy, String sitekey,
|
||||
String encMethod, String proxiedAppString, int remotePort, int localPort) {
|
||||
this.isGlobalProxy = isGlobalProxy;
|
||||
this.isGFWList = isGFWList;
|
||||
this.isBypassApps = isBypassApps;
|
||||
this.isTrafficStat = isTrafficStat;
|
||||
this.isUdpDns = isUdpDns;
|
||||
this.profileName = profileName;
|
||||
this.proxy = proxy;
|
||||
this.sitekey = sitekey;
|
||||
this.encMethod = encMethod;
|
||||
this.proxiedAppString = proxiedAppString;
|
||||
this.remotePort = remotePort;
|
||||
this.localPort = localPort;
|
||||
}
|
||||
|
||||
private Config(Parcel in) {
|
||||
readFromParcel(in);
|
||||
}
|
||||
|
||||
public void readFromParcel(Parcel in) {
|
||||
isGlobalProxy = in.readInt() == 1;
|
||||
isGFWList = in.readInt() == 1;
|
||||
isBypassApps = in.readInt() == 1;
|
||||
isTrafficStat = in.readInt() == 1;
|
||||
isUdpDns = in.readInt() == 1;
|
||||
profileName = in.readString();
|
||||
proxy = in.readString();
|
||||
sitekey = in.readString();
|
||||
encMethod = in.readString();
|
||||
proxiedAppString = in.readString();
|
||||
remotePort = in.readInt();
|
||||
localPort = in.readInt();
|
||||
}
|
||||
|
||||
@Override public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeInt(isGlobalProxy ? 1 : 0);
|
||||
out.writeInt(isGFWList ? 1 : 0);
|
||||
out.writeInt(isBypassApps ? 1 : 0);
|
||||
out.writeInt(isTrafficStat ? 1 : 0);
|
||||
out.writeInt(isUdpDns ? 1 : 0);
|
||||
out.writeString(profileName);
|
||||
out.writeString(proxy);
|
||||
out.writeString(sitekey);
|
||||
out.writeString(encMethod);
|
||||
out.writeString(proxiedAppString);
|
||||
out.writeInt(remotePort);
|
||||
out.writeInt(localPort);
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.github.shadowsocks.aidl;
|
||||
|
||||
import com.github.shadowsocks.aidl.Config;
|
||||
import com.github.shadowsocks.aidl.IShadowsocksServiceCallback;
|
||||
|
||||
interface IShadowsocksService {
|
||||
int getMode();
|
||||
int getState();
|
||||
|
||||
oneway void registerCallback(IShadowsocksServiceCallback cb);
|
||||
oneway void unregisterCallback(IShadowsocksServiceCallback cb);
|
||||
|
||||
oneway void start(in Config config);
|
||||
oneway void stop();
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.github.shadowsocks.aidl;
|
||||
|
||||
interface IShadowsocksServiceCallback {
|
||||
oneway void stateChanged(int state, String msg);
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
android:defaultValue="true"
|
||||
android:summary="@string/traffic_stat_summary"
|
||||
android:title="@string/traffic_stat">
|
||||
</CheckBoxPreference>
|
||||
</CheckBoxPreference>
|
||||
<CheckBoxPreference
|
||||
android:key="isUdpDns"
|
||||
android:defaultValue="false"
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<preference-headers
|
||||
xmlns:unified="http://schemas.android.com/apk/res-auto">
|
||||
<preference-headers xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<header
|
||||
unified:fragment="com.github.shadowsocks.Shadowsocks$ProxyFragment"
|
||||
unified:title="@string/proxy_cat"
|
||||
unified:preferenceRes="@xml/pref_proxy"/>
|
||||
android:fragment="com.github.shadowsocks.Shadowsocks$ProxyFragment"
|
||||
android:title="@string/proxy_cat" />
|
||||
<header
|
||||
unified:fragment="com.github.shadowsocks.Shadowsocks$FeatureFragment"
|
||||
unified:title="@string/feature_cat"
|
||||
unified:preferenceRes="@xml/pref_feature"/>
|
||||
android:fragment="com.github.shadowsocks.Shadowsocks$FeatureFragment"
|
||||
android:title="@string/feature_cat" />
|
||||
|
||||
|
||||
</preference-headers>
|
||||
</preference-headers>
|
||||
|
||||
@@ -50,8 +50,8 @@ import android.widget._
|
||||
import com.google.analytics.tracking.android.{MapBuilder, EasyTracker}
|
||||
import de.keyboardsurfer.android.widget.crouton.{Crouton, Style, Configuration}
|
||||
import java.util.Hashtable
|
||||
import net.saik0.android.unifiedpreference.UnifiedPreferenceFragment
|
||||
import net.saik0.android.unifiedpreference.UnifiedSherlockPreferenceActivity
|
||||
import android.preference.PreferenceFragment
|
||||
import com.actionbarsherlock.app.SherlockPreferenceActivity
|
||||
import org.jraf.android.backport.switchwidget.Switch
|
||||
import android.content.pm.{PackageInfo, PackageManager}
|
||||
import android.net.{Uri, VpnService}
|
||||
@@ -175,7 +175,7 @@ object Shadowsocks {
|
||||
}
|
||||
}
|
||||
|
||||
class ProxyFragment extends UnifiedPreferenceFragment {
|
||||
class ProxyFragment extends PreferenceFragment {
|
||||
|
||||
var receiver: BroadcastReceiver = null
|
||||
|
||||
@@ -200,6 +200,7 @@ object Shadowsocks {
|
||||
|
||||
override def onCreate(bundle: Bundle) {
|
||||
super.onCreate(bundle)
|
||||
addPreferencesFromResource(R.xml.pref_proxy)
|
||||
val filter = new IntentFilter()
|
||||
filter.addAction(Action.UPDATE_FRAGMENT)
|
||||
receiver = new BroadcastReceiver {
|
||||
@@ -226,7 +227,7 @@ object Shadowsocks {
|
||||
}
|
||||
}
|
||||
|
||||
class FeatureFragment extends UnifiedPreferenceFragment {
|
||||
class FeatureFragment extends PreferenceFragment {
|
||||
|
||||
var receiver: BroadcastReceiver = null
|
||||
|
||||
@@ -258,6 +259,7 @@ object Shadowsocks {
|
||||
|
||||
override def onCreate(bundle: Bundle) {
|
||||
super.onCreate(bundle)
|
||||
addPreferencesFromResource(R.xml.pref_feature)
|
||||
val filter = new IntentFilter()
|
||||
filter.addAction(Action.UPDATE_FRAGMENT)
|
||||
receiver = new BroadcastReceiver {
|
||||
@@ -287,7 +289,7 @@ object Shadowsocks {
|
||||
}
|
||||
|
||||
class Shadowsocks
|
||||
extends UnifiedSherlockPreferenceActivity
|
||||
extends SherlockPreferenceActivity
|
||||
with CompoundButton.OnCheckedChangeListener
|
||||
with MenuAdapter.MenuListener {
|
||||
|
||||
@@ -547,12 +549,23 @@ class Shadowsocks
|
||||
onContentChanged()
|
||||
}
|
||||
|
||||
override def onBuildHeaders(target: java.util.List[PreferenceActivity.Header]) {
|
||||
loadHeadersFromResource(R.xml.shadowsocks_headers, target);
|
||||
}
|
||||
|
||||
def isSinglePane: Boolean = {
|
||||
Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB
|
||||
}
|
||||
|
||||
override def onCreate(savedInstanceState: Bundle) {
|
||||
|
||||
// Initialize the preference
|
||||
setHeaderRes(R.xml.shadowsocks_headers)
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
if (isSinglePane) {
|
||||
// Load the legacy preferences headers
|
||||
addPreferencesFromResource(R.xml.pref_all);
|
||||
}
|
||||
|
||||
// Initialize the profile
|
||||
currentProfile = {
|
||||
profileManager.getProfile(settings.getInt(Key.profileId, -1)) getOrElse currentProfile
|
||||
|
||||
Reference in New Issue
Block a user