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
35eb8cb7
Commit
35eb8cb7
authored
Apr 05, 2019
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update scri[t
parent
4cbcf9a1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
198 additions
and
0 deletions
+198
-0
script/code/code_sync.sh
+11
-0
script/code/thirdpart_list.py
+180
-0
script/script_help.sh
+7
-0
No files found.
script/code/code_sync.sh
0 → 100644
View file @
35eb8cb7
echo
"1、同盾列表添加最少选择数量"
echo
-n
"请输入指令编号:"
read
commod
if
((
$commod
==
'0'
))
then
chmod a+x thirdpart_list.py
./thirdpart_list.py
fi
\ No newline at end of file
script/code/thirdpart_list.py
0 → 100644
View file @
35eb8cb7
#!/usr/bin/env python3
import
json
import
string
import
random
import
glob
,
os
import
sys
def
get_brackets
(
line
):
left
=
line
.
count
(
"{"
)
right
=
line
.
count
(
"}"
)
return
left
-
right
def
code_loanapplyfragment
(
path
):
# 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
:
flag1
=
False
flag2
=
False
flag3
=
False
flag4
=
False
brackets
=
0
for
line
in
lines
:
if
"getPresenter(LoanPresenter.class).checkQualification(
\"
action_checkQualification
\"
);"
in
line
:
code
=
"
\n\t\t\t\t\t
new LoanApplyProxy(getActivity(), this, productBean).startLoan(basicAck -> {
\n
"
+
\
"
\t\t\t\t\t\t
new EventSender.Builder(MessageID.LOAN_STATUS_CHANGED).build().sendEvent();
\n
"
+
\
"
\t\t\t\t\t
});
\n
"
line
=
"// "
+
line
+
code
;
# 3
if
"case
\"
action_checkQualification
\"
:"
in
line
:
flag3
=
True
if
flag3
:
flag3
=
"// "
+
line
if
"break;"
in
line
:
flag3
=
False
;
# 2
if
"case
\"
action_faceVerify
\"
:"
in
line
:
flag2
=
True
if
flag2
:
line
=
"// "
+
line
if
"break;"
in
line
:
flag2
=
False
;
# 1
if
"public void startFaceVerify() {"
in
line
:
flag1
=
True
brackets
=
get_brackets
(
line
)
if
flag1
and
brackets
>
0
:
line
=
"// "
+
line
brackets
+=
get_brackets
(
line
)
f_w
.
write
(
line
)
print
(
"code_LoanAppFragment updated !"
)
return
def
code_certifyactivity
(
path
):
# 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
:
for
line
in
lines
:
if
"setTopBarTitle(getString(R.string.text_certification));"
in
line
:
code
=
"
\n\t\t
Button nextStepBtn = findViewById(R.id.activity_certify_next_btn);
\n
"
+
\
"
\t\t
if (!TextUtils.isEmpty(BuildConfig.TONGDUN_PARENT_KEY)) {
\n
"
+
\
"
\t\t\t
nextStepBtn.setVisibility(View.VISIBLE);
\n
"
+
\
"
\t\t\t
nextStepBtn.setOnClickListener(v -> {
\n
"
+
\
"
\t\t\t\t
CertifyProgressActivity.start(CertifyActiviy.this, CertifyProgressActivity.CertifyType.CERTIFY_ACCOUNT);
\n
"
+
\
"
\t\t\t
});
\n
"
+
\
"
\t\t
}
\n\n
"
line
=
line
+
code
f_w
.
write
(
line
)
print
(
"code_CertifyActivity updated !"
)
return
def
code_fragments
(
path
):
# 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
:
for
line
in
lines
:
if
"startFragment(PersonalInfoFragment.create(mGenderBtn.getText().toString()), true);"
in
line
:
code
=
"
\n\t\t\t\t\t\t\t
new EventSender.Builder(MessageID.CERTIFY_PROGRESS_CHANGED).obj(PersonalInfoFragment.create(mGenderBtn.getText().toString())).build().sendEvent();
\n
"
line
=
"// "
+
line
+
code
if
"startFragment(ContactInfoFragment.create(), true);"
in
line
:
code
=
"
\n\t\t\t\t
new EventSender.Builder(MessageID.CERTIFY_PROGRESS_CHANGED).obj(ContactInfoFragment.create()).build().sendEvent();
\n
"
line
=
"// "
+
line
+
code
if
"startFragment(ProfessionalFragment.create(), true);"
in
line
:
code
=
"
\n\t\t\t\t
new EventSender.Builder(MessageID.CERTIFY_PROGRESS_CHANGED).obj(ProfessionalFragment.create()).build().sendEvent();"
line
=
"// "
+
line
+
code
if
"startFragment(AccountFragment.create(), true);"
in
line
:
code
=
"
\n\t\t\t\t\t
new EventSender.Builder(MessageID.CERTIFY_PROGRESS_CHANGED).obj(AccountFragment.create()).build().sendEvent();
\n
"
line
=
"// "
+
line
+
code
f_w
.
write
(
line
)
print
(
"code_fragments updated !"
)
return
def
code_certifyprogress
(
path
):
# 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
:
flag
=
False
for
line
in
lines
:
#1
if
"public static void start(FragmentActivity context, CertifyType certifyType) {"
in
line
:
flag
=
True
if
flag
and
"}"
in
line
:
flag
=
False
code
=
"
\n\t
public static void start(FragmentActivity context, CertifyType certifyType, ProductBean productBean) {
\n
"
+
\
"
\t\t
new ActivityJumper.Builder(context, CertifyProgressActivity.class).put(
\"
certigy_type
\"
, certifyType).put(
\"
productBean
\"
, productBean).build().start();
\n
"
+
\
"
\t
}
\n
"
code
+=
"
\n\n
"
code
+=
"
\t
@Subscribe
\n
"
+
\
"
\t
public void onEvent(EventMessage msg) {
\n
"
+
\
"
\t\t
if (msg.what == MessageID.CERTIFY_PROGRESS_CHANGED) {
\n
"
+
\
"
\t\t\t
Fragment fragment = (Fragment) msg.obj;
\n
"
+
\
"
\t\t\t
Bundle arguments = fragment.getArguments();
\n
"
+
\
"
\t\t\t
if (arguments != null) {"
+
\
"
\t\t\t\t
arguments.putAll(getIntent().getExtras());
\n
"
+
\
"
\t\t\t
}else{
\n
"
+
\
"
\t\t\t\t
arguments= getIntent().getExtras();
\n
"
+
\
"
\t\t\t
}
\n
"
+
\
"
\t\t
fragment.setArguments(arguments);
\n
"
+
\
"
\t\t
startFragment(fragment, true);
\n
"
+
\
"
\t\t
}
\n
"
+
\
"
\t
}
\n\n
"
line
=
line
+
code
#2
if
"startFragment(AccountFragment.create(), false);"
in
line
:
code
=
"
\n\t\t\t\t
AccountFragment accountFragment = AccountFragment.create();
\n
"
+
\
"
\t\t\t\t
accountFragment.setArguments(getIntent().getExtras());
\n
"
+
\
"
\t\t\t\t
startFragment(accountFragment, false);
\n
"
line
=
line
+
code
f_w
.
write
(
line
)
print
(
"code_fragments updated !"
)
return
for
root
,
dirs
,
files
in
os
.
walk
(
"../../app/src/main"
):
directory
=
os
.
path
.
join
(
os
.
getcwd
(),
root
)
for
file
in
files
:
if
file
.
endswith
(
"LoanApplyFragment.java"
):
# get the path of the java file
path
=
os
.
path
.
join
(
directory
,
file
)
code_loanapplyfragment
(
path
)
elif
file
.
endswith
(
"CertifyActivity.java"
):
path
=
os
.
path
.
join
(
directory
,
file
)
code_certifyactivity
(
path
)
elif
file
.
endswith
(
"IdentityInfoFragment.java"
)
or
file
.
endswith
(
"PersonalInfoFragment.java"
)
or
file
.
endswith
(
"ContactInfoFragment.java"
)
or
file
.
endswith
(
"ProfessionalFragment.java"
)
path
=
os
.
path
.
join
(
directory
,
file
)
code_fragments
(
path
)
elif
file
.
endswith
(
"CertifyProgressActivity.java"
):
path
=
os
.
path
.
join
(
directory
,
file
)
code_certifyprogress
(
path
)
script/script_help.sh
View file @
35eb8cb7
...
@@ -14,6 +14,7 @@ echo "11、还原代码"
...
@@ -14,6 +14,7 @@ echo "11、还原代码"
echo
"12、SDK插拔"
echo
"12、SDK插拔"
echo
"13、copy apk"
echo
"13、copy apk"
echo
"14、生成工具包"
echo
"14、生成工具包"
echo
"15、功能代码同步"
...
@@ -112,6 +113,12 @@ then
...
@@ -112,6 +113,12 @@ then
chmod a+x build_tool_apk.sh
chmod a+x build_tool_apk.sh
./build_tool_apk.sh
./build_tool_apk.sh
elif
((
$commod
==
'15'
))
then
cd
code
chmod a+x code_sync.sh
./code_sync.sh
else
else
echo
"找不到编号"
echo
"找不到编号"
...
...
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