mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-05-19 14:10:38 -04:00
Merge branch 'acra-fixes' into 'master'
Four fixes for acra issues Closes acra-crash-reports#749, acra-crash-reports#748, acra-crash-reports#741, and acra-crash-reports#740 See merge request fdroid/fdroidclient!1423
This commit is contained in:
@@ -492,7 +492,13 @@ public class SwapWorkflowActivity extends AppCompatActivity {
|
||||
if (Build.VERSION.SDK_INT <= 28) {
|
||||
wifiManager.setWifiEnabled(false);
|
||||
}
|
||||
if (wifiApControl.enable()) {
|
||||
boolean wifiEnabled = false;
|
||||
try {
|
||||
wifiEnabled = wifiApControl.enable();
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Error enabling WiFi: ", e);
|
||||
}
|
||||
if (wifiEnabled) {
|
||||
Toast.makeText(this, R.string.swap_toast_hotspot_enabled, Toast.LENGTH_SHORT).show();
|
||||
SwapService.putHotspotActivatedUserPreference(true);
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package org.fdroid.fdroid
|
||||
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.util.Log
|
||||
import android.widget.Toast
|
||||
import android.widget.Toast.LENGTH_LONG
|
||||
@@ -149,7 +151,10 @@ class RepoUpdateManager @JvmOverloads constructor(
|
||||
msgBuilder.append("$repoName: ${e.localizedMessage} ${cause.localizedMessage}")
|
||||
}
|
||||
}
|
||||
Toast.makeText(context, msgBuilder.toString(), LENGTH_LONG).show()
|
||||
// can't show Toast from background thread, so we need to move this to UiThread
|
||||
Handler(Looper.getMainLooper()).post {
|
||||
Toast.makeText(context, msgBuilder.toString(), LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDownloadProgress(repo: Repository, bytesRead: Long, totalBytes: Long) {
|
||||
|
||||
@@ -150,6 +150,11 @@ public class RepoDetailsActivity extends AppCompatActivity {
|
||||
repoId = getIntent().getLongExtra(ARG_REPO_ID, 0);
|
||||
model.initRepo(repoId);
|
||||
repo = FDroidApp.getRepoManager(this).getRepository(repoId);
|
||||
if (repo == null) {
|
||||
// repo must have been deleted just now (maybe slow UI?)
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
TextView inputUrl = findViewById(R.id.input_repo_url);
|
||||
inputUrl.setText(repo.getAddress());
|
||||
|
||||
@@ -16,7 +16,7 @@ internal object RepoUriGetter {
|
||||
it.buildUpon().scheme("http").build()
|
||||
}
|
||||
|
||||
it.host == "fdroid.link" -> getFdroidLinkUri(it)
|
||||
it.host == "fdroid.link" && it.encodedFragment != null -> getFdroidLinkUri(it)
|
||||
|
||||
it.scheme.isNullOrBlank() -> {
|
||||
// assume https:// when no scheme given
|
||||
|
||||
@@ -90,6 +90,18 @@ internal class RepoUriGetterTest {
|
||||
val uri3 = RepoUriGetter.getUri("https://fdroid.link/#http://f-droid.org/repo")
|
||||
assertEquals("http://f-droid.org/repo", uri3.uri.toString())
|
||||
assertNull(uri3.fingerprint)
|
||||
|
||||
val uri4 = RepoUriGetter.getUri("https://fdroid.link/")
|
||||
// we don't care what it is as long as it doesn't crash
|
||||
assertNull(uri4.fingerprint)
|
||||
|
||||
val uri5 = RepoUriGetter.getUri("https://fdroid.link/#foo")
|
||||
// we don't care what it is as long as it doesn't crash
|
||||
assertNull(uri5.fingerprint)
|
||||
|
||||
val uri6 = RepoUriGetter.getUri("https://fdroid.link/#invalid://foo.bar")
|
||||
// we don't care what it is as long as it doesn't crash
|
||||
assertNull(uri6.fingerprint)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user