Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lib_base
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sikang
lib_base
Commits
ffff8761
Commit
ffff8761
authored
Apr 01, 2019
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加SDK插拔脚本
parent
a260b398
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
111 additions
and
13 deletions
+111
-13
build.gradle
+3
-3
script/script_help.sh
+20
-0
script/sdk_manager.py
+71
-0
src/main/java/tech/starwin/LibConfig.java
+16
-9
src/main/res/layout/item_td_account.xml
+1
-1
No files found.
build.gradle
View file @
ffff8761
...
...
@@ -43,7 +43,7 @@ repositories {
}
dependencies
{
api
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
,
"*.aar"
])
api
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
testImplementation
'junit:junit:4.12'
// noinspection GradleCompatible
androidTestImplementation
'com.android.support.test:runner:1.0.2'
...
...
@@ -69,8 +69,8 @@ dependencies {
// api 'me.jessyan:autosize:1.0.6'
//同盾
// api(name: 'android_s
hujumohe_sdk_beta_20180907_1.0.8.2
', ext: 'aar')
api
'com.alibaba:fastjson:1.1.58.android'
// api(name: 'android_s
pirit-20190220-2.0.0.1
', ext: 'aar')
//
api 'com.alibaba:fastjson:1.1.58.android'
//QMUI
api
'com.qmuiteam:qmui:1.1.10'
...
...
script/script_help.sh
View file @
ffff8761
...
...
@@ -11,6 +11,7 @@ echo "8、提交一个渠道包Tag"
echo
"9、开始四大组件混淆"
echo
"10、插入乱码"
echo
"11、还原代码"
echo
"12、SDK插拔"
echo
-n
"请输入指令编号:"
...
...
@@ -78,6 +79,25 @@ then
chmod a+x reset_name.sh
./reset_name.sh
elif
((
$commod
==
'12'
))
then
echo
"1、开启SDK"
echo
"2、关闭SDK"
echo
-n
"请选择操作:"
read
action
echo
"TD(同盾)、AF(Appsflyer)"
echo
-n
"输入要操作的SDK代码:"
read
sdk
chmod a+x sdk_manager.py
if
((
$action
==
'1'
))
then
./sdk_manager.py
'open'
${
sdk
}
elif
((
$action
==
'2'
))
then
./sdk_manager.py
'close'
${
sdk
}
fi
else
echo
"找不到编号"
fi
script/sdk_manager.py
0 → 100755
View file @
ffff8761
#!/usr/bin/env python3
import
json
import
string
import
random
import
glob
,
os
import
sys
def
close_sdk
(
path
,
sdk
):
# print("processing content: %s..." % path)
with
open
(
path
,
"r"
,
encoding
=
"utf-8"
)
as
f
:
# readlines以列表的形式将文件读出
lines
=
f
.
readlines
()
with
open
(
path
,
"w"
,
encoding
=
"utf-8"
)
as
f_w
:
is_sdk_code
=
False
for
line
in
lines
:
mark
=
"//SDK-"
+
sdk
+
"-CODE
\t
"
;
if
is_sdk_code
and
mark
not
in
line
:
line
=
mark
+
line
if
"//SDK-"
+
sdk
+
"-START"
in
line
:
is_sdk_code
=
True
if
"//SDK-"
+
sdk
+
"-END"
in
line
:
is_sdk_code
=
False
f_w
.
write
(
line
)
return
def
open_sdk
(
path
,
sdk
):
# print("processing content: %s..." % path)
code_mark
=
"//SDK-"
+
sdk
+
"-CODE
\t
"
with
open
(
path
,
"r"
,
encoding
=
"utf-8"
)
as
f
:
# readlines以列表的形式将文件读出
lines
=
f
.
readlines
()
with
open
(
path
,
"w"
,
encoding
=
"utf-8"
)
as
f_w
:
is_sdk_code
=
False
for
line
in
lines
:
if
code_mark
in
line
:
line
=
line
.
replace
(
code_mark
,
""
)
f_w
.
write
(
line
)
return
print
(
"params "
+
sys
.
argv
[
1
]
+
" "
+
sys
.
argv
[
2
])
for
root
,
dirs
,
files
in
os
.
walk
(
"../../app/src/main"
):
directory
=
os
.
path
.
join
(
os
.
getcwd
(),
root
)
for
file
in
files
:
if
file
.
endswith
(
".java"
):
# get the path of the java file
path
=
os
.
path
.
join
(
directory
,
file
)
if
sys
.
argv
[
1
]
==
'open'
:
open_sdk
(
path
,
sys
.
argv
[
2
])
else
:
close_sdk
(
path
,
sys
.
argv
[
2
])
for
root
,
dirs
,
files
in
os
.
walk
(
"../../lib_base/src/main"
):
directory
=
os
.
path
.
join
(
os
.
getcwd
(),
root
)
for
file
in
files
:
if
file
.
endswith
(
".java"
):
# get the path of the java file
path
=
os
.
path
.
join
(
directory
,
file
)
if
sys
.
argv
[
1
]
==
'open'
:
open_sdk
(
path
,
sys
.
argv
[
2
])
else
:
close_sdk
(
path
,
sys
.
argv
[
2
])
\ No newline at end of file
src/main/java/tech/starwin/LibConfig.java
View file @
ffff8761
...
...
@@ -20,7 +20,10 @@ import com.scwang.smartrefresh.layout.header.ClassicsHeader;
import
org.litepal.LitePal
;
import
cn.fraudmetrix.octopus.aspirit.main.OctopusManager
;
//SDK-TD-START
//SDK-TD-CODE import cn.fraudmetrix.octopus.aspirit.main.OctopusManager;
//SDK-TD-CODE //SDK-TD-END
import
tech.starwin.network.Gateway
;
import
tech.starwin.utils.PreferencesManager
;
import
tech.starwin.utils.ScreenAutoSize
;
...
...
@@ -80,7 +83,7 @@ public class LibConfig {
public
static
int
LOADING_ICON
;
//loading图标
public
static
int
LOADING_BACKGROUND
;
//loading旋转背景
public
static
int
APP_ICON
=
R
.
mipmap
.
ic_launcher
;
public
static
int
MAIN_COLOR
=
R
.
color
.
color_blue
;
//主题色
public
static
int
MAIN_COLOR
=
R
.
color
.
qmui_config_
color_blue
;
//主题色
public
static
ButterKnifeBinder
butterKnifeBinder
;
...
...
@@ -162,17 +165,21 @@ public class LibConfig {
/**
* init 同盾
*/
private
static
void
initTD
()
{
if
(!
TextUtils
.
isEmpty
(
TONGDUN_PARENT_CODE
)
&&
!
TextUtils
.
isEmpty
(
TONGDUN_PARENT_KEY
))
{
OctopusManager
.
getInstance
().
init
(
CONTEXT
,
TONGDUN_PARENT_CODE
,
TONGDUN_PARENT_KEY
,
TONGDUN_APP_NAME
);
OctopusManager
.
getInstance
().
setPrimaryColorResId
(
MAIN_COLOR
);
OctopusManager
.
getInstance
().
setTitleColorResId
(
R
.
color
.
white
);
OctopusManager
.
getInstance
().
setShowWarnDialog
(
true
);
OctopusManager
.
getInstance
().
setStatusBarBg
(
MAIN_COLOR
);
}
//SDK-TD-START
//SDK-TD-CODE if (!TextUtils.isEmpty(TONGDUN_PARENT_CODE) && !TextUtils.isEmpty(TONGDUN_PARENT_KEY)) {
//SDK-TD-CODE OctopusManager.getInstance().init(CONTEXT, TONGDUN_PARENT_CODE, TONGDUN_PARENT_KEY, TONGDUN_APP_NAME);
//SDK-TD-CODE OctopusManager.getInstance().setPrimaryColorResId(MAIN_COLOR);
//SDK-TD-CODE OctopusManager.getInstance().setTitleColorResId(R.color.white);
//SDK-TD-CODE OctopusManager.getInstance().setShowWarnDialog(true);
//SDK-TD-CODE OctopusManager.getInstance().setStatusBarBg(MAIN_COLOR);
//SDK-TD-CODE }
//SDK-TD-CODE //SDK-TD-END
}
/**
* 用于在Base 中 实现Butterknife.bind()的功能
*
...
...
src/main/res/layout/item_td_account.xml
View file @
ffff8761
...
...
@@ -55,7 +55,7 @@
android:enabled=
"false"
android:longClickable=
"false"
android:text=
"@string/text_optional"
android:textColor=
"@color/
color_font_grayest
"
android:textColor=
"@color/
qmui_config_color_gray_5
"
android:textSize=
"13sp"
/>
<ImageView
...
...
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