Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
15424478
Commit
15424478
authored
Nov 13, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reuse buffer
parent
a6f0aff6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
connect.cpp
native/jni/su/connect.cpp
+7
-8
No files found.
native/jni/su/connect.cpp
View file @
15424478
...
...
@@ -49,8 +49,7 @@ class Extra {
bool
bool_val
;
const
char
*
str_val
;
};
char
i_buf
[
16
];
char
b_buf
[
32
];
char
buf
[
32
];
public
:
Extra
(
const
char
*
k
,
int
v
)
:
key
(
k
),
type
(
INT
),
int_val
(
v
)
{}
Extra
(
const
char
*
k
,
bool
v
)
:
key
(
k
),
type
(
BOOL
),
bool_val
(
v
)
{}
...
...
@@ -61,8 +60,8 @@ public:
switch
(
type
)
{
case
INT
:
vec
.
push_back
(
"--ei"
);
sprintf
(
i_
buf
,
"%d"
,
int_val
);
val
=
i_
buf
;
sprintf
(
buf
,
"%d"
,
int_val
);
val
=
buf
;
break
;
case
BOOL
:
vec
.
push_back
(
"--ez"
);
...
...
@@ -80,17 +79,17 @@ public:
void
add_bind
(
vector
<
const
char
*>
&
vec
)
{
switch
(
type
)
{
case
INT
:
sprintf
(
b
_b
uf
,
"%s:i:%d"
,
key
,
int_val
);
sprintf
(
buf
,
"%s:i:%d"
,
key
,
int_val
);
break
;
case
BOOL
:
sprintf
(
b
_b
uf
,
"%s:b:%s"
,
key
,
bool_val
?
"true"
:
"false"
);
sprintf
(
buf
,
"%s:b:%s"
,
key
,
bool_val
?
"true"
:
"false"
);
break
;
case
STRING
:
sprintf
(
b
_b
uf
,
"%s:s:%s"
,
key
,
str_val
);
sprintf
(
buf
,
"%s:s:%s"
,
key
,
str_val
);
break
;
}
vec
.
push_back
(
"--extra"
);
vec
.
push_back
(
b
_b
uf
);
vec
.
push_back
(
buf
);
}
};
...
...
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