Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
deBeauvoir
samourai-wallet-android
Commits
ca3c8796
Commit
ca3c8796
authored
Aug 21, 2021
by
T Dev. D
😎
Browse files
use boolean for xpubpostxreg metadata
parent
179af9bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
9 deletions
+5
-9
app/src/main/java/com/samourai/wallet/api/APIFactory.java
app/src/main/java/com/samourai/wallet/api/APIFactory.java
+3
-7
app/src/main/java/com/samourai/wallet/payload/PayloadUtil.java
...rc/main/java/com/samourai/wallet/payload/PayloadUtil.java
+2
-2
No files found.
app/src/main/java/com/samourai/wallet/api/APIFactory.java
View file @
ca3c8796
...
...
@@ -2313,9 +2313,8 @@ public class APIFactory {
info
(
"APIFactory"
,
"XPUB:"
+
args
.
toString
());
args
.
append
(
"&at="
);
args
.
append
(
getAccessToken
());
if
(
!
PrefsUtil
.
getInstance
(
context
).
getValue
(
PrefsUtil
.
XPUBPOSTXREG
,
""
).
equals
(
"ok"
)
)
{
if
(
PrefsUtil
.
getInstance
(
context
).
getValue
(
PrefsUtil
.
XPUBPOSTXREG
,
false
)
==
false
)
{
args
.
append
(
"&importPostmixLikeTypeChange=1"
);
PrefsUtil
.
getInstance
(
context
).
setValue
(
PrefsUtil
.
XPUBPOSTXREG
,
"called"
);
}
response
=
WebUtil
.
getInstance
(
context
).
postURL
(
_url
+
"wallet?"
,
args
.
toString
());
info
(
"APIFactory"
,
"XPUB response:"
+
response
);
...
...
@@ -2325,9 +2324,8 @@ public class APIFactory {
args
.
put
(
"active"
,
StringUtils
.
join
(
xpubs
,
"|"
));
info
(
"APIFactory"
,
"XPUB:"
+
args
.
toString
());
args
.
put
(
"at"
,
getAccessToken
());
if
(
!
PrefsUtil
.
getInstance
(
context
).
getValue
(
PrefsUtil
.
XPUBPOSTXREG
,
""
).
equals
(
"ok"
)
)
{
if
(
PrefsUtil
.
getInstance
(
context
).
getValue
(
PrefsUtil
.
XPUBPOSTXREG
,
false
)
==
false
)
{
args
.
put
(
"importPostmixLikeTypeChange"
,
"1"
);
PrefsUtil
.
getInstance
(
context
).
setValue
(
PrefsUtil
.
XPUBPOSTXREG
,
"called"
);
}
response
=
WebUtil
.
getInstance
(
context
).
tor_postURL
(
_url
+
"wallet"
,
args
);
info
(
"APIFactory"
,
"XPUB response:"
+
response
);
...
...
@@ -2534,9 +2532,7 @@ public class APIFactory {
if
(
isWellFormedMultiAddr
(
jsonObject
))
{
try
{
PayloadUtil
.
getInstance
(
context
).
serializeMultiAddrMix
(
jsonObject
);
if
(
PrefsUtil
.
getInstance
(
context
).
getValue
(
PrefsUtil
.
XPUBPOSTXREG
,
""
).
equals
(
"called"
))
{
PrefsUtil
.
getInstance
(
context
).
setValue
(
PrefsUtil
.
XPUBPOSTXREG
,
"ok"
);
}
PrefsUtil
.
getInstance
(
context
).
setValue
(
PrefsUtil
.
XPUBPOSTXREG
,
true
);
}
catch
(
Exception
e
)
{
;
...
...
app/src/main/java/com/samourai/wallet/payload/PayloadUtil.java
View file @
ca3c8796
...
...
@@ -367,7 +367,7 @@ public class PayloadUtil {
meta
.
put
(
"user_offline"
,
AppUtil
.
getInstance
(
context
).
isUserOfflineMode
());
meta
.
put
(
"is_sat"
,
PrefsUtil
.
getInstance
(
context
).
getValue
(
PrefsUtil
.
IS_SAT
,
false
));
meta
.
put
(
"localIndexes"
,
LocalReceiveIndexes
.
getInstance
(
context
).
toJSON
());
meta
.
put
(
"xpubpostxreg"
,
PrefsUtil
.
getInstance
(
context
).
getValue
(
PrefsUtil
.
XPUBPOSTREG
,
""
));
meta
.
put
(
"xpubpostxreg"
,
PrefsUtil
.
getInstance
(
context
).
getValue
(
PrefsUtil
.
XPUBPOSTREG
,
false
));
if
(
DojoUtil
.
getInstance
(
context
).
getDojoParams
()
!=
null
)
{
meta
.
put
(
"dojo"
,
DojoUtil
.
getInstance
(
context
).
toJSON
());
...
...
@@ -707,7 +707,7 @@ public class PayloadUtil {
LocalReceiveIndexes
.
getInstance
(
context
).
fromJSON
((
JSONObject
)
meta
.
get
(
"localIndexes"
));
}
if
(
meta
.
has
(
"xpubpostxreg"
))
{
PrefsUtil
.
getInstance
(
context
).
setValue
(
PrefsUtil
.
XPUBPOSTXREG
,
meta
.
get
String
(
"xpubpostxreg"
));
PrefsUtil
.
getInstance
(
context
).
setValue
(
PrefsUtil
.
XPUBPOSTXREG
,
meta
.
get
Boolean
(
"xpubpostxreg"
));
}
}
...
...
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