Skip to content

Commit e9f3b33

Browse files
committed
Merge branch 'master' into playstore
2 parents ff0b1ed + 51b7310 commit e9f3b33

14 files changed

+42
-24
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ pcap/
1818
.cxx
1919
app/release/
2020
app/debug/
21+
app/standard/
22+
app/withoutUshark/
2123
keystore
2224

2325
# Python

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
Releases available at https://github.com/emanuele-f/PCAPdroid/releases
44

5+
## [1.8.3] - 2025-03-08
6+
- Fix crash when adding a protocol filter
7+
- Fix possible Skus deserialization errors (Play build)
8+
- Fix empty state not visible in edit list views
9+
- Support building ushark from the source (F-Droid)
10+
- Update NDK to r26d
11+
512
## [1.8.2] - 2025-03-04
613
- Fix crash on capture start with port mapping rules
714

app/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ android {
99
keyPassword 'android'
1010
}
1111
}
12-
ndkVersion "26.1.10909125"
12+
ndkVersion "26.3.11579264"
1313

1414
defaultConfig {
1515
applicationId "com.emanuelef.remote_capture"
1616
minSdkVersion 21
1717
compileSdk 35
1818
targetSdk 35
19-
versionCode 81
20-
versionName "1.8.2"
19+
versionCode 82
20+
versionName "1.8.3"
2121

2222
// only include full translations
2323
// NOTE: keep in sync with locales_config.xml

app/src/main/java/com/emanuelef/remote_capture/Utils.java

+8-2
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,11 @@ public static String proto2str(int proto) {
391391
public static String[] getL7Protocols() {
392392
if(l7Protocols == null) {
393393
List<String> protos = CaptureService.getL7Protocols();
394-
Collections.sort(protos, String.CASE_INSENSITIVE_ORDER);
395-
l7Protocols = protos.toArray(new String[0]);
394+
395+
if (protos != null) {
396+
Collections.sort(protos, String.CASE_INSENSITIVE_ORDER);
397+
l7Protocols = protos.toArray(new String[0]);
398+
}
396399
}
397400

398401
return l7Protocols;
@@ -1693,6 +1696,9 @@ public static boolean validateHost(String host) {
16931696
}
16941697

16951698
public static String uriToFilePath(Context ctx, Uri uri) {
1699+
if (uri == null)
1700+
return null;
1701+
16961702
// https://gist.github.com/r0b0t3d/492f375ec6267a033c23b4ab8ab11e6a
16971703
if (isExternalStorageDocument(uri)) {
16981704
final String docId = DocumentsContract.getDocumentId(uri);

app/src/main/java/com/emanuelef/remote_capture/activities/EditFilterActivity.java

+3
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@ protected void onCreate(Bundle savedInstanceState) {
157157
}
158158

159159
if (reg != null) {
160+
long minSizeKB = mFilter.minSize / 1024;
160161
long maxSizeKB = reg.getMaxBytes() / 1024;
162+
maxSizeKB = Math.max(maxSizeKB, minSizeKB);
163+
161164
if (maxSizeKB >= 2) {
162165
mSizeSider.setValueTo(maxSizeKB);
163166
mSizeSider.setLabelFormatter(value -> Utils.formatBytes(((long) value) * 1024));

app/src/main/java/com/emanuelef/remote_capture/activities/EditListActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ protected void onCreate(Bundle savedInstanceState) {
5757
setContentView(R.layout.fragment_activity);
5858

5959
getSupportFragmentManager().beginTransaction()
60-
.replace(R.id.fragment, mListInfo.newFragment(true))
60+
.replace(R.id.fragment, mListInfo.newFragment())
6161
.commit();
6262
}
6363

app/src/main/java/com/emanuelef/remote_capture/activities/FirewallActivity.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ public Fragment createFragment(int position) {
7979
case POS_STATUS:
8080
return new FirewallStatus();
8181
case POS_BLOCKLIST:
82-
return EditListFragment.newInstance(ListInfo.Type.BLOCKLIST, false);
82+
return EditListFragment.newInstance(ListInfo.Type.BLOCKLIST);
8383
case POS_WHITELIST:
84-
return EditListFragment.newInstance(ListInfo.Type.FIREWALL_WHITELIST, false);
84+
return EditListFragment.newInstance(ListInfo.Type.FIREWALL_WHITELIST);
8585
}
8686
}
8787

app/src/main/java/com/emanuelef/remote_capture/activities/MalwareDetection.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public Fragment createFragment(int position) {
7474
case POS_BLACKLISTS:
7575
return new BlacklistsFragment();
7676
case POS_WHITELIST:
77-
return EditListFragment.newInstance(ListInfo.Type.MALWARE_WHITELIST, false);
77+
return EditListFragment.newInstance(ListInfo.Type.MALWARE_WHITELIST);
7878
}
7979
}
8080

app/src/main/java/com/emanuelef/remote_capture/fragments/ConnectionOverview.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,8 @@ public void connectionUpdated() {
355355
mError.setText(R.string.decryption_info_no_rule);
356356
mError.setVisibility(View.VISIBLE);
357357
} else if((mConn.getDecryptionStatus() == ConnectionDescriptor.DecryptionStatus.NOT_DECRYPTABLE)
358-
&& mConn.l7proto.equals("QUIC")) {
358+
&& mConn.l7proto.equals("QUIC") &&
359+
CaptureService.isDecryptingTLS()) {
359360
mError.setTextColor(ContextCompat.getColor(context, R.color.warning));
360361
mError.setText(R.string.decrypt_quic_notice);
361362
mError.setVisibility(View.VISIBLE);

app/src/main/java/com/emanuelef/remote_capture/fragments/ConnectionsFragment.java

+2
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,8 @@ private void refreshActiveFilter() {
843843

844844
if ((reg != null) && (minSizeKB > 0)) {
845845
long maxSizeKb = reg.getMaxBytes() / 1024;
846+
maxSizeKb = Math.max(maxSizeKb, minSizeKB);
847+
846848
if (maxSizeKb >= 2) {
847849
// NOTE: visible -> hidden transition is performed in onStopTrackingTouch
848850
mSizeSlider.setValueTo(maxSizeKb);

app/src/main/java/com/emanuelef/remote_capture/fragments/EditListFragment.java

+2-9
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,16 @@ public class EditListFragment extends Fragment implements MatchList.ListChangeLi
8282
private static final int MAX_RULES_BEFORE_WARNING = 5000;
8383
private static final String TAG = "EditListFragment";
8484
private static final String LIST_TYPE_ARG = "list_type";
85-
private static final String FITS_SYSTEM_WINDOWS_ARG = "fits_system_windows";
8685

8786
private final ActivityResultLauncher<Intent> exportLauncher =
8887
registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), this::exportResult);
8988
private final ActivityResultLauncher<Intent> importLauncher =
9089
registerForActivityResult(new ActivityResultContracts.StartActivityForResult(), this::importResult);
9190

92-
public static EditListFragment newInstance(ListInfo.Type list, boolean fitsSystemWindows) {
91+
public static EditListFragment newInstance(ListInfo.Type list) {
9392
EditListFragment fragment = new EditListFragment();
9493
Bundle args = new Bundle();
9594
args.putSerializable(LIST_TYPE_ARG, list);
96-
args.putSerializable(FITS_SYSTEM_WINDOWS_ARG, fitsSystemWindows);
9795

9896
fragment.setArguments(args);
9997
return fragment;
@@ -110,10 +108,10 @@ public View onCreateView(LayoutInflater inflater,
110108
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
111109
mListView = view.findViewById(R.id.listview);
112110
mEmptyText = view.findViewById(R.id.list_empty);
111+
view.findViewById(R.id.simple_list).setFitsSystemWindows(true);
113112

114113
assert getArguments() != null;
115114
mListInfo = new ListInfo(Utils.getSerializable(getArguments(), LIST_TYPE_ARG, ListInfo.Type.class));
116-
boolean fitsSystemWindows = Boolean.TRUE.equals(Utils.getSerializable(getArguments(), FITS_SYSTEM_WINDOWS_ARG, Boolean.class));
117115
mList = mListInfo.getList();
118116
mList.addListChangeListener(this);
119117

@@ -175,11 +173,6 @@ public void onDestroyActionMode(ActionMode mode) {
175173
}
176174
});
177175

178-
if (fitsSystemWindows)
179-
mListView.setFitsSystemWindows(true);
180-
else
181-
Utils.fixListviewInsetsBottom(mListView);
182-
183176
mAdapter.reload(mList.iterRules());
184177
recheckListSize();
185178
}

app/src/main/java/com/emanuelef/remote_capture/model/ListInfo.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public void reloadRules() {
141141
}
142142
}
143143

144-
public EditListFragment newFragment(boolean fitsSystemWindows) {
145-
return EditListFragment.newInstance(mType, fitsSystemWindows);
144+
public EditListFragment newFragment() {
145+
return EditListFragment.newInstance(mType);
146146
}
147147
}

app/src/main/jni/core/jni_impl.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -1073,12 +1073,16 @@ Java_com_emanuelef_remote_1capture_CaptureService_getL7Protocols(JNIEnv *env, jc
10731073
if(!ndpi)
10741074
return(NULL);
10751075

1076+
NDPI_PROTOCOL_BITMASK protocols;
1077+
NDPI_BITMASK_SET_ALL(protocols);
1078+
ndpi_set_protocol_detection_bitmask2(ndpi, &protocols);
1079+
10761080
jobject plist = (*env)->NewObject(env, arrayListClass, arrayListNew);
10771081
if((plist == NULL) || jniCheckException(env))
1078-
return false;
1082+
return NULL;
10791083

10801084
bool success = true;
1081-
int num_protos = (int)ndpi_get_ndpi_num_supported_protocols(ndpi);
1085+
int num_protos = (int) ndpi_get_ndpi_num_supported_protocols(ndpi);
10821086
ndpi_proto_defaults_t* proto_defaults = ndpi_get_proto_defaults(ndpi);
10831087

10841088
ndpi_protocol_bitmask_struct_t unique_protos;

0 commit comments

Comments
 (0)