Skip to content

Commit

Permalink
use a manifest permission to restrict access to internal broadcasts u…
Browse files Browse the repository at this point in the history
…sed by notifications and other external sources
  • Loading branch information
c99koder committed Nov 6, 2017
1 parent 4d4bcb2 commit 857287d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/com/irccloud/android/DashClock.java
Expand Up @@ -55,7 +55,7 @@ protected void onInitialize(boolean isReconnect) {
} }
IntentFilter intentFilter = new IntentFilter(REFRESH_INTENT); IntentFilter intentFilter = new IntentFilter(REFRESH_INTENT);
receiver = new RefreshReceiver(); receiver = new RefreshReceiver();
registerReceiver(receiver, intentFilter); registerReceiver(receiver, intentFilter, BuildConfig.APPLICATION_ID + ".permission.BROADCAST", null);
} }


@Override @Override
Expand Down
2 changes: 1 addition & 1 deletion src/com/irccloud/android/activity/MainActivity.java
Expand Up @@ -6055,7 +6055,7 @@ else if (lower.endsWith(".3gpp"))


IntentFilter intentFilter = new IntentFilter(); IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(activity.getPackageName() + ".cancel_upload"); intentFilter.addAction(activity.getPackageName() + ".cancel_upload");
IRCCloudApplication.getInstance().getApplicationContext().registerReceiver(cancelListener, intentFilter); IRCCloudApplication.getInstance().getApplicationContext().registerReceiver(cancelListener, intentFilter, BuildConfig.APPLICATION_ID + ".permission.BROADCAST", null);


if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannel c = new NotificationChannel("upload_progress", "Upload Progress", NotificationManagerCompat.IMPORTANCE_LOW); NotificationChannel c = new NotificationChannel("upload_progress", "Upload Progress", NotificationManagerCompat.IMPORTANCE_LOW);
Expand Down
2 changes: 1 addition & 1 deletion src/com/irccloud/android/data/collection/ImageList.java
Expand Up @@ -407,7 +407,7 @@ public void run() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1)
https.setSSLSocketFactory(NetworkConnection.getInstance().IRCCloudSocketFactory); https.setSSLSocketFactory(NetworkConnection.getInstance().IRCCloudSocketFactory);
else if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) else if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1)
https.setSSLSocketFactory(TrustKit.getInstance().getSSLSocketFactory(NetworkConnection.IRCCLOUD_HOST)); https.setSSLSocketFactory(TrustKit.getInstance().getSSLSocketFactory(url.getHost()));
conn = https; conn = https;
} else { } else {
conn = (HttpURLConnection) ((proxy != null) ? url.openConnection(proxy) : url.openConnection(Proxy.NO_PROXY)); conn = (HttpURLConnection) ((proxy != null) ? url.openConnection(proxy) : url.openConnection(Proxy.NO_PROXY));
Expand Down

0 comments on commit 857287d

Please sign in to comment.