Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F10360523
set_geo.sh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
994 B
Referenced Files
None
Subscribers
None
set_geo.sh
View Options
#!/bin/bash
error_msg
=
$((
echo
"auth
$(
cat
~/.emulator_console_auth_token
)
"
echo
"geo fix
$1
$2
0.0"
sleep
0
.2
)
|
telnet
localhost
5554
2
>
/
dev/null
|
grep
KO:
)
;
sleep
1
# Technically the phone supports (prints) 6 digits of precision,
# but the last one is subject to weird rounding, so just checking the first 5
new_1
=
$(
printf
"%.5f"
$1
)
new_2
=
$(
printf
"%.5f"
$2
)
correct
=
${
new_2
}
,
${
new_1
}
if
[
-
z
"
${
error_msg
}
"
]
;
then
# Check if the location was actually set, for some reason the location moching doesn't work,
# unless google maps is launched first, and is given access to the phone location
out
=
$(
.
/conf/get_location.sh
)
;
curr_1
=
$(
printf
"%.5f"
$(
echo
$out
|
sed
's/.*,//'
))
curr_2
=
$(
printf
"%.5f"
$(
echo
$out
|
sed
's/,.*//'
))
if
[[
"
$curr_1
"
!
=
"
$new_1
"
||
"
$curr_2
"
!
=
"
$new_2
"
]]
;
then
echo
Failed
to
actually
set
the
location,
but
detected
a
prev
location
set
exit
1
fi
echo
Succesfully
set
the
coordinates
to:
$out
exit
0
else
echo
"
$error_msg
"
exit
2
;
fi
File Metadata
Details
Attached
Mime Type
text/x-shellscript
Expires
Sat, Nov 8, 07:09 (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1034266
Default Alt Text
set_geo.sh (994 B)
Attached To
Mode
R134 rentgen-android
Attached
Detach File
Event Timeline
Log In to Comment