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
5a479530
Commit
5a479530
authored
Jun 08, 2014
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix travis
parent
3352504d
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
36 additions
and
119 deletions
+36
-119
.gitignore
.gitignore
+2
-0
.travis.yml
.travis.yml
+5
-10
build-ndk.sh
build-ndk.sh
+1
-1
local.properties.example
local.properties.example
+3
-0
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
+10
-108
src/main/scala/com/github/shadowsocks/preferences/PasswordEditTextPreference.scala
.../shadowsocks/preferences/PasswordEditTextPreference.scala
+5
-0
src/main/scala/com/github/shadowsocks/preferences/ProfileEditTextPreference.scala
...b/shadowsocks/preferences/ProfileEditTextPreference.scala
+5
-0
src/main/scala/com/github/shadowsocks/preferences/SummaryEditTextPreference.scala
...b/shadowsocks/preferences/SummaryEditTextPreference.scala
+5
-0
travis.keystore
travis.keystore
+0
-0
No files found.
.gitignore
View file @
5a479530
...
...
@@ -29,3 +29,5 @@ src/main/assets/armeabi
src/main/assets/armeabi-v7a
src/main/assets/x86
src/main/jni
obj
libs
.travis.yml
View file @
5a479530
...
...
@@ -2,10 +2,6 @@ language: scala
scala
:
-
2.10.3
before_install
:
-
git clone https://github.com/madeye/android-plugin.git
-
pushd android-plugin
-
sbt publish-local
-
popd
-
sudo apt-get update
-
sudo apt-get install libc6-dev-i386
-
sudo apt-get install lib32ncurses5-dev
...
...
@@ -15,8 +11,8 @@ before_install:
-
sudo apt-get install ccache
-
export NDK_CCACHE=ccache
-
export ARCH=`uname -m`
-
wget http://dl.google.com/android/android-sdk_r22.6.
4
-linux.tgz
-
tar xf android-sdk_r22.6.
4
-linux.tgz
-
wget http://dl.google.com/android/android-sdk_r22.6.
2
-linux.tgz
-
tar xf android-sdk_r22.6.
2
-linux.tgz
-
wget http://dl.google.com/android/ndk/android-ndk-r9d-linux-${ARCH}.tar.bz2
-
tar xf android-ndk-r9d-linux-${ARCH}.tar.bz2
-
export ANDROID_NDK_HOME=`pwd`/android-ndk-r9d
...
...
@@ -28,11 +24,10 @@ install:
-
gem install travis-artifacts
script
:
-
./build-ndk.sh
-
cp local.sbt.example local.sbt
-
sbt clean
-
sbt apk
-
cp local.properties.example local.properties
-
sbt clean android:package-release
after_success
:
-
sbt deploy
-
./deploy target/android-bin shadowsocks-release.apk
env
:
global
:
-
"
ARTIFACTS_AWS_REGION=us-east-1"
...
...
build-ndk.sh
View file @
5a479530
...
...
@@ -4,7 +4,7 @@ ndk-build
mkdir
-p
assets/armeabi
mkdir
-p
assets/armeabi-v7a
mkdir
-p
assets/x86
for
app
in
iptables pdnsd redsocks ss-local ss-tunnel tun2socks
for
app
in
ip
6tables ip
tables pdnsd redsocks ss-local ss-tunnel tun2socks
do
mv
libs/armeabi/
$app
src/main/assets/armeabi/
mv
libs/armeabi-v7a/
$app
src/main/assets/armeabi-v7a/
...
...
local.properties.example
0 → 100644
View file @
5a479530
key.alias: travis
key.store: travis.keystore
key.store.password=travis
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
View file @
5a479530
...
...
@@ -50,7 +50,6 @@ 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
android.preference.PreferenceFragment
import
com.actionbarsherlock.app.SherlockPreferenceActivity
import
org.jraf.android.backport.switchwidget.Switch
import
android.content.pm.
{
PackageInfo
,
PackageManager
}
...
...
@@ -172,77 +171,6 @@ object Shadowsocks {
case
_
=>
}
}
class
SettingsFragment
extends
PreferenceFragment
{
var
receiver
:
BroadcastReceiver
=
null
private
def
setPreferenceEnabled
()
{
val
state
=
getActivity
.
asInstanceOf
[
Shadowsocks
].
state
val
enabled
=
state
!=
State
.
CONNECTED
&&
state
!=
State
.
CONNECTING
for
(
name
<-
PROXY_PREFS
)
{
val
pref
:
Preference
=
findPreference
(
name
)
if
(
pref
!=
null
)
{
pref
.
setEnabled
(
enabled
)
}
}
for
(
name
<-
Shadowsocks
.
FEATRUE_PREFS
)
{
val
pref
:
Preference
=
findPreference
(
name
)
if
(
pref
!=
null
)
{
val
status
=
getActivity
.
getSharedPreferences
(
Key
.
status
,
Context
.
MODE_PRIVATE
)
val
isRoot
=
status
.
getBoolean
(
Key
.
isRoot
,
false
)
if
(
Seq
(
Key
.
isGlobalProxy
,
Key
.
isTrafficStat
,
Key
.
proxyedApps
)
.
contains
(
name
))
{
pref
.
setEnabled
(
enabled
&&
isRoot
)
}
else
{
pref
.
setEnabled
(
enabled
)
}
}
}
}
private
def
updatePreferenceScreen
()
{
for
(
name
<-
Shadowsocks
.
PROXY_PREFS
)
{
val
pref
=
findPreference
(
name
)
Shadowsocks
.
updatePreference
(
pref
,
name
,
getActivity
.
asInstanceOf
[
Shadowsocks
].
currentProfile
)
}
for
(
name
<-
Shadowsocks
.
FEATRUE_PREFS
)
{
val
pref
=
findPreference
(
name
)
Shadowsocks
.
updatePreference
(
pref
,
name
,
getActivity
.
asInstanceOf
[
Shadowsocks
].
currentProfile
)
}
}
override
def
onCreate
(
bundle
:
Bundle
)
{
super
.
onCreate
(
bundle
)
addPreferencesFromResource
(
R
.
xml
.
pref_all
)
val
filter
=
new
IntentFilter
()
filter
.
addAction
(
Action
.
UPDATE_FRAGMENT
)
receiver
=
new
BroadcastReceiver
{
def
onReceive
(
p1
:
Context
,
p2
:
Intent
)
{
setPreferenceEnabled
()
updatePreferenceScreen
()
}
}
getActivity
.
getApplicationContext
.
registerReceiver
(
receiver
,
filter
)
}
override
def
onDestroy
()
{
super
.
onDestroy
()
getActivity
.
getApplicationContext
.
unregisterReceiver
(
receiver
)
}
override
def
onResume
()
{
super
.
onResume
()
setPreferenceEnabled
()
}
override
def
onPause
()
{
super
.
onPause
()
}
}
}
class
Shadowsocks
...
...
@@ -315,10 +243,6 @@ class Shadowsocks
val
handler
=
new
Handler
()
def
isFallbackPref
:
Boolean
=
{
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
HONEYCOMB
}
def
isSinglePane
:
Boolean
=
{
if
(
singlePane
==
-
1
)
{
val
metrics
=
new
DisplayMetrics
()
...
...
@@ -327,8 +251,7 @@ class Shadowsocks
val
scaleFactor
=
metrics
.
density
val
widthDp
=
widthPixels
/
scaleFactor
singlePane
=
if
(
widthDp
<=
720
)
1
else
0
singlePane
=
if
(
widthDp
<=
720
)
1
else
0
}
singlePane
==
1
}
...
...
@@ -503,7 +426,11 @@ class Shadowsocks
def
initAdView
()
{
if
(
settings
.
getString
(
Key
.
proxy
,
""
)
==
"198.199.101.152"
)
{
val
layoutView
=
{
if
(
Build
.
VERSION
.
SDK_INT
>
10
)
{
drawer
.
getContentContainer
.
asInstanceOf
[
ViewGroup
].
getChildAt
(
0
)
}
else
{
getLayoutView
(
drawer
.
getContentContainer
.
getParent
)
}
}
if
(
layoutView
!=
null
)
{
val
adView
=
new
AdView
(
this
)
...
...
@@ -525,15 +452,7 @@ class Shadowsocks
super
.
onCreate
(
savedInstanceState
)
if
(
isFallbackPref
)
{
// Load the legacy preferences headers
addPreferencesFromResource
(
R
.
xml
.
pref_all
)
}
else
{
// Display the fragment as the main content.
getFragmentManager
.
beginTransaction
()
.
replace
(
android
.
R
.
id
.
content
,
new
Shadowsocks
.
SettingsFragment
())
.
commit
()
}
addPreferencesFromResource
(
R
.
xml
.
pref_all
)
// Initialize the profile
currentProfile
=
{
...
...
@@ -678,11 +597,7 @@ class Shadowsocks
profileManager
.
reload
(
currentProfile
.
id
)
menuAdapter
.
updateList
(
getMenuList
,
currentProfile
.
id
)
if
(!
isFallbackPref
)
{
sendBroadcast
(
new
Intent
(
Action
.
UPDATE_FRAGMENT
))
}
else
{
updatePreferenceScreen
()
}
updatePreferenceScreen
()
h
.
sendEmptyMessage
(
0
)
}
...
...
@@ -700,11 +615,7 @@ class Shadowsocks
profileManager
.
save
()
menuAdapter
.
updateList
(
getMenuList
,
currentProfile
.
id
)
if
(!
isFallbackPref
)
{
sendBroadcast
(
new
Intent
(
Action
.
UPDATE_FRAGMENT
))
}
else
{
updatePreferenceScreen
()
}
updatePreferenceScreen
()
h
.
sendEmptyMessage
(
0
)
}
...
...
@@ -722,11 +633,7 @@ class Shadowsocks
menuAdapter
.
setActiveId
(
id
)
menuAdapter
.
notifyDataSetChanged
()
if
(!
isFallbackPref
)
{
sendBroadcast
(
new
Intent
(
Action
.
UPDATE_FRAGMENT
))
}
else
{
updatePreferenceScreen
()
}
updatePreferenceScreen
()
h
.
sendEmptyMessage
(
0
)
}
...
...
@@ -756,11 +663,7 @@ class Shadowsocks
currentProfile
=
profileManager
.
load
(
profileId
)
menuAdapter
.
updateList
(
getMenuList
,
currentProfile
.
id
)
if
(!
isFallbackPref
)
{
sendBroadcast
(
new
Intent
(
Action
.
UPDATE_FRAGMENT
))
}
else
{
updatePreferenceScreen
()
}
sendBroadcast
(
new
Intent
(
Action
.
UPDATE_FRAGMENT
))
dialog
.
dismiss
()
}
...
...
@@ -1080,7 +983,6 @@ class Shadowsocks
}
setPreferenceEnabled
(
enabled
=
true
)
}
if
(!
isFallbackPref
)
sendBroadcast
(
new
Intent
(
Action
.
UPDATE_FRAGMENT
))
}
}
})
...
...
src/main/scala/com/github/shadowsocks/preferences/PasswordEditTextPreference.scala
View file @
5a479530
...
...
@@ -51,6 +51,11 @@ class PasswordEditTextPreference(context: Context, attrs: AttributeSet, defStyle
mDefaultSummary
=
getSummary
}
override
def
setText
(
text
:
String
)
{
super
.
setText
(
text
)
setSummary
(
text
)
}
override
def
setSummary
(
summary
:
CharSequence
)
{
if
(
summary
.
toString
.
isEmpty
)
{
super
.
setSummary
(
mDefaultSummary
)
...
...
src/main/scala/com/github/shadowsocks/preferences/ProfileEditTextPreference.scala
View file @
5a479530
...
...
@@ -52,6 +52,11 @@ class ProfileEditTextPreference(context: Context, attrs: AttributeSet, defStyle:
mDefaultSummary
=
getSummary
}
override
def
setText
(
text
:
String
)
{
super
.
setText
(
text
)
setSummary
(
text
)
}
override
def
setSummary
(
summary
:
CharSequence
)
{
if
(
summary
.
toString
.
isEmpty
)
{
super
.
setSummary
(
mDefaultSummary
)
...
...
src/main/scala/com/github/shadowsocks/preferences/SummaryEditTextPreference.scala
View file @
5a479530
...
...
@@ -51,6 +51,11 @@ class SummaryEditTextPreference(context: Context, attrs: AttributeSet, defStyle:
mDefaultSummary
=
getSummary
}
override
def
setText
(
text
:
String
)
{
super
.
setText
(
text
)
setSummary
(
text
)
}
override
def
setSummary
(
summary
:
CharSequence
)
{
if
(
summary
.
toString
.
isEmpty
)
{
super
.
setSummary
(
mDefaultSummary
)
...
...
travis.keystore
0 → 100755
View file @
5a479530
File added
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