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
12eb91a5
Commit
12eb91a5
authored
Mar 13, 2019
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update script
parent
28e3bd5b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
81 deletions
+2
-81
script/obact.json
+1
-2
script/obact.py
+0
-38
script/obact_lib.json
+1
-2
script/obact_lib.py
+0
-39
No files found.
script/obact.json
View file @
12eb91a5
...
@@ -22,6 +22,5 @@
...
@@ -22,6 +22,5 @@
"RepaymentFragment"
"RepaymentFragment"
],
],
"root"
:
"../../app/src/main"
,
"root"
:
"../../app/src/main"
,
"manifest"
:
"../../app/src/main/AndroidManifest.xml"
,
"manifest"
:
"../../app/src/main/AndroidManifest.xml"
"applibroot"
:
"../../app/src/app"
}
}
script/obact.py
View file @
12eb91a5
...
@@ -79,43 +79,5 @@ manifest_path = os.path.join(os.getcwd(), manifest)
...
@@ -79,43 +79,5 @@ manifest_path = os.path.join(os.getcwd(), manifest)
process_file_content
(
manifest_path
,
"AndroidManifest.xml"
)
process_file_content
(
manifest_path
,
"AndroidManifest.xml"
)
#update applib
# read configs
with
open
(
'obact_lib.json'
,
"rt"
)
as
f
:
json_root
=
json
.
load
(
f
)
activities
=
json_root
[
"activities"
]
source_root
=
json_root
[
"applibroot"
]
manifest
=
json_root
[
"appmanifest"
]
print
(
"activity mapping
%
s"
%
activity_mangle_setting
)
root_path
=
os
.
path
.
join
(
os
.
getcwd
(),
source_root
)
# perform content replace for the files
print
(
"processing file content..."
)
for
root
,
dirs
,
files
in
os
.
walk
(
source_root
):
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
)
process_file_content
(
path
,
file
)
print
(
"processing file content done"
)
print
(
"renaming files"
)
for
root
,
dirs
,
files
in
os
.
walk
(
source_root
):
directory
=
os
.
path
.
join
(
os
.
getcwd
(),
root
)
for
file
in
files
:
if
file
.
endswith
(
".java"
):
name
=
os
.
path
.
splitext
(
file
)[
0
]
if
name
in
activity_mangle_setting
:
# get the path of the java file
src
=
os
.
path
.
join
(
directory
,
file
)
dst
=
os
.
path
.
join
(
directory
,
"
%
s.java"
%
activity_mangle_setting
[
name
])
print
(
"
%
s ->
%
s"
%
(
src
,
dst
))
os
.
rename
(
src
,
dst
)
print
(
"renaming files done"
)
script/obact_lib.json
View file @
12eb91a5
...
@@ -82,6 +82,5 @@
...
@@ -82,6 +82,5 @@
"root"
:
"../../lib_base/src/main"
,
"root"
:
"../../lib_base/src/main"
,
"manifest"
:
"../../lib_base/src/main/AndroidManifest.xml"
,
"manifest"
:
"../../lib_base/src/main/AndroidManifest.xml"
,
"approot"
:
"../../app/src/main"
,
"approot"
:
"../../app/src/main"
,
"appmanifest"
:
"../../app/src/main/AndroidManifest.xml"
,
"appmanifest"
:
"../../app/src/main/AndroidManifest.xml"
"applibroot"
:
"../../app/src/app"
}
}
script/obact_lib.py
View file @
12eb91a5
...
@@ -120,42 +120,3 @@ manifest_path = os.path.join(os.getcwd(), manifest)
...
@@ -120,42 +120,3 @@ manifest_path = os.path.join(os.getcwd(), manifest)
process_file_content
(
manifest_path
,
"AndroidManifest.xml"
)
process_file_content
(
manifest_path
,
"AndroidManifest.xml"
)
#update applib
# read configs
with
open
(
'obact_lib.json'
,
"rt"
)
as
f
:
json_root
=
json
.
load
(
f
)
activities
=
json_root
[
"activities"
]
source_root
=
json_root
[
"applibroot"
]
manifest
=
json_root
[
"appmanifest"
]
print
(
"activity mapping
%
s"
%
activity_mangle_setting
)
root_path
=
os
.
path
.
join
(
os
.
getcwd
(),
source_root
)
# perform content replace for the files
print
(
"processing file content..."
)
for
root
,
dirs
,
files
in
os
.
walk
(
source_root
):
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
)
process_file_content
(
path
,
file
)
print
(
"processing file content done"
)
print
(
"renaming files"
)
for
root
,
dirs
,
files
in
os
.
walk
(
source_root
):
directory
=
os
.
path
.
join
(
os
.
getcwd
(),
root
)
for
file
in
files
:
if
file
.
endswith
(
".java"
):
name
=
os
.
path
.
splitext
(
file
)[
0
]
if
name
in
activity_mangle_setting
:
# get the path of the java file
src
=
os
.
path
.
join
(
directory
,
file
)
dst
=
os
.
path
.
join
(
directory
,
"
%
s.java"
%
activity_mangle_setting
[
name
])
print
(
"
%
s ->
%
s"
%
(
src
,
dst
))
os
.
rename
(
src
,
dst
)
print
(
"renaming files done"
)
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