Merge "Don\'t back up / restore EAP network definitions"
am: 14a0981fde
* commit '14a0981fdef45967b19c3db4fb2f298c8b5a1f7c':
Don't back up / restore EAP network definitions
This commit is contained in:
@@ -159,6 +159,7 @@ public class SettingsBackupAgent extends BackupAgentHelper {
|
|||||||
String key_mgmt = "";
|
String key_mgmt = "";
|
||||||
boolean certUsed = false;
|
boolean certUsed = false;
|
||||||
boolean hasWepKey = false;
|
boolean hasWepKey = false;
|
||||||
|
boolean isEap = false;
|
||||||
final ArrayList<String> rawLines = new ArrayList<String>();
|
final ArrayList<String> rawLines = new ArrayList<String>();
|
||||||
|
|
||||||
public static Network readFromStream(BufferedReader in) {
|
public static Network readFromStream(BufferedReader in) {
|
||||||
@@ -189,6 +190,9 @@ public class SettingsBackupAgent extends BackupAgentHelper {
|
|||||||
ssid = line;
|
ssid = line;
|
||||||
} else if (line.startsWith("key_mgmt=")) {
|
} else if (line.startsWith("key_mgmt=")) {
|
||||||
key_mgmt = line;
|
key_mgmt = line;
|
||||||
|
if (line.contains("EAP")) {
|
||||||
|
isEap = true;
|
||||||
|
}
|
||||||
} else if (line.startsWith("client_cert=")) {
|
} else if (line.startsWith("client_cert=")) {
|
||||||
certUsed = true;
|
certUsed = true;
|
||||||
} else if (line.startsWith("ca_cert=")) {
|
} else if (line.startsWith("ca_cert=")) {
|
||||||
@@ -197,6 +201,8 @@ public class SettingsBackupAgent extends BackupAgentHelper {
|
|||||||
certUsed = true;
|
certUsed = true;
|
||||||
} else if (line.startsWith("wep_")) {
|
} else if (line.startsWith("wep_")) {
|
||||||
hasWepKey = true;
|
hasWepKey = true;
|
||||||
|
} else if (line.startsWith("eap=")) {
|
||||||
|
isEap = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -325,6 +331,13 @@ public class SettingsBackupAgent extends BackupAgentHelper {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Don't propagate EAP network definitions
|
||||||
|
if (net.isEap) {
|
||||||
|
if (DEBUG_BACKUP) {
|
||||||
|
Log.v(TAG, "Skipping EAP network " + net.ssid + " / " + net.key_mgmt);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (! mKnownNetworks.contains(net)) {
|
if (! mKnownNetworks.contains(net)) {
|
||||||
if (DEBUG_BACKUP) {
|
if (DEBUG_BACKUP) {
|
||||||
Log.v(TAG, "Adding " + net.ssid + " / " + net.key_mgmt);
|
Log.v(TAG, "Adding " + net.ssid + " / " + net.key_mgmt);
|
||||||
@@ -353,6 +366,12 @@ public class SettingsBackupAgent extends BackupAgentHelper {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (net.isEap) {
|
||||||
|
// Similarly, omit EAP network definitions to avoid propagating
|
||||||
|
// controlled enterprise network definitions.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
net.write(w);
|
net.write(w);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user