Make phone number validity test work for Faroe islands and elsewhere.

// FREEBIE
This commit is contained in:
Moxie Marlinspike
2015-11-09 17:38:46 -08:00
parent 2a103d2fe2
commit a8d6f5974f
3 changed files with 15 additions and 2 deletions
+6 -1
View File
@@ -14,7 +14,7 @@ repositories {
dependencies {
compile 'com.google.protobuf:protobuf-java:2.5.0'
compile 'com.googlecode.libphonenumber:libphonenumber:6.1'
compile 'com.googlecode.libphonenumber:libphonenumber:7.1.0'
compile 'com.fasterxml.jackson.core:jackson-databind:2.5.0'
compile "org.whispersystems:axolotl-java:${axolotl_version}"
@@ -35,6 +35,11 @@ signing {
sign configurations.archives
}
def sonatypeRepo = sonatypeRepo != null ? sonatypeRepo : ""
def whisperSonatypeUsername = whisperSonatypeUsername != null ? whisperSonatypeUsername : ""
def whisperSonatypePassword = whisperSonatypePassword != null ? whisperSonatypePassword : ""
uploadArchives {
configuration = configurations.archives
repositories.mavenDeployer {
@@ -36,7 +36,10 @@ public class PhoneNumberFormatter {
private static final String TAG = PhoneNumberFormatter.class.getSimpleName();
public static boolean isValidNumber(String number) {
return number.matches("^\\+[0-9]{10,}");
return number.matches("^\\+[0-9]{10,}") ||
number.matches("^\\+298[0-9]{6}") ||
number.matches("^\\+240[0-9]{6}") ||
number.matches("^\\+689[0-9]{6}");
}
private static String impreciseFormatNumber(String number, String localNumber)