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
...
@@ -29,3 +29,5 @@ src/main/assets/armeabi
src/main/assets/armeabi-v7a
src/main/assets/armeabi-v7a
src/main/assets/x86
src/main/assets/x86
src/main/jni
src/main/jni
obj
libs
.travis.yml
View file @
5a479530
...
@@ -2,10 +2,6 @@ language: scala
...
@@ -2,10 +2,6 @@ language: scala
scala
:
scala
:
-
2.10.3
-
2.10.3
before_install
:
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 update
-
sudo apt-get install libc6-dev-i386
-
sudo apt-get install libc6-dev-i386
-
sudo apt-get install lib32ncurses5-dev
-
sudo apt-get install lib32ncurses5-dev
...
@@ -15,8 +11,8 @@ before_install:
...
@@ -15,8 +11,8 @@ before_install:
-
sudo apt-get install ccache
-
sudo apt-get install ccache
-
export NDK_CCACHE=ccache
-
export NDK_CCACHE=ccache
-
export ARCH=`uname -m`
-
export ARCH=`uname -m`
-
wget http://dl.google.com/android/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.
4
-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
-
wget http://dl.google.com/android/ndk/android-ndk-r9d-linux-${ARCH}.tar.bz2
-
tar xf android-ndk-r9d-linux-${ARCH}.tar.bz2
-
tar xf android-ndk-r9d-linux-${ARCH}.tar.bz2
-
export ANDROID_NDK_HOME=`pwd`/android-ndk-r9d
-
export ANDROID_NDK_HOME=`pwd`/android-ndk-r9d
...
@@ -28,11 +24,10 @@ install:
...
@@ -28,11 +24,10 @@ install:
-
gem install travis-artifacts
-
gem install travis-artifacts
script
:
script
:
-
./build-ndk.sh
-
./build-ndk.sh
-
cp local.sbt.example local.sbt
-
cp local.properties.example local.properties
-
sbt clean
-
sbt clean android:package-release
-
sbt apk
after_success
:
after_success
:
-
sbt deploy
-
./deploy target/android-bin shadowsocks-release.apk
env
:
env
:
global
:
global
:
-
"
ARTIFACTS_AWS_REGION=us-east-1"
-
"
ARTIFACTS_AWS_REGION=us-east-1"
...
...
build-ndk.sh
View file @
5a479530
...
@@ -4,7 +4,7 @@ ndk-build
...
@@ -4,7 +4,7 @@ ndk-build
mkdir
-p
assets/armeabi
mkdir
-p
assets/armeabi
mkdir
-p
assets/armeabi-v7a
mkdir
-p
assets/armeabi-v7a
mkdir
-p
assets/x86
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
do
mv
libs/armeabi/
$app
src/main/assets/armeabi/
mv
libs/armeabi/
$app
src/main/assets/armeabi/
mv
libs/armeabi-v7a/
$app
src/main/assets/armeabi-v7a/
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._
...
@@ -50,7 +50,6 @@ 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
android.preference.PreferenceFragment
import
com.actionbarsherlock.app.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
}
...
@@ -172,77 +171,6 @@ object Shadowsocks {
...
@@ -172,77 +171,6 @@ object Shadowsocks {
case
_
=>
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
class
Shadowsocks
...
@@ -315,10 +243,6 @@ class Shadowsocks
...
@@ -315,10 +243,6 @@ class Shadowsocks
val
handler
=
new
Handler
()
val
handler
=
new
Handler
()
def
isFallbackPref
:
Boolean
=
{
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
HONEYCOMB
}
def
isSinglePane
:
Boolean
=
{
def
isSinglePane
:
Boolean
=
{
if
(
singlePane
==
-
1
)
{
if
(
singlePane
==
-
1
)
{
val
metrics
=
new
DisplayMetrics
()
val
metrics
=
new
DisplayMetrics
()
...
@@ -327,8 +251,7 @@ class Shadowsocks
...
@@ -327,8 +251,7 @@ class Shadowsocks
val
scaleFactor
=
metrics
.
density
val
scaleFactor
=
metrics
.
density
val
widthDp
=
widthPixels
/
scaleFactor
val
widthDp
=
widthPixels
/
scaleFactor
singlePane
=
if
(
widthDp
<=
720
)
1
singlePane
=
if
(
widthDp
<=
720
)
1
else
0
else
0
}
}
singlePane
==
1
singlePane
==
1
}
}
...
@@ -503,7 +426,11 @@ class Shadowsocks
...
@@ -503,7 +426,11 @@ class Shadowsocks
def
initAdView
()
{
def
initAdView
()
{
if
(
settings
.
getString
(
Key
.
proxy
,
""
)
==
"198.199.101.152"
)
{
if
(
settings
.
getString
(
Key
.
proxy
,
""
)
==
"198.199.101.152"
)
{
val
layoutView
=
{
val
layoutView
=
{
if
(
Build
.
VERSION
.
SDK_INT
>
10
)
{
drawer
.
getContentContainer
.
asInstanceOf
[
ViewGroup
].
getChildAt
(
0
)
}
else
{
getLayoutView
(
drawer
.
getContentContainer
.
getParent
)
getLayoutView
(
drawer
.
getContentContainer
.
getParent
)
}
}
}
if
(
layoutView
!=
null
)
{
if
(
layoutView
!=
null
)
{
val
adView
=
new
AdView
(
this
)
val
adView
=
new
AdView
(
this
)
...
@@ -525,15 +452,7 @@ class Shadowsocks
...
@@ -525,15 +452,7 @@ class Shadowsocks
super
.
onCreate
(
savedInstanceState
)
super
.
onCreate
(
savedInstanceState
)
if
(
isFallbackPref
)
{
addPreferencesFromResource
(
R
.
xml
.
pref_all
)
// 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
()
}
// Initialize the profile
// Initialize the profile
currentProfile
=
{
currentProfile
=
{
...
@@ -678,11 +597,7 @@ class Shadowsocks
...
@@ -678,11 +597,7 @@ class Shadowsocks
profileManager
.
reload
(
currentProfile
.
id
)
profileManager
.
reload
(
currentProfile
.
id
)
menuAdapter
.
updateList
(
getMenuList
,
currentProfile
.
id
)
menuAdapter
.
updateList
(
getMenuList
,
currentProfile
.
id
)
if
(!
isFallbackPref
)
{
updatePreferenceScreen
()
sendBroadcast
(
new
Intent
(
Action
.
UPDATE_FRAGMENT
))
}
else
{
updatePreferenceScreen
()
}
h
.
sendEmptyMessage
(
0
)
h
.
sendEmptyMessage
(
0
)
}
}
...
@@ -700,11 +615,7 @@ class Shadowsocks
...
@@ -700,11 +615,7 @@ class Shadowsocks
profileManager
.
save
()
profileManager
.
save
()
menuAdapter
.
updateList
(
getMenuList
,
currentProfile
.
id
)
menuAdapter
.
updateList
(
getMenuList
,
currentProfile
.
id
)
if
(!
isFallbackPref
)
{
updatePreferenceScreen
()
sendBroadcast
(
new
Intent
(
Action
.
UPDATE_FRAGMENT
))
}
else
{
updatePreferenceScreen
()
}
h
.
sendEmptyMessage
(
0
)
h
.
sendEmptyMessage
(
0
)
}
}
...
@@ -722,11 +633,7 @@ class Shadowsocks
...
@@ -722,11 +633,7 @@ class Shadowsocks
menuAdapter
.
setActiveId
(
id
)
menuAdapter
.
setActiveId
(
id
)
menuAdapter
.
notifyDataSetChanged
()
menuAdapter
.
notifyDataSetChanged
()
if
(!
isFallbackPref
)
{
updatePreferenceScreen
()
sendBroadcast
(
new
Intent
(
Action
.
UPDATE_FRAGMENT
))
}
else
{
updatePreferenceScreen
()
}
h
.
sendEmptyMessage
(
0
)
h
.
sendEmptyMessage
(
0
)
}
}
...
@@ -756,11 +663,7 @@ class Shadowsocks
...
@@ -756,11 +663,7 @@ class Shadowsocks
currentProfile
=
profileManager
.
load
(
profileId
)
currentProfile
=
profileManager
.
load
(
profileId
)
menuAdapter
.
updateList
(
getMenuList
,
currentProfile
.
id
)
menuAdapter
.
updateList
(
getMenuList
,
currentProfile
.
id
)
if
(!
isFallbackPref
)
{
sendBroadcast
(
new
Intent
(
Action
.
UPDATE_FRAGMENT
))
sendBroadcast
(
new
Intent
(
Action
.
UPDATE_FRAGMENT
))
}
else
{
updatePreferenceScreen
()
}
dialog
.
dismiss
()
dialog
.
dismiss
()
}
}
...
@@ -1080,7 +983,6 @@ class Shadowsocks
...
@@ -1080,7 +983,6 @@ class Shadowsocks
}
}
setPreferenceEnabled
(
enabled
=
true
)
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
...
@@ -51,6 +51,11 @@ class PasswordEditTextPreference(context: Context, attrs: AttributeSet, defStyle
mDefaultSummary
=
getSummary
mDefaultSummary
=
getSummary
}
}
override
def
setText
(
text
:
String
)
{
super
.
setText
(
text
)
setSummary
(
text
)
}
override
def
setSummary
(
summary
:
CharSequence
)
{
override
def
setSummary
(
summary
:
CharSequence
)
{
if
(
summary
.
toString
.
isEmpty
)
{
if
(
summary
.
toString
.
isEmpty
)
{
super
.
setSummary
(
mDefaultSummary
)
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:
...
@@ -52,6 +52,11 @@ class ProfileEditTextPreference(context: Context, attrs: AttributeSet, defStyle:
mDefaultSummary
=
getSummary
mDefaultSummary
=
getSummary
}
}
override
def
setText
(
text
:
String
)
{
super
.
setText
(
text
)
setSummary
(
text
)
}
override
def
setSummary
(
summary
:
CharSequence
)
{
override
def
setSummary
(
summary
:
CharSequence
)
{
if
(
summary
.
toString
.
isEmpty
)
{
if
(
summary
.
toString
.
isEmpty
)
{
super
.
setSummary
(
mDefaultSummary
)
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:
...
@@ -51,6 +51,11 @@ class SummaryEditTextPreference(context: Context, attrs: AttributeSet, defStyle:
mDefaultSummary
=
getSummary
mDefaultSummary
=
getSummary
}
}
override
def
setText
(
text
:
String
)
{
super
.
setText
(
text
)
setSummary
(
text
)
}
override
def
setSummary
(
summary
:
CharSequence
)
{
override
def
setSummary
(
summary
:
CharSequence
)
{
if
(
summary
.
toString
.
isEmpty
)
{
if
(
summary
.
toString
.
isEmpty
)
{
super
.
setSummary
(
mDefaultSummary
)
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