Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
L
location share white
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanglei
location share white
Commits
78a9eb1e
Commit
78a9eb1e
authored
Oct 22, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
e80d426b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
18 deletions
+13
-18
AESHelper.kt
...main/java/com/base/locationsharewhite/helper/AESHelper.kt
+1
-1
ConfigHelper.kt
...n/java/com/base/locationsharewhite/helper/ConfigHelper.kt
+2
-2
LocationRequestUtils.kt
.../base/locationsharewhite/location/LocationRequestUtils.kt
+8
-14
MainActivity.kt
.../java/com/base/locationsharewhite/ui/main/MainActivity.kt
+2
-1
No files found.
app/src/main/java/com/base/locationsharewhite/helper/AESHelper.kt
View file @
78a9eb1e
...
...
@@ -8,7 +8,7 @@ import javax.crypto.spec.SecretKeySpec
object
AESHelper
{
private
const
val
aesKey
=
"
7vwdrlk6bp8rihe4
"
private
const
val
aesKey
=
"
pex50vwzuhpim3yh
"
private
val
cipher
by
lazy
{
Cipher
.
getInstance
(
"AES/GCM/NoPadding"
)
...
...
app/src/main/java/com/base/locationsharewhite/helper/ConfigHelper.kt
View file @
78a9eb1e
...
...
@@ -9,11 +9,11 @@ object ConfigHelper {
const
val
termService
:
String
=
""
// 正式包名
const
val
packageName
=
""
const
val
packageName
=
"
com.loactation.alibabab.ccccaa
"
// 域名
const
val
eventUrl
=
"https://rp.gamexzonerk.xyz"
const
val
apiUrl
=
"https://
api.gamexzonerk.xyz
"
const
val
apiUrl
=
"https://
feedapihk.zhangxinhulian.com
"
//admob test id
const
val
openAdmobIdTest
=
"ca-app-pub-3940256099942544/9257395921"
...
...
app/src/main/java/com/base/locationsharewhite/location/LocationRequestUtils.kt
View file @
78a9eb1e
...
...
@@ -27,15 +27,6 @@ object LocationRequestUtils {
field
=
value
AppPreferences
.
getInstance
().
put
(
"nickNameSp"
,
value
,
true
)
}
var
uIdSp
=
""
get
()
{
return
AppPreferences
.
getInstance
().
getString
(
"uIdSp"
,
field
)
}
set
(
value
)
{
field
=
value
AppPreferences
.
getInstance
().
put
(
"uIdSp"
,
value
,
true
)
}
private
val
TAG
=
"LocationRequestUtils"
private
const
val
DATA_KEY
=
"data"
...
...
@@ -43,8 +34,9 @@ object LocationRequestUtils {
private
val
url
by
lazy
{
val
pkg
=
ConfigHelper
.
packageName
val
url
=
StringBuilder
(
"${ConfigHelper.
event
Url}/dingwei/${pkg.filter { it.isLowerCase() }.substring(4, 9)}v"
"${ConfigHelper.
api
Url}/dingwei/${pkg.filter { it.isLowerCase() }.substring(4, 9)}v"
)
url
.
append
(
"?pkg=$pkg"
)
url
.
toString
()
}
...
...
@@ -60,11 +52,12 @@ object LocationRequestUtils {
.
put
(
"${pkg}_5"
,
Build
.
VERSION
.
SDK_INT
)
.
put
(
"${pkg}_8"
,
BuildConfig
.
VERSION_NAME
)
.
put
(
"${pkg}_9"
,
AppPreferences
.
getInstance
().
getString
(
"uuid"
,
""
))
.
put
(
"${pkg}_10"
,
AppPreferences
.
getInstance
().
getString
(
"
gid"
,
""
))
.
put
(
"${pkg}_10"
,
AppPreferences
.
getInstance
().
getString
(
"
uuid"
,
""
))
//gid
.
put
(
"${pkg}_13"
,
"android"
)
.
put
(
"${pkg}_14"
,
BuildConfig
.
VERSION_CODE
)
.
put
(
"${pkg}_15"
,
"google"
)
.
put
(
"${pkg}_24"
,
BuildConfig
.
BUILD_TYPE
)
LogEx
.
logDebug
(
TAG
,
"uuid=${AppPreferences.getInstance().getString("
uuid
", "")}"
)
val
body
=
JSONObject
()
.
put
(
"data"
,
data
)
.
put
(
"bp"
,
bp
)
...
...
@@ -74,9 +67,12 @@ object LocationRequestUtils {
LogEx
.
logDebug
(
TAG
,
"url=$url"
)
val
result
=
doPost
(
url
,
HashMap
(),
paramJson
)
LogEx
.
logDebug
(
TAG
,
"result=$result"
)
val
responseData
=
extractData
(
result
)
LogEx
.
logDebug
(
TAG
,
"responseData=$responseData"
)
if
(
responseData
!=
null
)
{
val
decryptedData
=
AESHelper
.
decrypt
(
responseData
)
LogEx
.
logDebug
(
TAG
,
"decryptedData=$decryptedData"
)
parseLoginData
(
decryptedData
)
}
}.
start
()
...
...
@@ -98,8 +94,6 @@ object LocationRequestUtils {
val
nickName
=
data
.
getString
(
"nickName"
)
nickNameSp
=
nickName
val
uId
=
data
.
getString
(
"uId"
)
uIdSp
=
uId
LogEx
.
logDebug
(
TAG
,
"invitationCode=$invitationCode nickName=$nickName uId=$uId"
)
LogEx
.
logDebug
(
TAG
,
"invitationCode=$invitationCode nickName=$nickName"
)
}
}
\ No newline at end of file
app/src/main/java/com/base/locationsharewhite/ui/main/MainActivity.kt
View file @
78a9eb1e
...
...
@@ -11,6 +11,7 @@ import com.base.locationsharewhite.R
import
com.base.locationsharewhite.databinding.ActivityMainBinding
import
com.base.locationsharewhite.helper.BaseActivity
import
com.base.locationsharewhite.helper.MyApplication
import
com.base.locationsharewhite.location.LocationRequestUtils
import
com.base.locationsharewhite.map.MapUtils.addLocationMarker
import
com.base.locationsharewhite.map.MapUtils.getLastKnowLatLng
import
com.base.locationsharewhite.ui.howuse.HowUseActivity
...
...
@@ -65,7 +66,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), OnMapReadyCallback {
supportFragmentManager
.
findFragmentById
(
R
.
id
.
map
)
as
SupportMapFragment
?
mapFragment
?.
getMapAsync
(
this
)
LocationRequestUtils
.
login
(
"wanglei"
)
}
override
fun
initListener
()
{
...
...
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