Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
a69e3f54
Commit
a69e3f54
authored
Apr 13, 2017
by
Tiago Cunha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Necessary tooling update. Initital setup work for 2FA
parent
94beac85
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
43 additions
and
6 deletions
+43
-6
build.gradle
android-ddp/build.gradle
+1
-1
build.gradle
app/build.gradle
+1
-1
MethodCallHelper.java
...c/main/java/chat/rocket/android/api/MethodCallHelper.java
+6
-0
TwoStepAuthException.java
...in/java/chat/rocket/android/api/TwoStepAuthException.java
+16
-0
LoginContract.java
.../rocket/android/fragment/server_config/LoginContract.java
+2
-0
LoginFragment.java
.../rocket/android/fragment/server_config/LoginFragment.java
+5
-0
LoginPresenter.java
...rocket/android/fragment/server_config/LoginPresenter.java
+9
-1
build.gradle
log-wrapper/build.gradle
+1
-1
build.gradle
persistence-realm/build.gradle
+1
-1
build.gradle
rocket-chat-android-widgets/build.gradle
+1
-1
No files found.
android-ddp/build.gradle
View file @
a69e3f54
...
...
@@ -6,7 +6,7 @@ buildscript {
jcenter
()
}
dependencies
{
classpath
'com.android.tools.build:gradle:2.3.
0
'
classpath
'com.android.tools.build:gradle:2.3.
1
'
classpath
'me.tatarka:gradle-retrolambda:3.5.0'
classpath
'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2'
}
...
...
app/build.gradle
View file @
a69e3f54
...
...
@@ -10,7 +10,7 @@ buildscript {
mavenCentral
()
}
dependencies
{
classpath
'com.android.tools.build:gradle:2.3.
0
'
classpath
'com.android.tools.build:gradle:2.3.
1
'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
...
...
app/src/main/java/chat/rocket/android/api/MethodCallHelper.java
View file @
a69e3f54
...
...
@@ -82,7 +82,13 @@ public class MethodCallHelper {
if
(
TextUtils
.
isEmpty
(
errMessageJson
))
{
return
Task
.
forError
(
exception
);
}
String
errType
=
new
JSONObject
(
errMessageJson
).
getString
(
"error"
);
String
errMessage
=
new
JSONObject
(
errMessageJson
).
getString
(
"message"
);
if
(
TwoStepAuthException
.
TYPE
.
equals
(
errType
))
{
return
Task
.
forError
(
new
TwoStepAuthException
(
errMessage
));
}
return
Task
.
forError
(
new
Exception
(
errMessage
));
}
else
if
(
exception
instanceof
DDPClientCallback
.
RPC
.
Error
)
{
String
errMessage
=
((
DDPClientCallback
.
RPC
.
Error
)
exception
).
error
.
getString
(
"message"
);
...
...
app/src/main/java/chat/rocket/android/api/TwoStepAuthException.java
0 → 100644
View file @
a69e3f54
package
chat
.
rocket
.
android
.
api
;
public
class
TwoStepAuthException
extends
Exception
{
public
static
final
String
TYPE
=
"totp-required"
;
private
static
final
long
serialVersionUID
=
7063596902054234189L
;
public
TwoStepAuthException
()
{
super
();
}
public
TwoStepAuthException
(
String
message
)
{
super
(
message
);
}
}
app/src/main/java/chat/rocket/android/fragment/server_config/LoginContract.java
View file @
a69e3f54
...
...
@@ -15,6 +15,8 @@ public interface LoginContract {
void
showError
(
String
message
);
void
showLoginServices
(
List
<
LoginServiceConfiguration
>
loginServiceList
);
void
showTwoStepAuth
();
}
interface
Presenter
extends
BaseContract
.
Presenter
<
View
>
{
...
...
app/src/main/java/chat/rocket/android/fragment/server_config/LoginFragment.java
View file @
a69e3f54
...
...
@@ -115,6 +115,11 @@ public class LoginFragment extends AbstractServerConfigFragment implements Login
}
}
@Override
public
void
showTwoStepAuth
()
{
//
}
@Override
public
void
onResume
()
{
super
.
onResume
();
...
...
app/src/main/java/chat/rocket/android/fragment/server_config/LoginPresenter.java
View file @
a69e3f54
...
...
@@ -8,6 +8,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
import
bolts.Task
;
import
chat.rocket.android.BackgroundLooper
;
import
chat.rocket.android.api.MethodCallHelper
;
import
chat.rocket.android.api.TwoStepAuthException
;
import
chat.rocket.android.helper.Logger
;
import
chat.rocket.android.helper.TextUtils
;
import
chat.rocket.android.shared.BasePresenter
;
...
...
@@ -74,7 +75,14 @@ public class LoginPresenter extends BasePresenter<LoginContract.View>
.
continueWith
(
task
->
{
if
(
task
.
isFaulted
())
{
view
.
hideLoader
();
view
.
showError
(
task
.
getError
().
getMessage
());
final
Exception
error
=
task
.
getError
();
if
(
error
instanceof
TwoStepAuthException
)
{
view
.
showTwoStepAuth
();
}
else
{
view
.
showError
(
error
.
getMessage
());
}
}
return
null
;
});
...
...
log-wrapper/build.gradle
View file @
a69e3f54
...
...
@@ -5,7 +5,7 @@ buildscript {
jcenter
()
}
dependencies
{
classpath
'com.android.tools.build:gradle:2.3.
0
'
classpath
'com.android.tools.build:gradle:2.3.
1
'
}
}
...
...
persistence-realm/build.gradle
View file @
a69e3f54
...
...
@@ -8,7 +8,7 @@ buildscript {
jcenter
()
}
dependencies
{
classpath
'com.android.tools.build:gradle:2.3.
0
'
classpath
'com.android.tools.build:gradle:2.3.
1
'
classpath
'io.realm:realm-gradle-plugin:2.3.2'
classpath
'me.tatarka:gradle-retrolambda:3.5.0'
classpath
'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2'
...
...
rocket-chat-android-widgets/build.gradle
View file @
a69e3f54
...
...
@@ -5,7 +5,7 @@ buildscript {
jcenter
()
}
dependencies
{
classpath
'com.android.tools.build:gradle:2.3.
0
'
classpath
'com.android.tools.build:gradle:2.3.
1
'
}
}
...
...
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