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
2599e88a
Commit
2599e88a
authored
Sep 24, 2016
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add fake demographics
parent
ac0a8c76
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
+16
-3
No files found.
src/main/scala/com/github/shadowsocks/Shadowsocks.scala
View file @
2599e88a
...
@@ -41,7 +41,8 @@ package com.github.shadowsocks
...
@@ -41,7 +41,8 @@ package com.github.shadowsocks
import
java.io.
{
FileOutputStream
,
IOException
,
InputStream
,
OutputStream
}
import
java.io.
{
FileOutputStream
,
IOException
,
InputStream
,
OutputStream
}
import
java.lang.System.currentTimeMillis
import
java.lang.System.currentTimeMillis
import
java.net.
{
HttpURLConnection
,
URL
}
import
java.net.
{
HttpURLConnection
,
URL
}
import
java.util
import
java.util.Date
import
java.util.Hashtable
import
java.util.Locale
import
java.util.Locale
import
android.app.backup.BackupManager
import
android.app.backup.BackupManager
...
@@ -68,6 +69,7 @@ import com.google.android.gms.ads.{AdRequest, AdSize, AdView}
...
@@ -68,6 +69,7 @@ import com.google.android.gms.ads.{AdRequest, AdSize, AdView}
import
eu.chainfire.libsuperuser.Shell
import
eu.chainfire.libsuperuser.Shell
import
scala.collection.mutable.ArrayBuffer
import
scala.collection.mutable.ArrayBuffer
import
scala.util.Random
object
Typefaces
{
object
Typefaces
{
def
get
(
c
:
Context
,
assetPath
:
String
)
:
Typeface
=
{
def
get
(
c
:
Context
,
assetPath
:
String
)
:
Typeface
=
{
...
@@ -87,7 +89,7 @@ object Typefaces {
...
@@ -87,7 +89,7 @@ object Typefaces {
}
}
private
final
val
TAG
=
"Typefaces"
private
final
val
TAG
=
"Typefaces"
private
final
val
cache
=
new
util
.
Hashtable
[
String
,
Typeface
]
private
final
val
cache
=
new
Hashtable
[
String
,
Typeface
]
}
}
object
Shadowsocks
{
object
Shadowsocks
{
...
@@ -487,7 +489,18 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext {
...
@@ -487,7 +489,18 @@ class Shadowsocks extends AppCompatActivity with ServiceBoundContext {
adView
.
setAdUnitId
(
"ca-app-pub-9097031975646651/7760346322"
)
adView
.
setAdUnitId
(
"ca-app-pub-9097031975646651/7760346322"
)
adView
.
setAdSize
(
AdSize
.
SMART_BANNER
)
adView
.
setAdSize
(
AdSize
.
SMART_BANNER
)
preferences
.
getView
.
asInstanceOf
[
ViewGroup
].
addView
(
adView
,
1
)
preferences
.
getView
.
asInstanceOf
[
ViewGroup
].
addView
(
adView
,
1
)
adView
.
loadAd
(
new
AdRequest
.
Builder
().
build
())
// Demographics
val
random
=
new
Random
()
val
adBuilder
=
new
AdRequest
.
Builder
()
adBuilder
.
setGender
(
AdRequest
.
GENDER_MALE
)
val
year
=
1975
+
random
.
nextInt
(
40
)
val
month
=
1
+
random
.
nextInt
(
12
)
val
day
=
random
.
nextInt
(
28
)
adBuilder
.
setBirthday
(
new
Date
(
year
,
month
,
day
))
// Load Ad
adView
.
loadAd
(
adBuilder
.
build
())
}
else
adView
.
setVisibility
(
View
.
VISIBLE
)
else
if
(
adView
!=
null
)
adView
.
setVisibility
(
View
.
GONE
)
}
else
adView
.
setVisibility
(
View
.
VISIBLE
)
else
if
(
adView
!=
null
)
adView
.
setVisibility
(
View
.
GONE
)
preferences
.
setProfile
(
profile
)
preferences
.
setProfile
(
profile
)
...
...
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