now handling empty repo fingerprint during check

- also support icondownloading over bluetooth
- also check for null repoUrl variable
This commit is contained in:
n8fr8 2015-09-10 11:21:00 -04:00
parent c831cf77cc
commit 0a96d17dd1
3 changed files with 20 additions and 7 deletions

View File

@ -278,7 +278,7 @@ public class RepoUpdater {
* actually in the index.jar itself. If no fingerprint, just store the
* signing certificate */
boolean trustNewSigningCertificate = false;
if (repo.fingerprint == null) {
if (repo.fingerprint == null || repo.fingerprint.length() == 0) {
// no info to check things are valid, so just Trust On First Use
trustNewSigningCertificate = true;
} else {

View File

@ -19,13 +19,25 @@ public class IconDownloader extends BaseImageDownloader {
@Override
public InputStream getStream(String imageUri, Object extra) throws IOException {
switch (Scheme.ofUri(imageUri)) {
case HTTP:
case HTTPS:
Scheme scheme = Scheme.ofUri(imageUri);
switch (scheme) {
case HTTP:
case HTTPS:
Downloader downloader = DownloaderFactory.create(context, imageUri);
return downloader.getInputStream();
}
//bluetooth isn't a scheme in the Scheme. library, so we can add a check here
if (imageUri.toLowerCase().startsWith("bluetooth"))
{
Downloader downloader = DownloaderFactory.create(context, imageUri);
return downloader.getInputStream();
default:
return super.getStream(imageUri, extra);
}
return super.getStream(imageUri, extra);
}
}

View File

@ -282,7 +282,8 @@ public class SwapAppsView extends ListView implements
public void onReceive(Context context, Intent intent) {
Apk apk = getApkToInstall();
String broadcastUrl = intent.getStringExtra(Downloader.EXTRA_ADDRESS);
if (!TextUtils.equals(Utils.getApkUrl(apk.repoAddress, apk), broadcastUrl)) {
if (apk.repoAddress != null && (!TextUtils.equals(Utils.getApkUrl(apk.repoAddress, apk), broadcastUrl))) {
return;
}