Skip to content

Commit

Permalink
Merge pull request icegreentee#358 from segfault-bilibili/rollup-6.4.4
Browse files Browse the repository at this point in the history
【6.4.4】修正特殊分辨率root权限截屏
  • Loading branch information
segfault-bilibili committed Aug 31, 2022
2 parents 6c55bc8 + d5a3deb commit 0ec1c4d
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 15 deletions.
Binary file modified bin/scrcap2bmp-arm
Binary file not shown.
Binary file modified bin/scrcap2bmp-arm64
Binary file not shown.
Binary file modified bin/scrcap2bmp-x86
Binary file not shown.
Binary file modified bin/scrcap2bmp-x86_64
Binary file not shown.
26 changes: 18 additions & 8 deletions bin/scrcap2bmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ int px_size32 = 0;
int px_size24 = 0;
int line_size32 = 0;
int line_size24 = 0;
int line_padding_size = 0;
int total_padding_size = 0;

unsigned char *buf, *ptr, *ptr2, *tmp_buf;

Expand Down Expand Up @@ -311,7 +313,7 @@ static void flip_pixels(unsigned char *group, int elements_per_group, int bytes_
len = elements_per_group / 2 - 1;
}

if (elements_per_group >= 4) memcpy(px1, px2, (elements_per_group/2-1)*bytes_per_element);
if (elements_per_group >= 4) memmove(px1, px2, (elements_per_group/2-1)*bytes_per_element);

memcpy(group + group_size_bytes - bytes_per_element, tmp_buf, bytes_per_element);

Expand Down Expand Up @@ -544,6 +546,12 @@ int main(int argc, char **argv) {
px_size24 = px_count * 3;
line_size32 = scr_width * 4;
line_size24 = scr_width * 3;
line_padding_size = (4 - line_size24 % 4) % 4;
total_padding_size = line_padding_size * scr_height;
if (bmp && line_padding_size != 0) {
line_size24 += line_padding_size;
px_size24 += total_padding_size;
}

scrdump_header_size = scrdump_size - px_size32;
if (scrdump_header_size < 0 || (scrdump_header_size != 12 && scrdump_header_size != 16)) {
Expand Down Expand Up @@ -609,20 +617,22 @@ int main(int argc, char **argv) {
ptr = buf + scrdump_header_size + del - 1;
ptr2 = ptr + 1;

if (del >= 1 && del <= 3 && px_count >= 2) {
for (i = 1, j = 1; i <= px_count - 1; i++, j++) {
memmove(ptr, ptr2, 3);
ptr += 3;
ptr2 += 4;
if (line_padding_size != 0 && j == scr_width) {
memset(ptr - (del - 1), 0, line_padding_size);
ptr += line_padding_size;
j = 0;
}
}

for (i=0; i<px_count-2; i++) {
memmove(ptr, ptr2, 3);
memmove(ptr, ptr2, 4 - del);
if (line_padding_size != 0) {
ptr += 3;
ptr2 += 4;
memset(ptr - (del - 1), 0, line_padding_size);
}

if (del >= 1 && del <= 3) memmove(ptr, ptr2, 4-del);
if (del == 4) memmove(ptr, ptr2, 3);
break;
default:
fprintf(stderr, "Unknown del=%d\n", del);
Expand Down
2 changes: 1 addition & 1 deletion project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"build"
],
"packageName": "top.momoe.auto",
"versionName": "6.4.3",
"versionName": "6.4.4",
"versionInfo": "",
"versionCode": 1,
"icon":"./images/icon.png",
Expand Down
2 changes: 1 addition & 1 deletion update/fileJson/0.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion update/fileJson/1.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion update/fileJson/2.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion update/fileJson/3.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion update/updateList.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion update/updateList.json.sig.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
B5E/hzNm8uRnyIJ1k1izj29XwdjatYnvnFcKXERRBqGkKQbt/ZBuCe5hdA/FWL//JNhPR+JKTsgC3WG3XiiNJh6eNidz3n3I8Mx1mBkDfjHGGP5qYxd9gQTr0cVXKGCS4XMeE9wEuNUGsd60OU9qvgu+fJ5cT5xlxgBcwjdGwOi+QR/zFf9fr8tFs1Pu+HXs11FbaAX8QMeQ+7Ajvsu6r3pdI5hOlrM3zye7lkrvvlqhLFOlsyGUE37YLi8n09xb46Nqm74S+2ZPAZPVL3x0rKc5FqGGkxmn54XUP/1EBnJOT15go4yBbqyMaohXDn6IG8W82qhGqTV48Ahkn9S9IQ==
bo2ubgYvc8J/2M+VlS7bdMs/Att5rRkmQJD6Qqw+XbsEDMjQX0xmbmE6m6xlk8fiB1Fk+xCQPWWOChOpGx11cl5In5Ie0vBbVOOGhsEnO6jHD5XSW3O9q3G1XQOl/ggPGT2bE36jUFIiYaL98n2GJzBsXqYNlarIC5U3QTFrE/+GxArKjfiSq1SmhoWrZAj7TTalkA9+ZMracG5eycAGRH/3CvPG0Jj4TWBpBeCub0aHnxWcnYHnVuYMkntTTfQaK+MUeyvpnZHQ4dmSkBH5ddV8t6Mre5Zjb1PeqnYOQqbbI2pyh0vN5PT5MuszrTE+2XeRcY0DM74L5YU09aEKTw==

0 comments on commit 0ec1c4d

Please sign in to comment.