Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenFlipper-Free
OpenFlipper-Free
Commits
9106bf17
Commit
9106bf17
authored
Nov 20, 2015
by
Jan Möbius
Browse files
Some cleanup
parent
34de1965
Changes
1
Hide whitespace changes
Inline
Side-by-side
OpenFlipper/LicenseManager/LicenseManagerActive.cc
View file @
9106bf17
...
...
@@ -131,8 +131,6 @@ void LicenseManager::blockSignals( bool _state) {
}
bool
LicenseManager
::
timestampOk
()
{
bool
notExpired
=
false
;
...
...
@@ -144,18 +142,17 @@ bool LicenseManager::timestampOk() {
quint64
lastTimestampEntryNum
=
0
;
// ===============================================================================================
// Read last Timestemp
// ===============================================================================================
QString
title
=
"Timestamp/"
+
pluginFileName
();
const
QString
title
=
"Timestamp/"
+
pluginFileName
();
QString
lastTimestampEntry
=
OpenFlipperSettings
().
value
(
title
,
"empty"
).
toString
();
if
(
lastTimestampEntry
==
QString
(
"empty"
)){
if
(
lastTimestampEntry
==
QString
(
"empty"
)
){
notExpired
=
true
;
}
else
{
}
else
{
lastTimestampEntryNum
=
lastTimestampEntry
.
toULongLong
(
&
gotTimestampEntry
,
16
);
}
...
...
@@ -163,13 +160,13 @@ bool LicenseManager::timestampOk() {
// Decrypt last Timestamp
// ===============================================================================================
u
int
factor
=
30000
;
std
::
string
name
=
pluginFileName
().
toStdString
();
u
int
moduloFactor
=
72
;
//<100
int
nameSize
=
pluginFileName
().
size
();
int
nameEncr
=
(
name
[
0
])
+
(
name
[
nameSize
-
1
])
+
(
name
[(
nameSize
-
1
)
/
2
]);
const
unsigned
int
factor
=
30000
;
const
std
::
string
name
=
pluginFileName
().
toStdString
();
const
unsigned
int
moduloFactor
=
72
;
//<100
const
int
nameSize
=
pluginFileName
().
size
();
const
int
nameEncr
=
(
name
[
0
]
)
+
(
name
[
nameSize
-
1
]
)
+
(
name
[(
nameSize
-
1
)
/
2
]
);
bool
moduloOK
=
(
lastTimestampEntryNum
-
(
100
*
(
lastTimestampEntryNum
/
100
)
)
==
(
lastTimestampEntryNum
/
100
)
%
moduloFactor
);
bool
moduloOK
=
(
lastTimestampEntryNum
-
(
100
*
(
lastTimestampEntryNum
/
100
)
)
==
(
lastTimestampEntryNum
/
100
)
%
moduloFactor
);
lastTimestampEntryNum
=
lastTimestampEntryNum
/
100
;
lastTimestampEntryNum
=
lastTimestampEntryNum
-
nameEncr
;
...
...
@@ -181,7 +178,7 @@ bool LicenseManager::timestampOk() {
// Check last Timestemp
// ===============================================================================================
if
(
notExpired
||
(
timestamp
>
(
lastTimestamp
-
360000
)
&&
moduloOK
))
{
if
(
notExpired
||
(
timestamp
>
(
lastTimestamp
-
360000
)
&&
moduloOK
))
{
notExpired
=
true
;
}
else
{
timestamp
=
std
::
numeric_limits
<
quint64
>::
max
();
...
...
Write
Preview
Supports
Markdown
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