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 * actually in the index.jar itself. If no fingerprint, just store the
* signing certificate */ * signing certificate */
boolean trustNewSigningCertificate = false; 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 // no info to check things are valid, so just Trust On First Use
trustNewSigningCertificate = true; trustNewSigningCertificate = true;
} else { } else {

View File

@ -19,13 +19,25 @@ public class IconDownloader extends BaseImageDownloader {
@Override @Override
public InputStream getStream(String imageUri, Object extra) throws IOException { public InputStream getStream(String imageUri, Object extra) throws IOException {
switch (Scheme.ofUri(imageUri)) {
Scheme scheme = Scheme.ofUri(imageUri);
switch (scheme) {
case HTTP: case HTTP:
case HTTPS: case HTTPS:
Downloader downloader = DownloaderFactory.create(context, imageUri); Downloader downloader = DownloaderFactory.create(context, imageUri);
return downloader.getInputStream(); return downloader.getInputStream();
default:
return super.getStream(imageUri, extra);
} }
//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();
}
return super.getStream(imageUri, extra);
} }
} }

View File

@ -282,7 +282,8 @@ public class SwapAppsView extends ListView implements
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
Apk apk = getApkToInstall(); Apk apk = getApkToInstall();
String broadcastUrl = intent.getStringExtra(Downloader.EXTRA_ADDRESS); 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; return;
} }