Revert "Update libphonennumber for new shortcode metadata"

This reverts commit 8c58d031bd.

wtf is wrong with google
This commit is contained in:
Moxie Marlinspike
2016-02-02 14:12:56 -08:00
parent 8c58d031bd
commit ce12e381a5
2 changed files with 9 additions and 4 deletions

View File

@@ -29,6 +29,11 @@ public class ShortCodeUtil {
String localCountryCode = util.getRegionCodeForNumber(localNumberObject);
String bareNumber = number.replaceAll("[^0-9+]", "");
// libphonenumber doesn't seem to be correct for Germany and Finland
if (bareNumber.length() <= 6 && ("DE".equals(localCountryCode) || "FI".equals(localCountryCode))) {
return true;
}
// libphonenumber seems incorrect for Russia and a few other countries with 4 digit short codes.
if (bareNumber.length() <= 4 && !SHORT_COUNTRIES.contains(localCountryCode)) {
return true;