Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hds
flexin
android-app
Commits
803b4173
Commit
803b4173
authored
Dec 08, 2017
by
Nastuzzi Samy
Browse files
Merge branch 'release/v0.11.1' into develop
parents
81cecf07
76693134
Changes
5
Hide whitespace changes
Inline
Side-by-side
PayUTC 0.11.
0
.apk
→
PayUTC 0.11.
1
.apk
View file @
803b4173
No preview for this file type
app/src/main/AndroidManifest.xml
View file @
803b4173
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"fr.utc.simde.jessy"
android:versionCode=
"3
3
"
android:versionName=
"0.11.
0
"
>
android:versionCode=
"3
4
"
android:versionName=
"0.11.
1
"
>
<uses-permission
android:name=
"android.permission.NFC"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
...
...
app/src/main/java/fr/utc/simde/jessy/BaseActivity.java
View file @
803b4173
...
...
@@ -252,6 +252,7 @@ public abstract class BaseActivity extends InternetActivity {
}
public
void
startEditActivity
(
final
Activity
activity
)
{
config
.
setInCategory
(
true
);
// Do not allow keyboard modification (not supported yet)
startArticleGroupActivity
(
activity
,
new
Intent
(
activity
,
EditActivity
.
class
));
}
...
...
app/src/main/java/fr/utc/simde/jessy/tools/CASConnexion.java
View file @
803b4173
...
...
@@ -36,7 +36,7 @@ public class CASConnexion {
request
.
addPost
(
"username"
,
username
);
request
.
addPost
(
"password"
,
password
);
if
(
request
.
post
()
==
201
)
if
(
request
.
post
(
false
)
==
201
)
this
.
location
=
request
.
getHeader
(
"Location"
);
else
throw
new
Exception
(
"Not Connected"
);
...
...
@@ -72,7 +72,7 @@ public class CASConnexion {
HTTPRequest
request
=
new
HTTPRequest
(
this
.
location
);
request
.
addPost
(
"service"
,
service
);
if
(
request
.
post
()
==
200
)
if
(
request
.
post
(
false
)
==
200
)
this
.
ticket
=
request
.
getResponse
();
else
throw
new
RuntimeException
(
"Service not added"
);
...
...
app/src/main/java/fr/utc/simde/jessy/tools/HTTPRequest.java
View file @
803b4173
...
...
@@ -85,13 +85,14 @@ public class HTTPRequest {
return
getResponseCode
();
}
public
int
post
()
{
public
int
post
()
{
return
post
(
true
);
}
public
int
post
(
final
Boolean
sendJSON
)
{
String
get
=
null
;
String
post
=
null
;
try
{
get
=
get2String
(
this
.
getArgs
);
post
=
post2String
(
this
.
postArgs
);
post
=
post2String
(
this
.
postArgs
,
sendJSON
);
}
catch
(
Exception
e
)
{
Log
.
e
(
LOG_TAG
,
"error: "
+
e
.
getMessage
());
...
...
@@ -102,7 +103,7 @@ public class HTTPRequest {
try
{
this
.
request
=
(
HttpURLConnection
)
(
new
URL
(
this
.
url
+
get
)).
openConnection
();
this
.
request
.
setRequestMethod
(
"POST"
);
this
.
request
.
setRequestProperty
(
"Content-Type"
,
"application/json"
);
this
.
request
.
setRequestProperty
(
"Content-Type"
,
sendJSON
?
"application/json"
:
"application/x-www-form-urlencoded"
);
this
.
request
.
setRequestProperty
(
"charset"
,
"utf-8"
);
this
.
request
.
setRequestProperty
(
"Cookie"
,
getCookiesHeader
());
this
.
request
.
setUseCaches
(
false
);
...
...
@@ -293,8 +294,16 @@ public class HTTPRequest {
return
data
;
}
protected
String
post2String
(
Map
<
String
,
Object
>
args
)
throws
UnsupportedEncodingException
{
return
map2JsonNode
(
args
).
toString
();
protected
String
post2String
(
Map
<
String
,
Object
>
args
,
boolean
inJSON
)
throws
Exception
{
if
(
inJSON
)
return
map2JsonNode
(
args
).
toString
();
String
data
=
""
;
for
(
String
arg
:
args
.
keySet
())
data
+=
(
URLEncoder
.
encode
(
arg
,
"UTF-8"
)
+
"="
+
URLEncoder
.
encode
((
String
)
args
.
get
(
arg
),
"UTF-8"
)
+
"&"
);
return
data
.
equals
(
""
)
?
""
:
data
.
substring
(
0
,
data
.
length
()
-
1
);
}
public
void
setGet
(
Map
<
String
,
String
>
args
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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