Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
bitmask_android
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
75
Issues
75
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
leap
bitmask_android
Commits
71a97834
Commit
71a97834
authored
Dec 29, 2018
by
cyberta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update sdk to version 28, update dependencies, fix potential memory leaks
parent
678024d9
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
66 additions
and
87 deletions
+66
-87
app/build.gradle
app/build.gradle
+31
-20
app/src/main/java/se/leap/bitmaskclient/BitmaskApp.java
app/src/main/java/se/leap/bitmaskclient/BitmaskApp.java
+1
-2
app/src/main/java/se/leap/bitmaskclient/Constants.java
app/src/main/java/se/leap/bitmaskclient/Constants.java
+2
-0
app/src/main/java/se/leap/bitmaskclient/EipFragment.java
app/src/main/java/se/leap/bitmaskclient/EipFragment.java
+10
-42
app/src/main/java/se/leap/bitmaskclient/MainActivity.java
app/src/main/java/se/leap/bitmaskclient/MainActivity.java
+1
-1
app/src/main/java/se/leap/bitmaskclient/VpnNotificationManager.java
...in/java/se/leap/bitmaskclient/VpnNotificationManager.java
+1
-1
app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java
...e/leap/bitmaskclient/drawer/NavigationDrawerFragment.java
+7
-20
app/src/main/res/values/attrs.xml
app/src/main/res/values/attrs.xml
+6
-0
app/src/main/res/values/themes.xml
app/src/main/res/values/themes.xml
+4
-0
docker/android-sdk/Dockerfile
docker/android-sdk/Dockerfile
+3
-1
No files found.
app/build.gradle
View file @
71a97834
...
...
@@ -6,8 +6,8 @@ apply plugin: 'com.android.application'
def
appName
=
'Bitmask'
android
{
compileSdkVersion
2
7
buildToolsVersion
'2
7
.0.3'
compileSdkVersion
2
8
buildToolsVersion
'2
8
.0.3'
compileOptions
{
targetCompatibility
1.8
...
...
@@ -169,9 +169,9 @@ dependencies {
androidTestImplementation
'com.jayway.android.robotium:robotium-solo:5.6.3'
testImplementation
'junit:junit:4.12'
testImplementation
'org.json:json:20170516'
debugImplementation
'com.squareup.leakcanary:leakcanary-android:1.
5.4
'
releaseImplementation
'com.squareup.leakcanary:leakcanary-android-no-op:1.
5.4
'
betaImplementation
'com.squareup.leakcanary:leakcanary-android-no-op:1.
5.4
'
debugImplementation
'com.squareup.leakcanary:leakcanary-android:1.
6.2
'
releaseImplementation
'com.squareup.leakcanary:leakcanary-android-no-op:1.
6.2
'
betaImplementation
'com.squareup.leakcanary:leakcanary-android-no-op:1.
6.2
'
annotationProcessor
'com.jakewharton:butterknife:6.1.0'
annotationProcessor
'com.squareup.dagger:dagger-compiler:1.2.2'
implementation
'com.jakewharton:butterknife:6.1.0'
...
...
@@ -182,15 +182,15 @@ dependencies {
implementation
'com.intellij:annotations:12.0'
implementation
'com.google.code.gson:gson:2.8.2'
implementation
'com.squareup.okhttp3:okhttp:3.9.0'
implementation
"com.android.support:support-core-utils:2
7.0.2
"
implementation
'com.android.support:support-annotations:2
7.0.2
'
implementation
'com.android.support:support-v4:2
7.0.2
'
implementation
'com.android.support:appcompat-v7:2
7.0.2
'
implementation
'com.android.support:design:2
7.0.2
'
implementation
'com.android.support:support-fragment:2
7.0.2
'
implementation
'com.android.support.constraint:constraint-layout:1.
0.2
'
implementation
'com.android.support:multidex:1.0.
2
'
implementation
'com.android.support:cardview-v7:2
7.0.2
'
implementation
"com.android.support:support-core-utils:2
8.0.0
"
implementation
'com.android.support:support-annotations:2
8.0.0
'
implementation
'com.android.support:support-v4:2
8.0.0
'
implementation
'com.android.support:appcompat-v7:2
8.0.0
'
implementation
'com.android.support:design:2
8.0.0
'
implementation
'com.android.support:support-fragment:2
8.0.0
'
implementation
'com.android.support.constraint:constraint-layout:1.
1.3
'
implementation
'com.android.support:multidex:1.0.
3
'
implementation
'com.android.support:cardview-v7:2
8.0.0
'
}
// Ensure the no-op dependency is always used in JVM tests.
...
...
@@ -202,12 +202,23 @@ configurations.all { config ->
}
}
}
resolutionStrategy
.
force
"com.android.support:support-annotations:27.0.2"
resolutionStrategy
.
force
"com.android.support:support-v4:27.0.2"
resolutionStrategy
.
force
"com.android.support:support-core-utils:27.0.2"
resolutionStrategy
.
force
"com.android.support:appcompat-v7:27.0.2"
resolutionStrategy
.
force
"com.android.support:design:27.0.2"
resolutionStrategy
.
force
"com.android.support:support-fragment:27.0.2"
resolutionStrategy
.
force
"com.android.support:support-annotations:28.0.0"
resolutionStrategy
.
force
"com.android.support:support-v4:28.0.0"
resolutionStrategy
.
force
"com.android.support:support-core-utils:28.0.0"
resolutionStrategy
.
force
"com.android.support:appcompat-v7:28.0.0"
resolutionStrategy
.
force
"com.android.support:design:28.0.0"
resolutionStrategy
.
force
"com.android.support:support-fragment:28.0.0"
}
subprojects
{
afterEvaluate
{
project
->
if
(
project
.
hasProperty
(
"android"
))
{
android
{
compileSdkVersion
28
buildToolsVersion
"28.0.3"
}
}
}
}
def
processFileInplace
(
file
,
Closure
processText
)
{
...
...
app/src/main/java/se/leap/bitmaskclient/BitmaskApp.java
View file @
71a97834
...
...
@@ -19,7 +19,6 @@ public class BitmaskApp extends MultiDexApplication {
private
final
static
String
TAG
=
BitmaskApp
.
class
.
getSimpleName
();
private
RefWatcher
refWatcher
;
private
ProviderObservable
providerObservable
;
private
SharedPreferences
preferences
;
@Override
...
...
@@ -33,7 +32,7 @@ public class BitmaskApp extends MultiDexApplication {
refWatcher
=
LeakCanary
.
install
(
this
);
// Normal app init code...*/
PRNGFixes
.
apply
();
preferences
=
getSharedPreferences
(
SHARED_PREFERENCES
,
MODE_PRIVATE
);
SharedPreferences
preferences
=
getSharedPreferences
(
SHARED_PREFERENCES
,
MODE_PRIVATE
);
providerObservable
=
ProviderObservable
.
getInstance
();
providerObservable
.
updateProvider
(
getSavedProviderFromSharedPreferences
(
preferences
));
EipSetupObserver
.
init
(
this
,
preferences
);
...
...
app/src/main/java/se/leap/bitmaskclient/Constants.java
View file @
71a97834
...
...
@@ -33,6 +33,8 @@ public interface Constants {
String
DEFAULT_BITMASK
=
"normal"
;
String
CUSTOM_BITMASK
=
"custom"
;
String
ASK_TO_CANCEL_VPN
=
"ask_to_cancel_vpn"
;
//////////////////////////////////////////////
// EIP CONSTANTS
...
...
app/src/main/java/se/leap/bitmaskclient/EipFragment.java
View file @
71a97834
...
...
@@ -19,7 +19,6 @@ package se.leap.bitmaskclient;
import
android.app.Activity
;
import
android.content.ComponentName
;
import
android.content.Context
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.content.ServiceConnection
;
import
android.content.SharedPreferences
;
...
...
@@ -67,6 +66,7 @@ import static se.leap.bitmaskclient.Constants.PROVIDER_KEY;
import
static
se
.
leap
.
bitmaskclient
.
Constants
.
REQUEST_CODE_CONFIGURE_LEAP
;
import
static
se
.
leap
.
bitmaskclient
.
Constants
.
REQUEST_CODE_LOG_IN
;
import
static
se
.
leap
.
bitmaskclient
.
Constants
.
REQUEST_CODE_SWITCH_PROVIDER
;
import
static
se
.
leap
.
bitmaskclient
.
Constants
.
ASK_TO_CANCEL_VPN
;
import
static
se
.
leap
.
bitmaskclient
.
Constants
.
SHARED_PREFERENCES
;
import
static
se
.
leap
.
bitmaskclient
.
EipSetupObserver
.
connectionRetry
;
import
static
se
.
leap
.
bitmaskclient
.
EipSetupObserver
.
gatewayOrder
;
...
...
@@ -81,7 +81,6 @@ public class EipFragment extends Fragment implements Observer {
public
final
static
String
TAG
=
EipFragment
.
class
.
getSimpleName
();
public
static
final
String
ASK_TO_CANCEL_VPN
=
"ask_to_cancel_vpn"
;
private
SharedPreferences
preferences
;
private
Provider
provider
;
...
...
@@ -106,8 +105,8 @@ public class EipFragment extends Fragment implements Observer {
private
EipStatus
eipStatus
;
//---saved Instance -------
private
final
static
String
KEY_SHOW_PENDING_START_CANCELLATION
=
"KEY_SHOW_PENDING_START_CANCELLATION"
;
private
final
static
String
KEY_SHOW_ASK_TO_STOP_EIP
=
"KEY_SHOW_ASK_TO_STOP_EIP"
;
private
final
String
KEY_SHOW_PENDING_START_CANCELLATION
=
"KEY_SHOW_PENDING_START_CANCELLATION"
;
private
final
String
KEY_SHOW_ASK_TO_STOP_EIP
=
"KEY_SHOW_ASK_TO_STOP_EIP"
;
private
boolean
showPendingStartCancellation
=
false
;
private
boolean
showAskToStopEip
=
false
;
//------------------------
...
...
@@ -324,22 +323,9 @@ public class EipFragment extends Fragment implements Observer {
showPendingStartCancellation
=
true
;
alertDialog
=
alertBuilder
.
setTitle
(
activity
.
getString
(
R
.
string
.
eip_cancel_connect_title
))
.
setMessage
(
activity
.
getString
(
R
.
string
.
eip_cancel_connect_text
))
.
setPositiveButton
((
android
.
R
.
string
.
yes
),
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
stopEipIfPossible
();
}
})
.
setNegativeButton
(
activity
.
getString
(
android
.
R
.
string
.
no
),
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
}
}).
setOnDismissListener
(
new
DialogInterface
.
OnDismissListener
()
{
@Override
public
void
onDismiss
(
DialogInterface
dialog
)
{
showPendingStartCancellation
=
false
;
}
}).
show
();
.
setPositiveButton
((
android
.
R
.
string
.
yes
),
(
dialog
,
which
)
->
stopEipIfPossible
())
.
setNegativeButton
(
activity
.
getString
(
android
.
R
.
string
.
no
),
(
dialog
,
which
)
->
{
}).
setOnDismissListener
(
dialog
->
showPendingStartCancellation
=
false
).
show
();
}
...
...
@@ -353,22 +339,9 @@ public class EipFragment extends Fragment implements Observer {
showAskToStopEip
=
true
;
alertDialog
=
alertBuilder
.
setTitle
(
activity
.
getString
(
R
.
string
.
eip_cancel_connect_title
))
.
setMessage
(
activity
.
getString
(
R
.
string
.
eip_warning_browser_inconsistency
))
.
setPositiveButton
((
android
.
R
.
string
.
yes
),
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
stopEipIfPossible
();
}
})
.
setNegativeButton
(
activity
.
getString
(
android
.
R
.
string
.
no
),
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
}
}).
setOnDismissListener
(
new
DialogInterface
.
OnDismissListener
()
{
@Override
public
void
onDismiss
(
DialogInterface
dialog
)
{
showAskToStopEip
=
false
;
}
}).
show
();
.
setPositiveButton
((
android
.
R
.
string
.
yes
),
(
dialog
,
which
)
->
stopEipIfPossible
())
.
setNegativeButton
(
activity
.
getString
(
android
.
R
.
string
.
no
),
(
dialog
,
which
)
->
{
}).
setOnDismissListener
(
dialog
->
showAskToStopEip
=
false
).
show
();
}
@Override
...
...
@@ -377,12 +350,7 @@ public class EipFragment extends Fragment implements Observer {
eipStatus
=
(
EipStatus
)
observable
;
Activity
activity
=
getActivity
();
if
(
activity
!=
null
)
{
activity
.
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
handleNewState
();
}
});
activity
.
runOnUiThread
(()
->
handleNewState
());
}
else
{
Log
.
e
(
"EipFragment"
,
"activity is null"
);
}
...
...
app/src/main/java/se/leap/bitmaskclient/MainActivity.java
View file @
71a97834
...
...
@@ -38,6 +38,7 @@ import se.leap.bitmaskclient.drawer.NavigationDrawerFragment;
import
se.leap.bitmaskclient.eip.EipCommand
;
import
se.leap.bitmaskclient.fragments.LogFragment
;
import
static
se
.
leap
.
bitmaskclient
.
Constants
.
ASK_TO_CANCEL_VPN
;
import
static
se
.
leap
.
bitmaskclient
.
Constants
.
BROADCAST_RESULT_CODE
;
import
static
se
.
leap
.
bitmaskclient
.
Constants
.
BROADCAST_RESULT_KEY
;
import
static
se
.
leap
.
bitmaskclient
.
Constants
.
EIP_ACTION_START
;
...
...
@@ -47,7 +48,6 @@ import static se.leap.bitmaskclient.Constants.REQUEST_CODE_CONFIGURE_LEAP;
import
static
se
.
leap
.
bitmaskclient
.
Constants
.
REQUEST_CODE_LOG_IN
;
import
static
se
.
leap
.
bitmaskclient
.
Constants
.
REQUEST_CODE_SWITCH_PROVIDER
;
import
static
se
.
leap
.
bitmaskclient
.
Constants
.
SHARED_PREFERENCES
;
import
static
se
.
leap
.
bitmaskclient
.
EipFragment
.
ASK_TO_CANCEL_VPN
;
import
static
se
.
leap
.
bitmaskclient
.
ProviderAPI
.
ERRORS
;
import
static
se
.
leap
.
bitmaskclient
.
ProviderAPI
.
INCORRECTLY_DOWNLOADED_EIP_SERVICE
;
import
static
se
.
leap
.
bitmaskclient
.
ProviderAPI
.
INCORRECTLY_UPDATED_INVALID_VPN_CERTIFICATE
;
...
...
app/src/main/java/se/leap/bitmaskclient/VpnNotificationManager.java
View file @
71a97834
...
...
@@ -44,7 +44,7 @@ import static android.text.TextUtils.isEmpty;
import
static
de
.
blinkt
.
openvpn
.
core
.
ConnectionStatus
.
LEVEL_NONETWORK
;
import
static
de
.
blinkt
.
openvpn
.
core
.
ConnectionStatus
.
LEVEL_WAITING_FOR_USER_INPUT
;
import
static
se
.
leap
.
bitmaskclient
.
Constants
.
EIP_ACTION_STOP_BLOCKING_VPN
;
import
static
se
.
leap
.
bitmaskclient
.
EipFragment
.
ASK_TO_CANCEL_VPN
;
import
static
se
.
leap
.
bitmaskclient
.
Constants
.
ASK_TO_CANCEL_VPN
;
import
static
se
.
leap
.
bitmaskclient
.
MainActivity
.
ACTION_SHOW_VPN_FRAGMENT
;
/**
...
...
app/src/main/java/se/leap/bitmaskclient/drawer/NavigationDrawerFragment.java
View file @
71a97834
...
...
@@ -382,31 +382,18 @@ public class NavigationDrawerFragment extends Fragment {
alertDialog
=
alertBuilder
.
setTitle
(
activity
.
getString
(
R
.
string
.
save_battery
))
.
setMessage
(
activity
.
getString
(
R
.
string
.
save_battery_message
))
.
setPositiveButton
((
android
.
R
.
string
.
yes
),
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
DrawerSettingsItem
item
=
settingsListAdapter
.
getDrawerItem
(
BATTERY_SAVER
);
item
.
setChecked
(
true
);
settingsListAdapter
.
notifyDataSetChanged
();
saveBattery
(
getContext
(),
item
.
isChecked
());
}
.
setPositiveButton
((
android
.
R
.
string
.
yes
),
(
dialog
,
which
)
->
{
DrawerSettingsItem
item
=
settingsListAdapter
.
getDrawerItem
(
BATTERY_SAVER
);
item
.
setChecked
(
true
);
settingsListAdapter
.
notifyDataSetChanged
();
saveBattery
(
getContext
(),
item
.
isChecked
());
})
.
setNegativeButton
(
activity
.
getString
(
android
.
R
.
string
.
no
),
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
disableSwitch
(
BATTERY_SAVER
);
}
}).
setOnDismissListener
(
new
DialogInterface
.
OnDismissListener
()
{
.
setNegativeButton
(
activity
.
getString
(
android
.
R
.
string
.
no
),
(
dialog
,
which
)
->
disableSwitch
(
BATTERY_SAVER
)).
setOnDismissListener
(
new
DialogInterface
.
OnDismissListener
()
{
@Override
public
void
onDismiss
(
DialogInterface
dialog
)
{
showEnableExperimentalFeature
=
false
;
}
}).
setOnCancelListener
(
new
DialogInterface
.
OnCancelListener
()
{
@Override
public
void
onCancel
(
DialogInterface
dialog
)
{
disableSwitch
(
BATTERY_SAVER
);
}
}).
show
();
}).
setOnCancelListener
(
dialog
->
disableSwitch
(
BATTERY_SAVER
)).
show
();
}
catch
(
IllegalStateException
e
)
{
e
.
printStackTrace
();
}
...
...
app/src/main/res/values/attrs.xml
0 → 100644
View file @
71a97834
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable
name=
"foo"
>
<attr
name=
"textColorError"
format=
"color"
/>
</declare-styleable>
</resources>
\ No newline at end of file
app/src/main/res/values/themes.xml
View file @
71a97834
...
...
@@ -21,4 +21,8 @@
<item
name=
"android:windowBackground"
>
@drawable/splash_page
</item>
</style>
<style
name=
"foo"
>
<item
name=
"textColorError"
>
@color/colorPrimary
</item>
</style>
</resources>
docker/android-sdk/Dockerfile
View file @
71a97834
FROM
0xacab.org:4567/leap/docker/debian:stretch_amd64
MAINTAINER
LEAP Encryption Access Project <info@leap.se>
LABEL
Description="Android SDK baseimage based on debian:stretch" Vendor="LEAP" Version="2
6
.0.0"
LABEL
Description="Android SDK baseimage based on debian:stretch" Vendor="LEAP" Version="2
7
.0.0"
# ------------------------------------------------------
# --- Install System Dependencies
...
...
@@ -59,11 +59,13 @@ RUN echo y | sdkmanager "platform-tools" # echo y to accept google licenses
RUN
sdkmanager
"extras;android;m2repository"
# Install Build Tools (Please keep in descending order)
RUN
sdkmanager
"build-tools;28.0.3"
RUN
sdkmanager
"build-tools;27.0.3"
RUN
sdkmanager
"build-tools;25.0.2"
RUN
sdkmanager
"build-tools;23.0.3"
# Install Target SDK Packages (Please keep in descending order)
RUN
sdkmanager
"platforms;android-28"
RUN
sdkmanager
"platforms;android-27"
RUN
sdkmanager
"platforms;android-25"
RUN
sdkmanager
"platforms;android-23"
...
...
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