Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
QR-code-reader
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AE
QR-code-reader
Commits
8223fc1f
Commit
8223fc1f
authored
Oct 17, 2016
by
djamel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
utilise le nouveau format (id client, id produit, id transaction) pour dechiffrer le code billet
parent
f662c4dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
Development/app/src/main/java/djamelfel/gala/Read_QR_Code.java
...opment/app/src/main/java/djamelfel/gala/Read_QR_Code.java
+11
-7
No files found.
Development/app/src/main/java/djamelfel/gala/Read_QR_Code.java
View file @
8223fc1f
...
...
@@ -129,14 +129,17 @@ public class Read_QR_Code extends ActionBarActivity implements View.OnClickListe
public
void
validateTicket
(
String
result
)
{
final
String
str
[]
=
result
.
split
(
" "
);
int
idTicket
=
Integer
.
parseInt
(
str
[
1
]);
int
nbrPlaceTicket
=
Integer
.
parseInt
(
str
[
2
]);
int
nbrPlaceSelect
=
Integer
.
parseInt
(
_nbrPlace
.
getText
().
toString
());
int
nbrPlaceTot
=
Integer
.
parseInt
(
str
[
2
]);
int
nbrPlaceTot
=
Integer
.
parseInt
(
str
[
3
]);
String
keyTicket
=
str
[
4
];
Boolean
idFound
=
false
;
// Reset to default number of place
_nbrPlace
.
setText
(
"1"
,
TextView
.
BufferType
.
EDITABLE
);
if
(
Integer
.
parseInt
(
str
[
2
])
<
nbrPlaceSelect
)
{
if
(
nbrPlaceTicket
<
nbrPlaceSelect
)
{
display
(
getString
(
R
.
string
.
nbPlaceOversize
),
false
);
return
;
}
...
...
@@ -145,19 +148,20 @@ public class Read_QR_Code extends ActionBarActivity implements View.OnClickListe
while
(
itr
.
hasNext
())
{
Key_List
key
=
itr
.
next
();
if
(
key
.
getId
()
==
Integer
.
parseInt
(
str
[
1
])
)
{
if
(
key
.
getId
()
==
idTicket
)
{
// generate HMAC in hex
String
hmac
=
hmacDigest
(
str
[
0
]+
" "
+
str
[
1
]+
" "
+
str
[
2
],
key
.
getKey
(),
"HmacSHA1"
);
String
hmac
=
hmacDigest
(
str
[
0
]+
" "
+
str
[
1
]+
" "
+
str
[
2
]
+
" "
+
str
[
3
],
key
.
getKey
(),
"HmacSHA1"
);
if
(
str
[
3
]
.
equals
(
hmac
.
substring
(
0
,
8
).
toUpperCase
()))
{
if
(
keyTicket
.
equals
(
hmac
.
substring
(
0
,
8
).
toUpperCase
()))
{
// Ticket is valid
idFound
=
true
;
if
(
key
.
getIs_child
())
{
showChildDialog
(
Read_QR_Code
.
this
,
str
[
3
]
,
nbrPlaceTot
,
nbrPlaceSelect
);
showChildDialog
(
Read_QR_Code
.
this
,
keyTicket
,
nbrPlaceTot
,
nbrPlaceSelect
);
}
else
{
sendRequest
(
str
[
3
]
,
nbrPlaceTot
,
nbrPlaceSelect
);
sendRequest
(
keyTicket
,
nbrPlaceTot
,
nbrPlaceSelect
);
}
}
}
...
...
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