diff --git a/src/main/res/xml/pref_all.xml b/src/main/res/xml/pref_all.xml index 25cbd4a0..befdccf0 100644 --- a/src/main/res/xml/pref_all.xml +++ b/src/main/res/xml/pref_all.xml @@ -94,7 +94,7 @@ android:summary="@string/kcp_port_summary" android:title="@string/kcp_port"/> - { + val dialog = new AlertDialog.Builder(context) + .setTitle("?") + .setMessage(asScalaBuffer(Shell.SH.run(context.getApplicationInfo.dataDir + "/kcptun --help")) + .dropWhile(line => line != "GLOBAL OPTIONS:") + .drop(1) + .takeWhile(line => line.length() > 3) + .filter(line => + !line.startsWith(" --localaddr ") && + !line.startsWith(" --remoteaddr ") && + !line.startsWith(" --path ") && + !line.startsWith(" --help,") && + !line.startsWith(" --version,")) + .mkString("\n")) + .show() + val window = dialog.getWindow + val attrs = window.getAttributes + attrs.width = ViewGroup.LayoutParams.MATCH_PARENT + window.setAttributes(attrs) + }): DialogInterface.OnClickListener) + } +}