Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_freeworld
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_freeworld
Commits
196713fe
Commit
196713fe
authored
Jul 09, 2021
by
mengcuiguang2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化网络架构
parent
5ece9c32
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
337 additions
and
368 deletions
+337
-368
build.gradle
app/build.gradle
+0
-1
sun.misc.BASE64Decoder.jar
app/libs/sun.misc.BASE64Decoder.jar
+0
-0
ExampleInstrumentedTest.java
...idTest/java/com/mints/street/ExampleInstrumentedTest.java
+9
-16
MainActivity.kt
app/src/main/java/com/mints/street/main/MainActivity.kt
+23
-1
ApiModel.kt
app/src/main/java/com/mints/street/model/ApiModel.kt
+1
-1
HttpManager.java
app/src/main/java/com/mints/street/netwrok/HttpManager.java
+1
-1
OkHttpInterceptor.kt
...c/main/java/com/mints/street/netwrok/OkHttpInterceptor.kt
+4
-3
SplashActivity.kt
app/src/main/java/com/mints/street/splash/SplashActivity.kt
+1
-3
AESUtils.java
app/src/main/java/com/mints/street/utils/encry/AESUtils.java
+2
-3
Base64.java
app/src/main/java/com/mints/street/utils/encry/Base64.java
+127
-127
Des3.java
app/src/main/java/com/mints/street/utils/encry/Des3.java
+96
-96
MD5.java
app/src/main/java/com/mints/street/utils/encry/MD5.java
+63
-63
gradle.properties
gradle.properties
+1
-1
build.gradle
library_base/build.gradle
+1
-1
BaseModuleInit.java
..._base/src/main/java/com/fry/base/base/BaseModuleInit.java
+4
-6
RetrofitClient.java
...rc/main/java/com/fry/base/basenetwork/RetrofitClient.java
+1
-3
Constants.java
...ary_base/src/main/java/com/fry/base/global/Constants.java
+0
-16
IFlutterProvider.kt
...e/src/main/java/com/fry/base/provider/IFlutterProvider.kt
+0
-23
version.properties
library_base/version.properties
+2
-2
compile-file-map.properties
...emental/packageDebugResources/compile-file-map.properties
+1
-1
No files found.
app/build.gradle
View file @
196713fe
...
...
@@ -135,7 +135,6 @@ android {
dependencies
{
implementation
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
testImplementation
rootProject
.
ext
.
support
[
"junit"
]
//下拉刷新
...
...
library_base
/libs/sun.misc.BASE64Decoder.jar
→
app
/libs/sun.misc.BASE64Decoder.jar
100755 → 100644
View file @
196713fe
File moved
app/src/androidTest/java/com/mints/street/ExampleInstrumentedTest.java
View file @
196713fe
...
...
@@ -2,25 +2,18 @@ package com.mints.street;
import
android.content.Context
;
import
androidx.test.platform.app.InstrumentationRegistry
;
import
androidx.test.ext.junit.runners.AndroidJUnit4
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
static
org
.
junit
.
Assert
.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith
(
AndroidJUnit4
.
class
)
public
class
ExampleInstrumentedTest
{
@Test
public
void
useAppContext
()
{
// Context of the app under test.
Context
appContext
=
InstrumentationRegistry
.
getInstrumentation
().
getTargetContext
();
assertEquals
(
"com.mints.goodnews"
,
appContext
.
getPackageName
());
}
}
\ No newline at end of file
//@RunWith(AndroidJUnit4.class)
//public class ExampleInstrumentedTest {
// @Test
// public void useAppContext() {
// // Context of the app under test.
// Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
// assertEquals("com.mints.goodnews", appContext.getPackageName());
// }
//}
\ No newline at end of file
app/src/main/java/com/mints/street/main/MainActivity.kt
View file @
196713fe
package
com.mints.street.main
import
android.media.AudioManager
import
android.os.Bundle
import
android.view.KeyEvent
import
android.view.View
import
android.view.ViewGroup
import
androidx.fragment.app.Fragment
...
...
@@ -16,7 +18,9 @@ import com.mints.street.databinding.ActivityMainBinding
import
com.mints.street.main.vr.VRFragment
import
com.mints.street.main.my.MyFragment
import
com.mints.street.main.home.HomeFragment
import
com.mints.street.manager.UmengManager
import
me.goldze.mvvmhabit.base.AppManager
import
me.goldze.mvvmhabit.utils.ToastUtils
class
MainActivity
:
BaseActivity
<
ActivityMainBinding
,
MainViewModel
>()
{
...
...
@@ -52,8 +56,26 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
)
// test
UmengManager
.
initUm
()
}
var
oldTime
:
Long
=
0
override
fun
onKeyDown
(
keyCode
:
Int
,
event
:
KeyEvent
):
Boolean
{
when
(
keyCode
)
{
KeyEvent
.
KEYCODE_BACK
->
{
// 设置为后台
val
currentTime
=
System
.
currentTimeMillis
()
if
(
currentTime
-
oldTime
<
2
*
1000
)
{
AppManager
.
getAppManager
().
finishAllActivity
()
}
else
{
ToastUtils
.
showLong
(
"再次点击退出"
+
getString
(
R
.
string
.
app_name
))
oldTime
=
currentTime
}
}
}
return
true
}
}
...
...
app/src/main/java/com/mints/street/model/ApiModel.kt
View file @
196713fe
package
com.mints.street.model
import
com.fry.base.netwrok.HttpManager
import
com.mints.street.api.MainApi
import
com.mints.street.bean.AwardBean
import
com.mints.street.bean.UserBean
import
com.mints.street.netwrok.HttpManager
import
com.trello.rxlifecycle2.LifecycleProvider
import
io.reactivex.Observable
import
me.goldze.mvvmhabit.http.BaseResponse
...
...
app/src/main/java/com/mints/street/netwrok/HttpManager.java
View file @
196713fe
...
...
@@ -7,7 +7,7 @@ import com.fry.base.basenetwork.IHttpResponseListener;
import
com.fry.base.basenetwork.RetrofitClient
;
import
com.fry.base.global.Constants
;
import
com.fry.base.netwrok.OkHttpInterceptor
;
import
com.
fry.base
.utils.encry.AESUtils
;
import
com.
mints.street
.utils.encry.AESUtils
;
import
com.trello.rxlifecycle2.LifecycleProvider
;
import
io.reactivex.Observable
;
...
...
app/src/main/java/com/mints/street/netwrok/OkHttpInterceptor.kt
View file @
196713fe
...
...
@@ -4,13 +4,14 @@ import android.text.TextUtils
import
android.util.Log
import
com.bytedance.hume.readapk.HumeSDK
import
com.fry.base.bean.AppRequest
import
com.fry.base.utils.encry.AESUtils
import
com.fry.base.utils.encry.Base64
import
com.fry.base.utils.encry.MD5
import
com.google.gson.Gson
import
com.mints.street.AppApplication
import
com.mints.street.BuildConfig
import
com.mints.street.manager.UserManager
import
com.mints.street.utils.CommonUtils
import
com.mints.street.utils.encry.AESUtils
import
com.mints.street.utils.encry.Base64
import
com.mints.street.utils.encry.MD5
import
okhttp3.*
import
okio.Buffer
import
org.json.JSONObject
...
...
app/src/main/java/com/mints/street/splash/SplashActivity.kt
View file @
196713fe
...
...
@@ -129,9 +129,7 @@ class SplashActivity:BaseActivity<ActivitySplashBinding,SplashViewModel>() {
}
override
fun
onSplashAdLoadSuccess
()
{
if
(
mTTSplashAd
!=
null
)
{
mTTSplashAd
!!
.
showAd
(
mSplashContainer
)
}
mTTSplashAd
?.
showAd
(
mSplashContainer
)
}
override
fun
onAdLoadTimeout
()
{
...
...
library_base/src/main/java/com/fry/base
/utils/encry/AESUtils.java
→
app/src/main/java/com/mints/street
/utils/encry/AESUtils.java
100755 → 100644
View file @
196713fe
package
com
.
fry
.
base
.
utils
.
encry
;
import
android.util.Log
;
package
com
.
mints
.
street
.
utils
.
encry
;
import
com.fry.base.BuildConfig
;
...
...
@@ -12,6 +10,7 @@ import javax.crypto.spec.SecretKeySpec;
import
Decoder.BASE64Decoder
;
import
Decoder.BASE64Encoder
;
public
class
AESUtils
{
private
static
final
String
vis
=
MD5
.
GetMD5Code
(
"street_2021"
).
substring
(
8
,
24
);
...
...
library_base/src/main/java/com/fry/base
/utils/encry/Base64.java
→
app/src/main/java/com/mints/street
/utils/encry/Base64.java
100755 → 100644
View file @
196713fe
package
com
.
fry
.
base
.
utils
.
encry
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.io.OutputStream
;
/**
* Base64编码工具类
*
* @author
* @date 2012-10-11
*/
public
class
Base64
{
private
static
final
char
[]
legalChars
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
.
toCharArray
();
public
static
String
encode
(
byte
[]
data
)
{
int
start
=
0
;
int
len
=
data
.
length
;
StringBuffer
buf
=
new
StringBuffer
(
data
.
length
*
3
/
2
);
int
end
=
len
-
3
;
int
i
=
start
;
int
n
=
0
;
while
(
i
<=
end
)
{
int
d
=
((((
int
)
data
[
i
])
&
0x0ff
)
<<
16
)
|
((((
int
)
data
[
i
+
1
])
&
0x0ff
)
<<
8
)
|
(((
int
)
data
[
i
+
2
])
&
0x0ff
);
buf
.
append
(
legalChars
[(
d
>>
18
)
&
63
]);
buf
.
append
(
legalChars
[(
d
>>
12
)
&
63
]);
buf
.
append
(
legalChars
[(
d
>>
6
)
&
63
]);
buf
.
append
(
legalChars
[
d
&
63
]);
i
+=
3
;
if
(
n
++
>=
14
)
{
n
=
0
;
buf
.
append
(
" "
);
}
}
if
(
i
==
start
+
len
-
2
)
{
int
d
=
((((
int
)
data
[
i
])
&
0x0ff
)
<<
16
)
|
((((
int
)
data
[
i
+
1
])
&
255
)
<<
8
);
buf
.
append
(
legalChars
[(
d
>>
18
)
&
63
]);
buf
.
append
(
legalChars
[(
d
>>
12
)
&
63
]);
buf
.
append
(
legalChars
[(
d
>>
6
)
&
63
]);
buf
.
append
(
"="
);
}
else
if
(
i
==
start
+
len
-
1
)
{
int
d
=
(((
int
)
data
[
i
])
&
0x0ff
)
<<
16
;
buf
.
append
(
legalChars
[(
d
>>
18
)
&
63
]);
buf
.
append
(
legalChars
[(
d
>>
12
)
&
63
]);
buf
.
append
(
"=="
);
}
return
buf
.
toString
();
}
private
static
int
decode
(
char
c
)
{
if
(
c
>=
'A'
&&
c
<=
'Z'
)
return
((
int
)
c
)
-
65
;
else
if
(
c
>=
'a'
&&
c
<=
'z'
)
return
((
int
)
c
)
-
97
+
26
;
else
if
(
c
>=
'0'
&&
c
<=
'9'
)
return
((
int
)
c
)
-
48
+
26
+
26
;
else
switch
(
c
)
{
case
'+'
:
return
62
;
case
'/'
:
return
63
;
case
'='
:
return
0
;
default
:
throw
new
RuntimeException
(
"unexpected code: "
+
c
);
}
}
/**
* Decodes the given Base64 encoded String to a new byte array. The byte array holding the decoded data is returned.
*/
public
static
byte
[]
decode
(
String
s
)
{
ByteArrayOutputStream
bos
=
new
ByteArrayOutputStream
();
try
{
decode
(
s
,
bos
);
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
();
}
byte
[]
decodedBytes
=
bos
.
toByteArray
();
try
{
bos
.
close
();
bos
=
null
;
}
catch
(
IOException
ex
)
{
System
.
err
.
println
(
"Error while decoding BASE64: "
+
ex
.
toString
());
}
return
decodedBytes
;
}
private
static
void
decode
(
String
s
,
OutputStream
os
)
throws
IOException
{
int
i
=
0
;
int
len
=
s
.
length
();
while
(
true
)
{
while
(
i
<
len
&&
s
.
charAt
(
i
)
<=
' '
)
i
++;
if
(
i
==
len
)
break
;
int
tri
=
(
decode
(
s
.
charAt
(
i
))
<<
18
)
+
(
decode
(
s
.
charAt
(
i
+
1
))
<<
12
)
+
(
decode
(
s
.
charAt
(
i
+
2
))
<<
6
)
+
(
decode
(
s
.
charAt
(
i
+
3
)));
os
.
write
((
tri
>>
16
)
&
255
);
if
(
s
.
charAt
(
i
+
2
)
==
'='
)
break
;
os
.
write
((
tri
>>
8
)
&
255
);
if
(
s
.
charAt
(
i
+
3
)
==
'='
)
break
;
os
.
write
(
tri
&
255
);
i
+=
4
;
}
}
}
package
com
.
mints
.
street
.
utils
.
encry
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.io.OutputStream
;
/**
* Base64编码工具类
*
* @author
* @date 2012-10-11
*/
public
class
Base64
{
private
static
final
char
[]
legalChars
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
.
toCharArray
();
public
static
String
encode
(
byte
[]
data
)
{
int
start
=
0
;
int
len
=
data
.
length
;
StringBuffer
buf
=
new
StringBuffer
(
data
.
length
*
3
/
2
);
int
end
=
len
-
3
;
int
i
=
start
;
int
n
=
0
;
while
(
i
<=
end
)
{
int
d
=
((((
int
)
data
[
i
])
&
0x0ff
)
<<
16
)
|
((((
int
)
data
[
i
+
1
])
&
0x0ff
)
<<
8
)
|
(((
int
)
data
[
i
+
2
])
&
0x0ff
);
buf
.
append
(
legalChars
[(
d
>>
18
)
&
63
]);
buf
.
append
(
legalChars
[(
d
>>
12
)
&
63
]);
buf
.
append
(
legalChars
[(
d
>>
6
)
&
63
]);
buf
.
append
(
legalChars
[
d
&
63
]);
i
+=
3
;
if
(
n
++
>=
14
)
{
n
=
0
;
buf
.
append
(
" "
);
}
}
if
(
i
==
start
+
len
-
2
)
{
int
d
=
((((
int
)
data
[
i
])
&
0x0ff
)
<<
16
)
|
((((
int
)
data
[
i
+
1
])
&
255
)
<<
8
);
buf
.
append
(
legalChars
[(
d
>>
18
)
&
63
]);
buf
.
append
(
legalChars
[(
d
>>
12
)
&
63
]);
buf
.
append
(
legalChars
[(
d
>>
6
)
&
63
]);
buf
.
append
(
"="
);
}
else
if
(
i
==
start
+
len
-
1
)
{
int
d
=
(((
int
)
data
[
i
])
&
0x0ff
)
<<
16
;
buf
.
append
(
legalChars
[(
d
>>
18
)
&
63
]);
buf
.
append
(
legalChars
[(
d
>>
12
)
&
63
]);
buf
.
append
(
"=="
);
}
return
buf
.
toString
();
}
private
static
int
decode
(
char
c
)
{
if
(
c
>=
'A'
&&
c
<=
'Z'
)
return
((
int
)
c
)
-
65
;
else
if
(
c
>=
'a'
&&
c
<=
'z'
)
return
((
int
)
c
)
-
97
+
26
;
else
if
(
c
>=
'0'
&&
c
<=
'9'
)
return
((
int
)
c
)
-
48
+
26
+
26
;
else
switch
(
c
)
{
case
'+'
:
return
62
;
case
'/'
:
return
63
;
case
'='
:
return
0
;
default
:
throw
new
RuntimeException
(
"unexpected code: "
+
c
);
}
}
/**
* Decodes the given Base64 encoded String to a new byte array. The byte array holding the decoded data is returned.
*/
public
static
byte
[]
decode
(
String
s
)
{
ByteArrayOutputStream
bos
=
new
ByteArrayOutputStream
();
try
{
decode
(
s
,
bos
);
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
();
}
byte
[]
decodedBytes
=
bos
.
toByteArray
();
try
{
bos
.
close
();
bos
=
null
;
}
catch
(
IOException
ex
)
{
System
.
err
.
println
(
"Error while decoding BASE64: "
+
ex
.
toString
());
}
return
decodedBytes
;
}
private
static
void
decode
(
String
s
,
OutputStream
os
)
throws
IOException
{
int
i
=
0
;
int
len
=
s
.
length
();
while
(
true
)
{
while
(
i
<
len
&&
s
.
charAt
(
i
)
<=
' '
)
i
++;
if
(
i
==
len
)
break
;
int
tri
=
(
decode
(
s
.
charAt
(
i
))
<<
18
)
+
(
decode
(
s
.
charAt
(
i
+
1
))
<<
12
)
+
(
decode
(
s
.
charAt
(
i
+
2
))
<<
6
)
+
(
decode
(
s
.
charAt
(
i
+
3
)));
os
.
write
((
tri
>>
16
)
&
255
);
if
(
s
.
charAt
(
i
+
2
)
==
'='
)
break
;
os
.
write
((
tri
>>
8
)
&
255
);
if
(
s
.
charAt
(
i
+
3
)
==
'='
)
break
;
os
.
write
(
tri
&
255
);
i
+=
4
;
}
}
}
library_base/src/main/java/com/fry/base
/utils/encry/Des3.java
→
app/src/main/java/com/mints/street
/utils/encry/Des3.java
100755 → 100644
View file @
196713fe
package
com
.
fry
.
base
.
utils
.
encry
;
import
android.util.Log
;
import
java.net.URLDecoder
;
import
java.net.URLEncoder
;
import
java.security.Key
;
import
javax.crypto.Cipher
;
import
javax.crypto.SecretKeyFactory
;
import
javax.crypto.spec.DESedeKeySpec
;
import
javax.crypto.spec.IvParameterSpec
;
/**
* 描述:3DES加密工具类
* 作者:孟崔广
* 时间:2018/3/29 17:51
* 邮箱:mengcga@163.com
*/
public
class
Des3
{
// crediteasec@lx100$#365#$
// 密钥
// private final static String secretKey = "mail.asiainfo.com@2x222$#bbb#2";
// 向量
private
final
static
String
iv
=
"01234567"
;
// 加解密统一使用的编码方式
private
final
static
String
encoding
=
"utf-8"
;
private
static
String
TAG
=
"Des3"
;
/**
* 3DES加密
*
* @param plainText 普通文本
* @return
* @throws Exception
*/
public
static
String
encode
(
String
plainText
,
String
secretKey
)
{
String
ciphertext
=
""
;
if
(
plainText
!=
null
&&
plainText
.
length
()
!=
0
)
{
Key
deskey
=
null
;
byte
[]
encryptData
=
null
;
try
{
byte
[]
bytes
=
secretKey
.
getBytes
();
DESedeKeySpec
spec
=
new
DESedeKeySpec
(
bytes
);
SecretKeyFactory
keyfactory
=
SecretKeyFactory
.
getInstance
(
"desede"
);
deskey
=
keyfactory
.
generateSecret
(
spec
);
Cipher
cipher
=
Cipher
.
getInstance
(
"desede/CBC/PKCS5Padding"
);
IvParameterSpec
ips
=
new
IvParameterSpec
(
iv
.
getBytes
());
cipher
.
init
(
Cipher
.
ENCRYPT_MODE
,
deskey
,
ips
);
encryptData
=
cipher
.
doFinal
(
plainText
.
getBytes
(
encoding
));
ciphertext
=
Base64
.
encode
(
encryptData
);
//这里需要对特殊字符串进行转码
ciphertext
=
URLEncoder
.
encode
(
ciphertext
,
"utf-8"
);
}
catch
(
Exception
e
)
{
Log
.
e
(
TAG
,
e
.
getMessage
().
toString
());
e
.
printStackTrace
();
}
}
return
ciphertext
;
}
/**
* 3DES解密
*
* @param encryptText 加密文本
* @return
* @throws Exception
*/
public
static
String
decode
(
String
encryptText
,
String
secretKey
)
{
String
clearText
=
""
;
if
(
encryptText
!=
null
&&
encryptText
.
length
()
!=
0
)
{
Key
deskey
=
null
;
byte
[]
decryptData
;
try
{
//这里需要对特殊字符串进行转码
encryptText
=
URLDecoder
.
decode
(
encryptText
,
"utf-8"
);
DESedeKeySpec
spec
=
new
DESedeKeySpec
(
secretKey
.
getBytes
());
SecretKeyFactory
keyfactory
=
SecretKeyFactory
.
getInstance
(
"desede"
);
deskey
=
keyfactory
.
generateSecret
(
spec
);
Cipher
cipher
=
Cipher
.
getInstance
(
"desede/CBC/PKCS5Padding"
);
IvParameterSpec
ips
=
new
IvParameterSpec
(
iv
.
getBytes
());
cipher
.
init
(
Cipher
.
DECRYPT_MODE
,
deskey
,
ips
);
decryptData
=
cipher
.
doFinal
(
Base64
.
decode
(
encryptText
));
clearText
=
new
String
(
decryptData
,
encoding
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
return
clearText
;
}
}
package
com
.
mints
.
street
.
utils
.
encry
;
import
android.util.Log
;
import
java.net.URLDecoder
;
import
java.net.URLEncoder
;
import
java.security.Key
;
import
javax.crypto.Cipher
;
import
javax.crypto.SecretKeyFactory
;
import
javax.crypto.spec.DESedeKeySpec
;
import
javax.crypto.spec.IvParameterSpec
;
/**
* 描述:3DES加密工具类
* 作者:孟崔广
* 时间:2018/3/29 17:51
* 邮箱:mengcga@163.com
*/
public
class
Des3
{
// crediteasec@lx100$#365#$
// 密钥
// private final static String secretKey = "mail.asiainfo.com@2x222$#bbb#2";
// 向量
private
final
static
String
iv
=
"01234567"
;
// 加解密统一使用的编码方式
private
final
static
String
encoding
=
"utf-8"
;
private
static
String
TAG
=
"Des3"
;
/**
* 3DES加密
*
* @param plainText 普通文本
* @return
* @throws Exception
*/
public
static
String
encode
(
String
plainText
,
String
secretKey
)
{
String
ciphertext
=
""
;
if
(
plainText
!=
null
&&
plainText
.
length
()
!=
0
)
{
Key
deskey
=
null
;
byte
[]
encryptData
=
null
;
try
{
byte
[]
bytes
=
secretKey
.
getBytes
();
DESedeKeySpec
spec
=
new
DESedeKeySpec
(
bytes
);
SecretKeyFactory
keyfactory
=
SecretKeyFactory
.
getInstance
(
"desede"
);
deskey
=
keyfactory
.
generateSecret
(
spec
);
Cipher
cipher
=
Cipher
.
getInstance
(
"desede/CBC/PKCS5Padding"
);
IvParameterSpec
ips
=
new
IvParameterSpec
(
iv
.
getBytes
());
cipher
.
init
(
Cipher
.
ENCRYPT_MODE
,
deskey
,
ips
);
encryptData
=
cipher
.
doFinal
(
plainText
.
getBytes
(
encoding
));
ciphertext
=
Base64
.
encode
(
encryptData
);
//这里需要对特殊字符串进行转码
ciphertext
=
URLEncoder
.
encode
(
ciphertext
,
"utf-8"
);
}
catch
(
Exception
e
)
{
Log
.
e
(
TAG
,
e
.
getMessage
().
toString
());
e
.
printStackTrace
();
}
}
return
ciphertext
;
}
/**
* 3DES解密
*
* @param encryptText 加密文本
* @return
* @throws Exception
*/
public
static
String
decode
(
String
encryptText
,
String
secretKey
)
{
String
clearText
=
""
;
if
(
encryptText
!=
null
&&
encryptText
.
length
()
!=
0
)
{
Key
deskey
=
null
;
byte
[]
decryptData
;
try
{
//这里需要对特殊字符串进行转码
encryptText
=
URLDecoder
.
decode
(
encryptText
,
"utf-8"
);
DESedeKeySpec
spec
=
new
DESedeKeySpec
(
secretKey
.
getBytes
());
SecretKeyFactory
keyfactory
=
SecretKeyFactory
.
getInstance
(
"desede"
);
deskey
=
keyfactory
.
generateSecret
(
spec
);
Cipher
cipher
=
Cipher
.
getInstance
(
"desede/CBC/PKCS5Padding"
);
IvParameterSpec
ips
=
new
IvParameterSpec
(
iv
.
getBytes
());
cipher
.
init
(
Cipher
.
DECRYPT_MODE
,
deskey
,
ips
);
decryptData
=
cipher
.
doFinal
(
Base64
.
decode
(
encryptText
));
clearText
=
new
String
(
decryptData
,
encoding
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
return
clearText
;
}
}
library_base/src/main/java/com/fry/base
/utils/encry/MD5.java
→
app/src/main/java/com/mints/street
/utils/encry/MD5.java
100755 → 100644
View file @
196713fe
package
com
.
fry
.
base
.
utils
.
encry
;
import
java.security.MessageDigest
;
import
java.security.NoSuchAlgorithmException
;
/*
* MD5 算法
*/
public
class
MD5
{
// 全局数组
private
final
static
String
[]
strDigits
=
{
"0"
,
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
,
"7"
,
"8"
,
"9"
,
"a"
,
"b"
,
"c"
,
"d"
,
"e"
,
"f"
};
// 返回形式为数字跟字符串
private
static
String
byteToArrayString
(
byte
bByte
)
{
int
iRet
=
bByte
;
// System.out.println("iRet="+iRet);
if
(
iRet
<
0
)
{
iRet
+=
256
;
}
int
iD1
=
iRet
/
16
;
int
iD2
=
iRet
%
16
;
return
strDigits
[
iD1
]
+
strDigits
[
iD2
];
}
// 返回形式只为数字
private
static
String
byteToNum
(
byte
bByte
)
{
int
iRet
=
bByte
;
System
.
out
.
println
(
"iRet1="
+
iRet
);
if
(
iRet
<
0
)
{
iRet
+=
256
;
}
return
String
.
valueOf
(
iRet
);
}
// 转换字节数组为16进制字串
private
static
String
byteToString
(
byte
[]
bByte
)
{
StringBuffer
sBuffer
=
new
StringBuffer
();
for
(
int
i
=
0
;
i
<
bByte
.
length
;
i
++)
{
sBuffer
.
append
(
byteToArrayString
(
bByte
[
i
]));
}
return
sBuffer
.
toString
();
}
public
static
String
GetMD5Code
(
String
strObj
)
{
String
resultString
=
null
;
try
{
resultString
=
new
String
(
strObj
);
MessageDigest
md
=
MessageDigest
.
getInstance
(
"MD5"
);
// md.digest() 该函数返回值为存放哈希值结果的byte数组
resultString
=
byteToString
(
md
.
digest
(
strObj
.
getBytes
()));
}
catch
(
NoSuchAlgorithmException
ex
)
{
ex
.
printStackTrace
();
}
return
resultString
;
}
public
static
void
main
(
String
[]
args
)
{
MD5
getMD5
=
new
MD5
();
System
.
out
.
println
(
GetMD5Code
(
"136111111111231231231231e807f1fcf82d132f9bb018ca6738a19f"
));
}
package
com
.
mints
.
street
.
utils
.
encry
;
import
java.security.MessageDigest
;
import
java.security.NoSuchAlgorithmException
;
/*
* MD5 算法
*/
public
class
MD5
{
// 全局数组
private
final
static
String
[]
strDigits
=
{
"0"
,
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
,
"7"
,
"8"
,
"9"
,
"a"
,
"b"
,
"c"
,
"d"
,
"e"
,
"f"
};
// 返回形式为数字跟字符串
private
static
String
byteToArrayString
(
byte
bByte
)
{
int
iRet
=
bByte
;
// System.out.println("iRet="+iRet);
if
(
iRet
<
0
)
{
iRet
+=
256
;
}
int
iD1
=
iRet
/
16
;
int
iD2
=
iRet
%
16
;
return
strDigits
[
iD1
]
+
strDigits
[
iD2
];
}
// 返回形式只为数字
private
static
String
byteToNum
(
byte
bByte
)
{
int
iRet
=
bByte
;
System
.
out
.
println
(
"iRet1="
+
iRet
);
if
(
iRet
<
0
)
{
iRet
+=
256
;
}
return
String
.
valueOf
(
iRet
);
}
// 转换字节数组为16进制字串
private
static
String
byteToString
(
byte
[]
bByte
)
{
StringBuffer
sBuffer
=
new
StringBuffer
();
for
(
int
i
=
0
;
i
<
bByte
.
length
;
i
++)
{
sBuffer
.
append
(
byteToArrayString
(
bByte
[
i
]));
}
return
sBuffer
.
toString
();
}
public
static
String
GetMD5Code
(
String
strObj
)
{
String
resultString
=
null
;
try
{
resultString
=
new
String
(
strObj
);
MessageDigest
md
=
MessageDigest
.
getInstance
(
"MD5"
);
// md.digest() 该函数返回值为存放哈希值结果的byte数组
resultString
=
byteToString
(
md
.
digest
(
strObj
.
getBytes
()));
}
catch
(
NoSuchAlgorithmException
ex
)
{
ex
.
printStackTrace
();
}
return
resultString
;
}
public
static
void
main
(
String
[]
args
)
{
MD5
getMD5
=
new
MD5
();
System
.
out
.
println
(
GetMD5Code
(
"136111111111231231231231e807f1fcf82d132f9bb018ca6738a19f"
));
}
}
\ No newline at end of file
gradle.properties
View file @
196713fe
...
...
@@ -33,4 +33,4 @@ RELEASE_SHARESDK_KEY=
RELEASE_SHARESDK_SECRET
=
#友盟
RELEASE_UMENG_KEY
=
\ No newline at end of file
RELEASE_UMENG_KEY
=
60e80209a6f90557b7b19aa7
library_base/build.gradle
View file @
196713fe
...
...
@@ -44,7 +44,7 @@ dependencies {
api
project
(
':mvvmhabit'
)
//阿里路由框架
api
rootProject
.
ext
.
dependencies
[
"arouter-api"
]
//
api rootProject.ext.dependencies["arouter-api"]
//指示器
api
rootProject
.
ext
.
dependencies
[
"hackware1993"
]
...
...
library_base/src/main/java/com/fry/base/base/BaseModuleInit.java
View file @
196713fe
...
...
@@ -3,8 +3,6 @@ package com.fry.base.base;
import
android.app.Application
;
import
android.view.Gravity
;
import
com.alibaba.android.arouter.launcher.ARouter
;
import
me.goldze.mvvmhabit.utils.KLog
;
import
me.goldze.mvvmhabit.utils.ToastUtils
;
import
com.fry.base.BuildConfig
;
...
...
@@ -22,10 +20,10 @@ public class BaseModuleInit implements IModuleInit<Void> {
//开启打印日志
KLog
.
init
(
BuildConfig
.
DEBUG
);
//初始化阿里路由框架
if
(
BuildConfig
.
DEBUG
)
{
ARouter
.
openLog
();
// 打印日志
ARouter
.
openDebug
();
// 开启调试模式(如果在InstantRun模式下运行,必须开启调试模式!线上版本需要关闭,否则有安全风险)
}
//
if (BuildConfig.DEBUG) {
//
ARouter.openLog(); // 打印日志
//
ARouter.openDebug(); // 开启调试模式(如果在InstantRun模式下运行,必须开启调试模式!线上版本需要关闭,否则有安全风险)
//
}
// 尽可能早,推荐在Application中初始化
// ARouter.init(application);
ToastUtils
.
setGravity
(
Gravity
.
CENTER
,
0
,
0
);
...
...
library_base/src/main/java/com/fry/base/basenetwork/RetrofitClient.java
View file @
196713fe
...
...
@@ -6,8 +6,6 @@ import android.text.TextUtils;
import
androidx.annotation.NonNull
;
import
com.fry.base.BuildConfig
;
import
com.fry.base.netwrok.OkHttpInterceptor
;
import
com.fry.base.utils.encry.AESUtils
;
import
java.util.concurrent.TimeUnit
;
...
...
@@ -34,7 +32,7 @@ import retrofit2.converter.gson.GsonConverterFactory;
*/
public
class
RetrofitClient
{
p
rivate
HttpConfiguation
mHttpConfig
;
p
ublic
HttpConfiguation
mHttpConfig
;
private
Context
mContext
=
Utils
.
getContext
();
...
...
library_base/src/main/java/com/fry/base/global/Constants.java
View file @
196713fe
...
...
@@ -16,22 +16,6 @@ public class Constants {
/***
* bugly配置信息
*/
public
static
final
String
BUGLY_APP_ID
=
"1aa21b8cc3"
;
public
static
final
String
UMENG_APP_KEY
=
"58c35e724544cb4fa8001acf"
;
public
static
final
String
JPUSH_KEY
=
"830808eb0ee65458c952891c"
;
public
static
final
String
WX_APP_ID
=
"wxff15efaf15adc6f8"
;
public
static
final
String
WX_APP_SECRET
=
"83d6dbe46f84bde4cf78d0b58764d797"
;
public
static
final
String
QQAppID
=
"1105708819"
;
public
static
final
String
QQAppKey
=
"J9olD7s7udx8rJ0E"
;
public
static
final
String
SinaAppKey
=
"824068500"
;
public
static
final
String
SinaAppSecret
=
"99dd08e9f7de660cb81ddc8f90e67e7c"
;
public
static
final
String
SinaCallBackURL
=
"http://sns.whalecloud.com/sina2/callback"
;
public
static
final
String
BUNDLE_ID
=
"bundleId"
;
public
static
final
String
ID
=
"id"
;
/**
...
...
library_base/src/main/java/com/fry/base/provider/IFlutterProvider.kt
deleted
100644 → 0
View file @
5ece9c32
package
com.fry.base.provider
import
android.content.Context
import
com.alibaba.android.arouter.facade.template.IProvider
import
com.alibaba.android.arouter.launcher.ARouter
/**
* Description :
* Created by yue on 2021/3/10
*/
interface
IFlutterProvider
:
IProvider
{
companion
object
{
const
val
PROVIDER
:
String
=
"/flutter/provider"
@JvmStatic
fun
getInstance
():
IFlutterProvider
{
return
ARouter
.
getInstance
().
build
(
PROVIDER
).
navigation
()
as
IFlutterProvider
}
}
fun
toFlutter
(
context
:
Context
,
path
:
String
,
arguments
:
HashMap
<
String
,
Any
>?
=
null
,
requestCode
:
Int
=
0
)
}
\ No newline at end of file
library_base/version.properties
View file @
196713fe
#Fri Jul 09 1
4:29:26
CST 2021
VERSION_BUILD
=
26
33
#Fri Jul 09 1
6:57:51
CST 2021
VERSION_BUILD
=
26
59
shareSdkLib/build/intermediates/incremental/packageDebugResources/compile-file-map.properties
View file @
196713fe
#Fri Jul 09 1
1:54:15
CST 2021
#Fri Jul 09 1
5:21:04
CST 2021
D\:\\android_space\\MyStreet\\shareSdkLib\\src\\main\\res\\drawable-xhdpi\\
ssdk_auth_title_back.png
=
D
\:\\
android_space
\\
MyStreet
\\
shareSdkLib
\\
build
\\
intermediates
\\
packaged_res
\\
debug
\\
drawable-xhdpi-v4
\\
ssdk_auth_title_back.png
D\:\\android_space\\MyStreet\\shareSdkLib\\src\\main\\res\\drawable-xhdpi\\
ssdk_oks_classic_yixin.png
=
D
\:\\
android_space
\\
MyStreet
\\
shareSdkLib
\\
build
\\
intermediates
\\
packaged_res
\\
debug
\\
drawable-xhdpi-v4
\\
ssdk_oks_classic_yixin.png
D\:\\android_space\\MyStreet\\shareSdkLib\\src\\main\\res\\drawable-xhdpi\\
ssdk_oks_classic_wechatfavorite.png
=
D
\:\\
android_space
\\
MyStreet
\\
shareSdkLib
\\
build
\\
intermediates
\\
packaged_res
\\
debug
\\
drawable-xhdpi-v4
\\
ssdk_oks_classic_wechatfavorite.png
...
...
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