From 0dee1b8eba67c046fcbfcc6dc1d97f45e8186f08 Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Tue, 24 Jun 2025 13:46:18 -0700 Subject: [PATCH] Remove the open file as an MHT web archive checkbox on API >= 35. https://redmine.stoutner.com/issues/1253 --- app/build.gradle | 10 +++--- .../dialogs/AboutViewHeadersDialog.kt | 26 +++++++------- .../privacybrowser/dialogs/AddDomainDialog.kt | 24 ++++++------- .../dialogs/CreateBookmarkDialog.kt | 29 +++++++-------- .../dialogs/CreateBookmarkFolderDialog.kt | 32 +++++++++-------- .../dialogs/CreateHomeScreenShortcutDialog.kt | 34 +++++++++--------- .../dialogs/DeleteAllDomainsDialog.kt | 28 +++++++-------- .../dialogs/EditBookmarkDatabaseViewDialog.kt | 26 +++++++------- .../dialogs/EditBookmarkDialog.kt | 29 +++++++-------- .../EditBookmarkFolderDatabaseViewDialog.kt | 29 ++++++++------- .../dialogs/EditBookmarkFolderDialog.kt | 29 +++++++-------- .../privacybrowser/dialogs/FontSizeDialog.kt | 26 +++++++------- .../dialogs/HttpAuthenticationDialog.kt | 26 +++++++------- .../dialogs/MoveToFolderDialog.kt | 26 +++++++------- .../privacybrowser/dialogs/OpenDialog.kt | 36 +++++++++++-------- .../dialogs/PinnedMismatchDialog.kt | 26 +++++++------- .../dialogs/ProxyNotInstalledDialog.kt | 26 +++++++------- .../privacybrowser/dialogs/SaveDialog.kt | 26 +++++++------- .../dialogs/SslCertificateErrorDialog.kt | 32 ++++++++--------- .../dialogs/UntrustedSslCertificateDialog.kt | 26 +++++++------- .../dialogs/UrlHistoryDialog.kt | 26 +++++++------- .../dialogs/ViewHeadersDetailDialog.kt | 26 +++++++------- .../dialogs/ViewRequestDialog.kt | 26 +++++++------- .../dialogs/ViewSslCertificateDialog.kt | 34 +++++++++--------- .../dialogs/WaitingForProxyDialog.kt | 26 +++++++------- build.gradle | 4 +-- gradle/wrapper/gradle-wrapper.properties | 2 +- 27 files changed, 351 insertions(+), 339 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index f8a4eac3..51d0b9fd 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -85,20 +85,20 @@ dependencies { implementation "androidx.activity:activity-ktx:1.10.1" implementation 'androidx.arch.core:core-common:2.2.0' implementation 'androidx.arch.core:core-runtime:2.2.0' - implementation 'androidx.appcompat:appcompat:1.7.0' + implementation 'androidx.appcompat:appcompat:1.7.1' implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.coordinatorlayout:coordinatorlayout:1.3.0' implementation 'androidx.core:core-ktx:1.16.0' implementation 'androidx.drawerlayout:drawerlayout:1.2.0' - implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.9.0' + implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.9.1' implementation 'androidx.preference:preference-ktx:1.2.1' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' implementation 'androidx.viewpager:viewpager:1.1.0' - implementation 'androidx.webkit:webkit:1.13.0' + implementation 'androidx.webkit:webkit:1.14.0' // Include the Kotlin standard library. This should be the same version number listed in project build.gradle. - implementation 'org.jetbrains.kotlin:kotlin-stdlib:2.1.0' + implementation 'org.jetbrains.kotlin:kotlin-stdlib:2.1.20' // Include the Google material library. - implementation 'com.google.android.material:material:1.13.0-alpha13' + implementation 'com.google.android.material:material:1.13.0-alpha14' } diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/AboutViewHeadersDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/AboutViewHeadersDialog.kt index a03a7faa..83bd7de3 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/AboutViewHeadersDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/AboutViewHeadersDialog.kt @@ -1,20 +1,20 @@ -/* - * Copyright 2018-2023 Soren Stoutner . +/* SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2018-2023 Soren Stoutner * - * This file is part of Privacy Browser Android . + * This file is part of Privacy Browser Android . * - * Privacy Browser Android is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. * - * Privacy Browser Android is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * You should have received a copy of the GNU General Public License - * along with Privacy Browser Android. If not, see . + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.stoutner.privacybrowser.dialogs diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/AddDomainDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/AddDomainDialog.kt index be337f60..38b70757 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/AddDomainDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/AddDomainDialog.kt @@ -1,20 +1,20 @@ -/* - * Copyright 2017-2024 Soren Stoutner . +/* SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2017-2024 Soren Stoutner * * This file is part of Privacy Browser Android . * - * Privacy Browser Android is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. * - * Privacy Browser Android is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * You should have received a copy of the GNU General Public License - * along with Privacy Browser Android. If not, see . + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.stoutner.privacybrowser.dialogs diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateBookmarkDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateBookmarkDialog.kt index 60d199ca..7f6bcb3a 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateBookmarkDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateBookmarkDialog.kt @@ -1,20 +1,20 @@ -/* - * Copyright 2016-2024 Soren Stoutner . +/* SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2016-2025 Soren Stoutner * - * This file is part of Privacy Browser Android . + * This file is part of Privacy Browser Android . * - * Privacy Browser Android is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. * - * Privacy Browser Android is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * You should have received a copy of the GNU General Public License - * along with Privacy Browser Android. If not, see . + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.stoutner.privacybrowser.dialogs @@ -40,6 +40,7 @@ import android.widget.RadioButton import androidx.activity.result.contract.ActivityResultContracts import androidx.appcompat.app.AlertDialog import androidx.appcompat.content.res.AppCompatResources +import androidx.core.graphics.scale import androidx.fragment.app.DialogFragment import androidx.preference.PreferenceManager @@ -108,7 +109,7 @@ class CreateBookmarkDialog : DialogFragment() { // Scale the image down if it is greater than 128 pixels in either direction. if ((imageBitmap != null) && ((imageBitmap.height > 128) || (imageBitmap.width > 128))) - imageBitmap = Bitmap.createScaledBitmap(imageBitmap, 128, 128, true) + imageBitmap = imageBitmap.scale(128, 128) // Display the new custom favorite icon. customIconImageView.setImageBitmap(imageBitmap) diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateBookmarkFolderDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateBookmarkFolderDialog.kt index 1bc8c0e9..7bdd0033 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateBookmarkFolderDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateBookmarkFolderDialog.kt @@ -1,20 +1,20 @@ -/* - * Copyright 2016-2024 Soren Stoutner . +/* SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2016-2025 Soren Stoutner * - * This file is part of Privacy Browser Android . + * This file is part of Privacy Browser Android . * - * Privacy Browser Android is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. * - * Privacy Browser Android is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * You should have received a copy of the GNU General Public License - * along with Privacy Browser Android. If not, see . + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.stoutner.privacybrowser.dialogs @@ -36,13 +36,15 @@ import android.widget.EditText import android.widget.ImageView import android.widget.LinearLayout import android.widget.RadioButton -import androidx.activity.result.contract.ActivityResultContracts +import androidx.activity.result.contract.ActivityResultContracts import androidx.appcompat.app.AlertDialog import androidx.appcompat.content.res.AppCompatResources import androidx.core.graphics.drawable.toBitmap +import androidx.core.graphics.scale import androidx.fragment.app.DialogFragment import androidx.preference.PreferenceManager + import com.google.android.material.snackbar.Snackbar import com.stoutner.privacybrowser.R @@ -104,7 +106,7 @@ class CreateBookmarkFolderDialog : DialogFragment() { // Scale the image down if it is greater than 128 pixels in either direction. if ((imageBitmap != null) && ((imageBitmap.height > 128) || (imageBitmap.width > 128))) - imageBitmap = Bitmap.createScaledBitmap(imageBitmap, 128, 128, true) + imageBitmap = imageBitmap.scale(128, 128) // Display the new custom favorite icon. customIconImageView.setImageBitmap(imageBitmap) diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateHomeScreenShortcutDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateHomeScreenShortcutDialog.kt index 841456e3..4eac20cf 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateHomeScreenShortcutDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateHomeScreenShortcutDialog.kt @@ -1,20 +1,20 @@ -/* - * Copyright © 2015-2024 Soren Stoutner . +/* SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2015-2025 Soren Stoutner * - * This file is part of Privacy Browser Android . + * This file is part of Privacy Browser Android . * - * Privacy Browser Android is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. * - * Privacy Browser Android is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * You should have received a copy of the GNU General Public License - * along with Privacy Browser Android. If not, see . + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.stoutner.privacybrowser.dialogs @@ -24,9 +24,7 @@ import android.content.DialogInterface import android.content.Intent import android.graphics.Bitmap import android.graphics.BitmapFactory -import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.Drawable -import android.net.Uri import android.os.Bundle import android.text.Editable import android.text.TextWatcher @@ -41,6 +39,8 @@ import androidx.appcompat.app.AlertDialog import androidx.core.content.pm.ShortcutInfoCompat import androidx.core.content.pm.ShortcutManagerCompat import androidx.core.graphics.drawable.IconCompat +import androidx.core.graphics.drawable.toDrawable +import androidx.core.net.toUri import androidx.fragment.app.DialogFragment import androidx.preference.PreferenceManager @@ -103,7 +103,7 @@ class CreateHomeScreenShortcutDialog : DialogFragment() { val favoriteIconBitmap = BitmapFactory.decodeByteArray(favoriteIconByteArray, 0, favoriteIconByteArray.size) // Create a drawable version of the favorite icon. - val favoriteIconDrawable: Drawable = BitmapDrawable(resources, favoriteIconBitmap) + val favoriteIconDrawable: Drawable = favoriteIconBitmap.toDrawable(resources) // Use an alert dialog builder to create the dialog. val dialogBuilder = AlertDialog.Builder(requireContext(), R.style.PrivacyBrowserAlertDialog) @@ -252,7 +252,7 @@ class CreateHomeScreenShortcutDialog : DialogFragment() { } // Add the URL to the intent. - shortcutIntent.data = Uri.parse(urlString) + shortcutIntent.data = urlString.toUri() // Create a shortcut info builder. The shortcut name becomes the shortcut ID. val shortcutInfoBuilder = ShortcutInfoCompat.Builder(requireContext(), shortcutName) diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/DeleteAllDomainsDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/DeleteAllDomainsDialog.kt index 93a6f19c..c498ac78 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/DeleteAllDomainsDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/DeleteAllDomainsDialog.kt @@ -1,20 +1,20 @@ -/* - * Copyright 2018-2024 Soren Stoutner . +/* SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2018-2025 Soren Stoutner * * This file is part of Privacy Browser Android . * - * Privacy Browser Android is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. * - * Privacy Browser Android is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * You should have received a copy of the GNU General Public License - * along with Privacy Browser Android. If not, see . + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.stoutner.privacybrowser.dialogs @@ -65,10 +65,10 @@ class DeleteAllDomainsDialog : DialogFragment() { dialogBuilder.setNegativeButton(R.string.cancel, null) // Set the positive button. - dialogBuilder.setPositiveButton(R.string.delete, { _: DialogInterface, _: Int -> + dialogBuilder.setPositiveButton(R.string.delete) { _: DialogInterface, _: Int -> // Delete all the domain settings. deleteAllDomainSettingsListener.deleteAllDomainSettings() - }) + } // Create an alert dialog from the alert dialog builder. val alertDialog = dialogBuilder.create() diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkDatabaseViewDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkDatabaseViewDialog.kt index 251344cf..5199ebbb 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkDatabaseViewDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkDatabaseViewDialog.kt @@ -1,20 +1,20 @@ -/* - * Copyright 2016-2025 Soren Stoutner . +/* SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2016-2025 Soren Stoutner * - * This file is part of Privacy Browser Android . + * This file is part of Privacy Browser Android . * - * Privacy Browser Android is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. * - * Privacy Browser Android is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * You should have received a copy of the GNU General Public License - * along with Privacy Browser Android. If not, see . + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.stoutner.privacybrowser.dialogs diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkDialog.kt index a81a41c3..02fd21af 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkDialog.kt @@ -1,20 +1,20 @@ -/* - * Copyright 2016-2024 Soren Stoutner . +/* SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2016-2025 Soren Stoutner * - * This file is part of Privacy Browser Android . + * This file is part of Privacy Browser Android . * - * Privacy Browser Android is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. * - * Privacy Browser Android is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * You should have received a copy of the GNU General Public License - * along with Privacy Browser Android. If not, see . + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.stoutner.privacybrowser.dialogs @@ -40,6 +40,7 @@ import android.widget.RadioButton import androidx.activity.result.contract.ActivityResultContracts import androidx.appcompat.app.AlertDialog import androidx.appcompat.content.res.AppCompatResources +import androidx.core.graphics.scale import androidx.fragment.app.DialogFragment import androidx.preference.PreferenceManager @@ -110,7 +111,7 @@ class EditBookmarkDialog : DialogFragment() { // Scale the image down if it is greater than 64 pixels in either direction. if ((imageBitmap != null) && ((imageBitmap.height > 128) || (imageBitmap.width > 128))) - imageBitmap = Bitmap.createScaledBitmap(imageBitmap, 128, 128, true) + imageBitmap = imageBitmap.scale(128, 128) // Display the new custom favorite icon. customIconImageView.setImageBitmap(imageBitmap) diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkFolderDatabaseViewDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkFolderDatabaseViewDialog.kt index 89fbf84e..827d5f5d 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkFolderDatabaseViewDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkFolderDatabaseViewDialog.kt @@ -1,20 +1,20 @@ -/* - * Copyright 2016-2025 Soren Stoutner . +/* SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2016-2025 Soren Stoutner * - * This file is part of Privacy Browser Android . + * This file is part of Privacy Browser Android . * - * Privacy Browser Android is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. * - * Privacy Browser Android is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * You should have received a copy of the GNU General Public License - * along with Privacy Browser Android. If not, see . + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.stoutner.privacybrowser.dialogs @@ -48,6 +48,7 @@ import androidx.appcompat.app.AlertDialog import androidx.appcompat.content.res.AppCompatResources import androidx.core.content.ContextCompat import androidx.core.graphics.drawable.toBitmap +import androidx.core.graphics.scale import androidx.cursoradapter.widget.ResourceCursorAdapter import androidx.fragment.app.DialogFragment import androidx.preference.PreferenceManager @@ -65,8 +66,6 @@ import com.stoutner.privacybrowser.helpers.ID import com.stoutner.privacybrowser.helpers.PARENT_FOLDER_ID import com.stoutner.privacybrowser.helpers.BookmarksDatabaseHelper -import androidx.core.graphics.scale - import java.io.ByteArrayOutputStream // Define the class constants. diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkFolderDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkFolderDialog.kt index 3c19eb13..cb7f29a6 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkFolderDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkFolderDialog.kt @@ -1,20 +1,20 @@ -/* - * Copyright 2016-2024 Soren Stoutner . +/* SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2016-2025 Soren Stoutner * - * This file is part of Privacy Browser Android . + * This file is part of Privacy Browser Android . * - * Privacy Browser Android is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. * - * Privacy Browser Android is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * You should have received a copy of the GNU General Public License - * along with Privacy Browser Android. If not, see . + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.stoutner.privacybrowser.dialogs @@ -41,6 +41,7 @@ import androidx.activity.result.contract.ActivityResultContracts import androidx.appcompat.app.AlertDialog import androidx.appcompat.content.res.AppCompatResources import androidx.core.graphics.drawable.toBitmap +import androidx.core.graphics.scale import androidx.fragment.app.DialogFragment import androidx.preference.PreferenceManager @@ -110,7 +111,7 @@ class EditBookmarkFolderDialog : DialogFragment() { // Scale the image down if it is greater than 64 pixels in either direction. if ((imageBitmap != null) && ((imageBitmap.height > 128) || (imageBitmap.width > 128))) - imageBitmap = Bitmap.createScaledBitmap(imageBitmap, 128, 128, true) + imageBitmap = imageBitmap.scale(128, 128) // Display the new custom favorite icon. customIconImageView.setImageBitmap(imageBitmap) diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/FontSizeDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/FontSizeDialog.kt index 86e82efc..41d28a95 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/FontSizeDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/FontSizeDialog.kt @@ -1,20 +1,20 @@ -/* - * Copyright © 2019-2023 Soren Stoutner . +/* SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2019-2023 Soren Stoutner * - * This file is part of Privacy Browser Android . + * This file is part of Privacy Browser Android . * - * Privacy Browser Android is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. * - * Privacy Browser Android is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * You should have received a copy of the GNU General Public License - * along with Privacy Browser Android. If not, see . + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.stoutner.privacybrowser.dialogs diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/HttpAuthenticationDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/HttpAuthenticationDialog.kt index 1f2f1f2f..16df7430 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/HttpAuthenticationDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/HttpAuthenticationDialog.kt @@ -1,20 +1,20 @@ -/* - * Copyright © 2017-2023 Soren Stoutner . +/* SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2017-2023 Soren Stoutner * - * This file is part of Privacy Browser Android . + * This file is part of Privacy Browser Android . * - * Privacy Browser Android is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. * - * Privacy Browser Android is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * You should have received a copy of the GNU General Public License - * along with Privacy Browser Android. If not, see . + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.stoutner.privacybrowser.dialogs diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/MoveToFolderDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/MoveToFolderDialog.kt index a3d2f09b..731bec1d 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/MoveToFolderDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/MoveToFolderDialog.kt @@ -1,20 +1,20 @@ -/* - * Copyright 2016-2023 Soren Stoutner . +/* SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2016-2023 Soren Stoutner * - * This file is part of Privacy Browser Android . + * This file is part of Privacy Browser Android . * - * Privacy Browser Android is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. * - * Privacy Browser Android is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * You should have received a copy of the GNU General Public License - * along with Privacy Browser Android. If not, see . + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.stoutner.privacybrowser.dialogs diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/OpenDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/OpenDialog.kt index c112a917..63e28ef9 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/OpenDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/OpenDialog.kt @@ -1,20 +1,20 @@ -/* - * Copyright 2019-2023 Soren Stoutner . +/* SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2019-2023, 2025 Soren Stoutner * - * This file is part of Privacy Browser Android . + * This file is part of Privacy Browser Android . * - * Privacy Browser Android is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. * - * Privacy Browser Android is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * You should have received a copy of the GNU General Public License - * along with Privacy Browser Android. If not, see . + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.stoutner.privacybrowser.dialogs @@ -23,6 +23,7 @@ import android.app.Dialog import android.content.Context import android.content.DialogInterface import android.net.Uri +import android.os.Build import android.os.Bundle import android.text.Editable import android.text.TextWatcher @@ -35,6 +36,7 @@ import android.widget.TextView import androidx.activity.result.contract.ActivityResultContracts import androidx.appcompat.app.AlertDialog +import androidx.core.view.isVisible import androidx.fragment.app.DialogFragment import androidx.preference.PreferenceManager @@ -128,6 +130,12 @@ class OpenDialog : DialogFragment() { // Initially disable the open button. openButton.isEnabled = false + // Only display the MHT check box if the API <= 34 (Android 14). + if (Build.VERSION.SDK_INT <= 34) + mhtCheckBox.visibility = View.VISIBLE + else + mhtCheckBox.visibility = View.GONE + // Update the status of the open button when the file name changes. fileNameEditText.addTextChangedListener(object : TextWatcher { override fun beforeTextChanged(charSequence: CharSequence, i: Int, i1: Int, i2: Int) { @@ -182,6 +190,6 @@ class OpenDialog : DialogFragment() { super.onSaveInstanceState(savedInstanceState) // Add the MHT explanation visibility status to the bundle. - savedInstanceState.putBoolean(MHT_EXPLANATION_VISIBILITY, mhtExplanationTextView.visibility == View.VISIBLE) + savedInstanceState.putBoolean(MHT_EXPLANATION_VISIBILITY, mhtExplanationTextView.isVisible) } } diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/PinnedMismatchDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/PinnedMismatchDialog.kt index c345fc5c..b76c062c 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/PinnedMismatchDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/PinnedMismatchDialog.kt @@ -1,20 +1,20 @@ -/* - * Copyright 2017-2023 Soren Stoutner . +/* SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2017-2023 Soren Stoutner * - * This file is part of Privacy Browser Android . + * This file is part of Privacy Browser Android . * - * Privacy Browser Android is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. * - * Privacy Browser Android is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * You should have received a copy of the GNU General Public License - * along with Privacy Browser Android. If not, see . + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.stoutner.privacybrowser.dialogs diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/ProxyNotInstalledDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/ProxyNotInstalledDialog.kt index b799e3d3..0d9df133 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/ProxyNotInstalledDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/ProxyNotInstalledDialog.kt @@ -1,20 +1,20 @@ -/* - * Copyright © 2019-2023 Soren Stoutner . +/* SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2019-2023 Soren Stoutner * - * This file is part of Privacy Browser Android . + * This file is part of Privacy Browser Android . * - * Privacy Browser Android is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. * - * Privacy Browser Android is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * You should have received a copy of the GNU General Public License - * along with Privacy Browser Android. If not, see . + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.stoutner.privacybrowser.dialogs diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/SaveDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/SaveDialog.kt index dca20947..148e90e9 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/SaveDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/SaveDialog.kt @@ -1,20 +1,20 @@ -/* - * Copyright 2019-2024 Soren Stoutner . +/* SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2019-2024 Soren Stoutner * - * This file is part of Privacy Browser Android . + * This file is part of Privacy Browser Android . * - * Privacy Browser Android is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. * - * Privacy Browser Android is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * You should have received a copy of the GNU General Public License - * along with Privacy Browser Android. If not, see . + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.stoutner.privacybrowser.dialogs diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/SslCertificateErrorDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/SslCertificateErrorDialog.kt index 60df833f..7c7a2b67 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/SslCertificateErrorDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/SslCertificateErrorDialog.kt @@ -1,27 +1,26 @@ -/* - * Copyright 2016-2023 Soren Stoutner . +/* SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2016-2023, 2025 Soren Stoutner * - * This file is part of Privacy Browser Android . + * This file is part of Privacy Browser Android . * - * Privacy Browser Android is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. * - * Privacy Browser Android is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * You should have received a copy of the GNU General Public License - * along with Privacy Browser Android. If not, see . + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.stoutner.privacybrowser.dialogs import android.app.Dialog import android.content.DialogInterface -import android.net.Uri import android.net.http.SslError import android.os.Bundle import android.text.SpannableStringBuilder @@ -32,6 +31,7 @@ import android.webkit.SslErrorHandler import android.widget.TextView import androidx.appcompat.app.AlertDialog +import androidx.core.net.toUri import androidx.fragment.app.DialogFragment import androidx.preference.PreferenceManager @@ -183,7 +183,7 @@ class SslCertificateErrorDialog : DialogFragment() { } // Get a URI for the URL with errors. - val uriWithErrors = Uri.parse(urlWithErrors) + val uriWithErrors = urlWithErrors?.toUri() // The alert dialog must be shown before the contents can be modified. alertDialog.show() @@ -208,7 +208,7 @@ class SslCertificateErrorDialog : DialogFragment() { val redColorSpan = ForegroundColorSpan(requireContext().getColor(R.color.red_text)) // Get the IP Addresses for the URI. - GetHostIpAddressesCoroutine.getAddresses(uriWithErrors.host!!, getString(R.string.ip_addresses), blueColorSpan, ipAddressesTextView) + GetHostIpAddressesCoroutine.getAddresses(uriWithErrors?.host!!, getString(R.string.ip_addresses), blueColorSpan, ipAddressesTextView) // Setup the common strings. val urlLabel = getString(R.string.url_label) diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/UntrustedSslCertificateDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/UntrustedSslCertificateDialog.kt index 97eef400..8b26c6d9 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/UntrustedSslCertificateDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/UntrustedSslCertificateDialog.kt @@ -1,20 +1,20 @@ -/* - * Copyright 2021-2022 Soren Stoutner . +/* SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2021-2022 Soren Stoutner * - * This file is part of Privacy Browser Android . + * This file is part of Privacy Browser Android . * - * Privacy Browser Android is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. * - * Privacy Browser Android is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * You should have received a copy of the GNU General Public License - * along with Privacy Browser Android. If not, see . + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.stoutner.privacybrowser.dialogs diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/UrlHistoryDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/UrlHistoryDialog.kt index eedd6447..6ef1b9b8 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/UrlHistoryDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/UrlHistoryDialog.kt @@ -1,20 +1,20 @@ -/* - * Copyright 2016-2024 Soren Stoutner . +/* SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2016-2024 Soren Stoutner * - * This file is part of Privacy Browser Android . + * This file is part of Privacy Browser Android . * - * Privacy Browser Android is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. * - * Privacy Browser Android is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * You should have received a copy of the GNU General Public License - * along with Privacy Browser Android. If not, see . + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.stoutner.privacybrowser.dialogs diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/ViewHeadersDetailDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/ViewHeadersDetailDialog.kt index 11d2e75e..4968ac96 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/ViewHeadersDetailDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/ViewHeadersDetailDialog.kt @@ -1,20 +1,20 @@ -/* - * Copyright 2023 Soren Stoutner . +/* SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2023 Soren Stoutner * - * This file is part of Privacy Browser Android . + * This file is part of Privacy Browser Android . * - * Privacy Browser Android is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. * - * Privacy Browser Android is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * You should have received a copy of the GNU General Public License - * along with Privacy Browser Android. If not, see . + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.stoutner.privacybrowser.dialogs diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/ViewRequestDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/ViewRequestDialog.kt index 1c8648ea..38130601 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/ViewRequestDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/ViewRequestDialog.kt @@ -1,20 +1,20 @@ -/* - * Copyright 2018-2023 Soren Stoutner . +/* SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2018-2023 Soren Stoutner * - * This file is part of Privacy Browser Android . + * This file is part of Privacy Browser Android . * - * Privacy Browser Android is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. * - * Privacy Browser Android is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * You should have received a copy of the GNU General Public License - * along with Privacy Browser Android. If not, see . + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.stoutner.privacybrowser.dialogs diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/ViewSslCertificateDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/ViewSslCertificateDialog.kt index fd269459..55137972 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/ViewSslCertificateDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/ViewSslCertificateDialog.kt @@ -1,20 +1,20 @@ -/* - * Copyright 2016-2023 Soren Stoutner . +/* SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2016-2023, 2025 Soren Stoutner * - * This file is part of Privacy Browser Android . + * This file is part of Privacy Browser Android . * - * Privacy Browser Android is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. * - * Privacy Browser Android is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * You should have received a copy of the GNU General Public License - * along with Privacy Browser Android. If not, see . + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.stoutner.privacybrowser.dialogs @@ -22,8 +22,6 @@ package com.stoutner.privacybrowser.dialogs import android.app.Dialog import android.graphics.Bitmap import android.graphics.BitmapFactory -import android.graphics.drawable.BitmapDrawable -import android.net.Uri import android.os.Bundle import android.text.SpannableStringBuilder import android.text.Spanned @@ -32,6 +30,8 @@ import android.view.WindowManager import android.widget.TextView import androidx.appcompat.app.AlertDialog +import androidx.core.graphics.drawable.toDrawable +import androidx.core.net.toUri import androidx.fragment.app.DialogFragment import androidx.preference.PreferenceManager @@ -138,7 +138,7 @@ class ViewSslCertificateDialog : DialogFragment() { // Populate the certificate class variables if the webpage has an SSL certificate. if (hasSslCertificate) { // Convert the URL to a URI. - val uri = Uri.parse(nestedScrollWebView.currentUrl) + val uri = nestedScrollWebView.currentUrl.toUri() // Extract the domain name from the URI. domainString = uri.host!! @@ -184,7 +184,7 @@ class ViewSslCertificateDialog : DialogFragment() { val favoriteIconBitmap = BitmapFactory.decodeByteArray(favoriteIconByteArray, 0, favoriteIconByteArray.size) // Create a drawable version of the favorite icon. - val favoriteIconDrawable = BitmapDrawable(resources, favoriteIconBitmap) + val favoriteIconDrawable = favoriteIconBitmap.toDrawable(resources) // Set the icon. dialogBuilder.setIcon(favoriteIconDrawable) diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/WaitingForProxyDialog.kt b/app/src/main/java/com/stoutner/privacybrowser/dialogs/WaitingForProxyDialog.kt index c386625f..9089c503 100644 --- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/WaitingForProxyDialog.kt +++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/WaitingForProxyDialog.kt @@ -1,20 +1,20 @@ -/* - * Copyright © 2019-2022 Soren Stoutner . +/* SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2019-2022 Soren Stoutner * - * This file is part of Privacy Browser Android . + * This file is part of Privacy Browser Android . * - * Privacy Browser Android is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 3 of the License, or (at your option) any later + * version. * - * Privacy Browser Android is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. * - * You should have received a copy of the GNU General Public License - * along with Privacy Browser Android. If not, see . + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . */ package com.stoutner.privacybrowser.dialogs diff --git a/build.gradle b/build.gradle index 7f1bf308..161da276 100644 --- a/build.gradle +++ b/build.gradle @@ -26,8 +26,8 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:8.10.1' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.0" + classpath 'com.android.tools.build:gradle:8.11.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.20" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2267a525..67a6e63e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -20,4 +20,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip -- 2.47.2