Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
6c924f2d
Commit
6c924f2d
authored
Jun 05, 2014
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unified preference
parent
1463cb6c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
129 deletions
+27
-129
src/main/java/com/github/shadowsocks/aidl/Config.aidl
src/main/java/com/github/shadowsocks/aidl/Config.aidl
+0
-3
src/main/java/com/github/shadowsocks/aidl/Config.java
src/main/java/com/github/shadowsocks/aidl/Config.java
+0
-88
src/main/java/com/github/shadowsocks/aidl/IShadowsocksService.aidl
...java/com/github/shadowsocks/aidl/IShadowsocksService.aidl
+0
-15
src/main/java/com/github/shadowsocks/aidl/IShadowsocksServiceCallback.aidl
.../github/shadowsocks/aidl/IShadowsocksServiceCallback.aidl
+0
-5
src/main/res/xml/pref_feature.xml
src/main/res/xml/pref_feature.xml
+1
-1
src/main/res/xml/shadowsocks_headers.xml
src/main/res/xml/shadowsocks_headers.xml
+6
-10
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
+20
-7
No files found.
src/main/java/com/github/shadowsocks/aidl/Config.aidl
deleted
100644 → 0
View file @
1463cb6c
package
com
.
github
.
shadowsocks
.
aidl
;
parcelable
Config
;
\ No newline at end of file
src/main/java/com/github/shadowsocks/aidl/Config.java
deleted
100644 → 0
View file @
1463cb6c
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
);
}
}
src/main/java/com/github/shadowsocks/aidl/IShadowsocksService.aidl
deleted
100644 → 0
View file @
1463cb6c
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
();
}
src/main/java/com/github/shadowsocks/aidl/IShadowsocksServiceCallback.aidl
deleted
100644 → 0
View file @
1463cb6c
package
com
.
github
.
shadowsocks
.
aidl
;
interface
IShadowsocksServiceCallback
{
oneway
void
stateChanged
(
int
state
,
String
msg
);
}
src/main/res/xml/pref_feature.xml
View file @
6c924f2d
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
android:defaultValue=
"true"
android:defaultValue=
"true"
android:summary=
"@string/traffic_stat_summary"
android:summary=
"@string/traffic_stat_summary"
android:title=
"@string/traffic_stat"
>
android:title=
"@string/traffic_stat"
>
</CheckBoxPreference>
</CheckBoxPreference>
<CheckBoxPreference
<CheckBoxPreference
android:key=
"isUdpDns"
android:key=
"isUdpDns"
android:defaultValue=
"false"
android:defaultValue=
"false"
...
...
src/main/res/xml/shadowsocks_headers.xml
View file @
6c924f2d
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<preference-headers
<preference-headers
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
xmlns:unified=
"http://schemas.android.com/apk/res-auto"
>
<header
<header
unified:fragment=
"com.github.shadowsocks.Shadowsocks$ProxyFragment"
android:fragment=
"com.github.shadowsocks.Shadowsocks$ProxyFragment"
unified:title=
"@string/proxy_cat"
android:title=
"@string/proxy_cat"
/>
unified:preferenceRes=
"@xml/pref_proxy"
/>
<header
<header
unified:fragment=
"com.github.shadowsocks.Shadowsocks$FeatureFragment"
android:fragment=
"com.github.shadowsocks.Shadowsocks$FeatureFragment"
unified:title=
"@string/feature_cat"
android:title=
"@string/feature_cat"
/>
unified:preferenceRes=
"@xml/pref_feature"
/>
</preference-headers>
</preference-headers>
\ No newline at end of file
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
View file @
6c924f2d
...
@@ -50,8 +50,8 @@ import android.widget._
...
@@ -50,8 +50,8 @@ import android.widget._
import
com.google.analytics.tracking.android.
{
MapBuilder
,
EasyTracker
}
import
com.google.analytics.tracking.android.
{
MapBuilder
,
EasyTracker
}
import
de.keyboardsurfer.android.widget.crouton.
{
Crouton
,
Style
,
Configuration
}
import
de.keyboardsurfer.android.widget.crouton.
{
Crouton
,
Style
,
Configuration
}
import
java.util.Hashtable
import
java.util.Hashtable
import
net.saik0.android.unifiedpreference.Unified
PreferenceFragment
import
android.preference.
PreferenceFragment
import
net.saik0.android.unifiedpreference.Unified
SherlockPreferenceActivity
import
com.actionbarsherlock.app.
SherlockPreferenceActivity
import
org.jraf.android.backport.switchwidget.Switch
import
org.jraf.android.backport.switchwidget.Switch
import
android.content.pm.
{
PackageInfo
,
PackageManager
}
import
android.content.pm.
{
PackageInfo
,
PackageManager
}
import
android.net.
{
Uri
,
VpnService
}
import
android.net.
{
Uri
,
VpnService
}
...
@@ -175,7 +175,7 @@ object Shadowsocks {
...
@@ -175,7 +175,7 @@ object Shadowsocks {
}
}
}
}
class
ProxyFragment
extends
Unified
PreferenceFragment
{
class
ProxyFragment
extends
PreferenceFragment
{
var
receiver
:
BroadcastReceiver
=
null
var
receiver
:
BroadcastReceiver
=
null
...
@@ -200,6 +200,7 @@ object Shadowsocks {
...
@@ -200,6 +200,7 @@ object Shadowsocks {
override
def
onCreate
(
bundle
:
Bundle
)
{
override
def
onCreate
(
bundle
:
Bundle
)
{
super
.
onCreate
(
bundle
)
super
.
onCreate
(
bundle
)
addPreferencesFromResource
(
R
.
xml
.
pref_proxy
)
val
filter
=
new
IntentFilter
()
val
filter
=
new
IntentFilter
()
filter
.
addAction
(
Action
.
UPDATE_FRAGMENT
)
filter
.
addAction
(
Action
.
UPDATE_FRAGMENT
)
receiver
=
new
BroadcastReceiver
{
receiver
=
new
BroadcastReceiver
{
...
@@ -226,7 +227,7 @@ object Shadowsocks {
...
@@ -226,7 +227,7 @@ object Shadowsocks {
}
}
}
}
class
FeatureFragment
extends
Unified
PreferenceFragment
{
class
FeatureFragment
extends
PreferenceFragment
{
var
receiver
:
BroadcastReceiver
=
null
var
receiver
:
BroadcastReceiver
=
null
...
@@ -258,6 +259,7 @@ object Shadowsocks {
...
@@ -258,6 +259,7 @@ object Shadowsocks {
override
def
onCreate
(
bundle
:
Bundle
)
{
override
def
onCreate
(
bundle
:
Bundle
)
{
super
.
onCreate
(
bundle
)
super
.
onCreate
(
bundle
)
addPreferencesFromResource
(
R
.
xml
.
pref_feature
)
val
filter
=
new
IntentFilter
()
val
filter
=
new
IntentFilter
()
filter
.
addAction
(
Action
.
UPDATE_FRAGMENT
)
filter
.
addAction
(
Action
.
UPDATE_FRAGMENT
)
receiver
=
new
BroadcastReceiver
{
receiver
=
new
BroadcastReceiver
{
...
@@ -287,7 +289,7 @@ object Shadowsocks {
...
@@ -287,7 +289,7 @@ object Shadowsocks {
}
}
class
Shadowsocks
class
Shadowsocks
extends
Unified
SherlockPreferenceActivity
extends
SherlockPreferenceActivity
with
CompoundButton
.
OnCheckedChangeListener
with
CompoundButton
.
OnCheckedChangeListener
with
MenuAdapter
.
MenuListener
{
with
MenuAdapter
.
MenuListener
{
...
@@ -547,12 +549,23 @@ class Shadowsocks
...
@@ -547,12 +549,23 @@ class Shadowsocks
onContentChanged
()
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
)
{
override
def
onCreate
(
savedInstanceState
:
Bundle
)
{
// Initialize the preference
setHeaderRes
(
R
.
xml
.
shadowsocks_headers
)
super
.
onCreate
(
savedInstanceState
)
super
.
onCreate
(
savedInstanceState
)
if
(
isSinglePane
)
{
// Load the legacy preferences headers
addPreferencesFromResource
(
R
.
xml
.
pref_all
);
}
// Initialize the profile
// Initialize the profile
currentProfile
=
{
currentProfile
=
{
profileManager
.
getProfile
(
settings
.
getInt
(
Key
.
profileId
,
-
1
))
getOrElse
currentProfile
profileManager
.
getProfile
(
settings
.
getInt
(
Key
.
profileId
,
-
1
))
getOrElse
currentProfile
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment