Guard DISABLE_PLUGIN with PLUGIN permission.
Fixes a p0 security bug. We already have the plugin permission defined in our manifest. Ensure that senders of the DISABLE_PLUGIN broadcast have that permission. Fixes: 193444889 Test: manual Change-Id: Iebaba435c17c5644c5357c0683858447f5ffb897
This commit is contained in:
@@ -24,9 +24,9 @@ public interface PluginEnabler {
|
|||||||
|
|
||||||
int ENABLED = 0;
|
int ENABLED = 0;
|
||||||
int DISABLED_MANUALLY = 1;
|
int DISABLED_MANUALLY = 1;
|
||||||
int DISABLED_INVALID_VERSION = 1;
|
int DISABLED_INVALID_VERSION = 2;
|
||||||
int DISABLED_FROM_EXPLICIT_CRASH = 2;
|
int DISABLED_FROM_EXPLICIT_CRASH = 3;
|
||||||
int DISABLED_FROM_SYSTEM_CRASH = 3;
|
int DISABLED_FROM_SYSTEM_CRASH = 4;
|
||||||
|
|
||||||
@IntDef({ENABLED, DISABLED_MANUALLY, DISABLED_INVALID_VERSION, DISABLED_FROM_EXPLICIT_CRASH,
|
@IntDef({ENABLED, DISABLED_MANUALLY, DISABLED_INVALID_VERSION, DISABLED_FROM_EXPLICIT_CRASH,
|
||||||
DISABLED_FROM_SYSTEM_CRASH})
|
DISABLED_FROM_SYSTEM_CRASH})
|
||||||
|
|||||||
@@ -197,10 +197,12 @@ public class PluginManagerImpl extends BroadcastReceiver implements PluginManage
|
|||||||
filter.addAction(Intent.ACTION_PACKAGE_CHANGED);
|
filter.addAction(Intent.ACTION_PACKAGE_CHANGED);
|
||||||
filter.addAction(Intent.ACTION_PACKAGE_REPLACED);
|
filter.addAction(Intent.ACTION_PACKAGE_REPLACED);
|
||||||
filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
|
filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
|
||||||
|
filter.addDataScheme("package");
|
||||||
|
mContext.registerReceiver(this, filter);
|
||||||
filter.addAction(PLUGIN_CHANGED);
|
filter.addAction(PLUGIN_CHANGED);
|
||||||
filter.addAction(DISABLE_PLUGIN);
|
filter.addAction(DISABLE_PLUGIN);
|
||||||
filter.addDataScheme("package");
|
filter.addDataScheme("package");
|
||||||
mContext.registerReceiver(this, filter);
|
mContext.registerReceiver(this, filter, PluginInstanceManager.PLUGIN_PERMISSION, null);
|
||||||
filter = new IntentFilter(Intent.ACTION_USER_UNLOCKED);
|
filter = new IntentFilter(Intent.ACTION_USER_UNLOCKED);
|
||||||
mContext.registerReceiver(this, filter);
|
mContext.registerReceiver(this, filter);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user