1
0
mirror of https://github.com/NekoX-Dev/NekoX.git synced 2024-12-12 10:49:27 +01:00

show full url

This commit is contained in:
luvletter2333 2022-02-28 19:42:07 +08:00
parent 1c57ed952e
commit be3ff350fb
No known key found for this signature in database
GPG Key ID: A26A8880836E1978

View File

@ -1001,19 +1001,19 @@ public class AlertsCreator {
if (Browser.isInternalUrl(url, null) || !ask || NekoConfig.skipOpenLinkConfirm.Bool()) {
Browser.openUrl(fragment.getParentActivity(), url, inlineReturn == 0, tryTelegraph);
} else {
String urlFinal;
if (punycode) {
try {
Uri uri = Uri.parse(url);
String host = IDN.toASCII(uri.getHost(), IDN.ALLOW_UNASSIGNED);
urlFinal = uri.getScheme() + "://" + host + uri.getPath();
} catch (Exception e) {
FileLog.e(e);
urlFinal = url;
}
} else {
urlFinal = url;
}
String urlFinal = url;
// if (punycode) {
// try {
// Uri uri = Uri.parse(url);
// String host = IDN.toASCII(uri.getHost(), IDN.ALLOW_UNASSIGNED);
// urlFinal = uri.getScheme() + "://" + host + uri.getPath();
// } catch (Exception e) {
// FileLog.e(e);
// urlFinal = url;
// }
// } else {
// urlFinal = url;
// }
AlertDialog.Builder builder = new AlertDialog.Builder(fragment.getParentActivity(), resourcesProvider);
builder.setTitle(LocaleController.getString("OpenUrlTitle", R.string.OpenUrlTitle));
String format = LocaleController.getString("OpenUrlAlert2", R.string.OpenUrlAlert2);