mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Show countries rather than IPs
This commit is contained in:
parent
bc9b98cdba
commit
e2740d78e8
|
@ -631,6 +631,10 @@
|
|||
C3548F0624456447009433A8 /* PNModeVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3548F0524456447009433A8 /* PNModeVC.swift */; };
|
||||
C3548F0824456AB6009433A8 /* UIView+Wrapping.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3548F0724456AB6009433A8 /* UIView+Wrapping.swift */; };
|
||||
C354E75A23FE2A7600CE22E3 /* BaseVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = C354E75923FE2A7600CE22E3 /* BaseVC.swift */; };
|
||||
C35E8AA32485C72300ACB629 /* SwiftCSV.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C35E8AA22485C72300ACB629 /* SwiftCSV.framework */; };
|
||||
C35E8AA82485C85800ACB629 /* GeoLite2-Country-Locations-English.csv in Resources */ = {isa = PBXBuildFile; fileRef = C35E8AA52485C85400ACB629 /* GeoLite2-Country-Locations-English.csv */; };
|
||||
C35E8AA92485C85800ACB629 /* GeoLite2-Country-Blocks-IPv4.csv in Resources */ = {isa = PBXBuildFile; fileRef = C35E8AA62485C85600ACB629 /* GeoLite2-Country-Blocks-IPv4.csv */; };
|
||||
C35E8AAC2485D1FE00ACB629 /* CSVUtilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = C35E8AAB2485D1FE00ACB629 /* CSVUtilities.swift */; };
|
||||
C36B8707243C50C60049991D /* SignalMessaging.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 453518921FC63DBF00210559 /* SignalMessaging.framework */; };
|
||||
C3DAB3242480CB2B00725F25 /* SRCopyableLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3DAB3232480CB2A00725F25 /* SRCopyableLabel.swift */; };
|
||||
C3DFFAC623E96F0D0058DAF8 /* Sheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3DFFAC523E96F0D0058DAF8 /* Sheet.swift */; };
|
||||
|
@ -1510,6 +1514,10 @@
|
|||
C3548F0524456447009433A8 /* PNModeVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PNModeVC.swift; sourceTree = "<group>"; };
|
||||
C3548F0724456AB6009433A8 /* UIView+Wrapping.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Wrapping.swift"; sourceTree = "<group>"; };
|
||||
C354E75923FE2A7600CE22E3 /* BaseVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseVC.swift; sourceTree = "<group>"; };
|
||||
C35E8AA22485C72300ACB629 /* SwiftCSV.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftCSV.framework; path = ThirdParty/Carthage/Build/iOS/SwiftCSV.framework; sourceTree = "<group>"; };
|
||||
C35E8AA52485C85400ACB629 /* GeoLite2-Country-Locations-English.csv */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "GeoLite2-Country-Locations-English.csv"; sourceTree = "<group>"; };
|
||||
C35E8AA62485C85600ACB629 /* GeoLite2-Country-Blocks-IPv4.csv */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "GeoLite2-Country-Blocks-IPv4.csv"; sourceTree = "<group>"; };
|
||||
C35E8AAB2485D1FE00ACB629 /* CSVUtilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CSVUtilities.swift; sourceTree = "<group>"; };
|
||||
C3DAB3232480CB2A00725F25 /* SRCopyableLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SRCopyableLabel.swift; sourceTree = "<group>"; };
|
||||
C3DFFAC523E96F0D0058DAF8 /* Sheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Sheet.swift; sourceTree = "<group>"; };
|
||||
C3DFFAC723E970080058DAF8 /* OpenGroupSuggestionSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenGroupSuggestionSheet.swift; sourceTree = "<group>"; };
|
||||
|
@ -1578,6 +1586,7 @@
|
|||
45847E871E4283C30080EAB3 /* Intents.framework in Frameworks */,
|
||||
4509E79A1DD653700025A59F /* WebRTC.framework in Frameworks */,
|
||||
4520D8D51D417D8E00123472 /* Photos.framework in Frameworks */,
|
||||
C35E8AA32485C72300ACB629 /* SwiftCSV.framework in Frameworks */,
|
||||
4C9CA25D217E676900607C63 /* ZXingObjC.framework in Frameworks */,
|
||||
B6B226971BE4B7D200860F4D /* ContactsUI.framework in Frameworks */,
|
||||
45BD60821DE9547E00A8F436 /* Contacts.framework in Frameworks */,
|
||||
|
@ -2899,6 +2908,7 @@
|
|||
children = (
|
||||
B8544E3223D50E4900299F14 /* AppearanceUtilities.swift */,
|
||||
C31A6C5B247F2CF3001123EF /* CGRect+Utilities.swift */,
|
||||
C35E8AAB2485D1FE00ACB629 /* CSVUtilities.swift */,
|
||||
B84664F4235022F30083A1CD /* MentionUtilities.swift */,
|
||||
B886B4A82398BA1500211ABE /* QRCode.swift */,
|
||||
B8783E9D23EB948D00404FB8 /* UILabel+Interaction.swift */,
|
||||
|
@ -2946,6 +2956,15 @@
|
|||
path = "View Controllers";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
C35E8AA42485C83B00ACB629 /* CSV */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C35E8AA62485C85600ACB629 /* GeoLite2-Country-Blocks-IPv4.csv */,
|
||||
C35E8AA52485C85400ACB629 /* GeoLite2-Country-Locations-English.csv */,
|
||||
);
|
||||
path = CSV;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D221A07E169C9E5E00537ABF = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
@ -2974,6 +2993,7 @@
|
|||
D221A08C169C9E5E00537ABF /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C35E8AA22485C72300ACB629 /* SwiftCSV.framework */,
|
||||
B847570023D568EB00759540 /* SignalServiceKit.framework */,
|
||||
3496955F21A2FC8100DCFE74 /* CloudKit.framework */,
|
||||
4C9CA25C217E676900607C63 /* ZXingObjC.framework */,
|
||||
|
@ -3020,6 +3040,7 @@
|
|||
D221A093169C9E5E00537ABF /* Signal */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C35E8AA42485C83B00ACB629 /* CSV */,
|
||||
34330A581E7875FB00DF2FB9 /* Fonts */,
|
||||
B633C4FD1A1D190B0059AC12 /* Images */,
|
||||
B66DBF4919D5BBC8006EA940 /* Images.xcassets */,
|
||||
|
@ -3480,6 +3501,7 @@
|
|||
34330A5E1E787BD800DF2FB9 /* ElegantIcons.ttf in Resources */,
|
||||
AD83FF451A73426500B5C81A /* audio_pause_button@2x.png in Resources */,
|
||||
45A2F005204473A3002E978A /* NewMessage.aifc in Resources */,
|
||||
C35E8AA92485C85800ACB629 /* GeoLite2-Country-Blocks-IPv4.csv in Resources */,
|
||||
45B74A882044AAB600CD42F8 /* aurora.aifc in Resources */,
|
||||
45B74A742044AAB600CD42F8 /* aurora-quiet.aifc in Resources */,
|
||||
45B74A852044AAB600CD42F8 /* bamboo.aifc in Resources */,
|
||||
|
@ -3497,6 +3519,7 @@
|
|||
45B74A772044AAB600CD42F8 /* hello.aifc in Resources */,
|
||||
4C61819F219E1796009BD6B5 /* typing-animation-dark.gif in Resources */,
|
||||
45B74A7C2044AAB600CD42F8 /* hello-quiet.aifc in Resources */,
|
||||
C35E8AA82485C85800ACB629 /* GeoLite2-Country-Locations-English.csv in Resources */,
|
||||
45B74A792044AAB600CD42F8 /* input.aifc in Resources */,
|
||||
45B74A8C2044AAB600CD42F8 /* input-quiet.aifc in Resources */,
|
||||
45B74A7A2044AAB600CD42F8 /* keys.aifc in Resources */,
|
||||
|
@ -3586,6 +3609,7 @@
|
|||
inputPaths = (
|
||||
"$(SRCROOT)/ThirdParty/WebRTC/Build/WebRTC.framework",
|
||||
"$(SRCROOT)/ThirdParty/Carthage/Build/iOS/ZXingObjC.framework",
|
||||
"$(SRCROOT)/ThirdParty/Carthage/Build/iOS/SwiftCSV.framework",
|
||||
);
|
||||
name = "[Carthage] Copy Frameworks";
|
||||
outputPaths = (
|
||||
|
@ -4187,6 +4211,7 @@
|
|||
45FBC5C81DF8575700E9B410 /* CallKitCallManager.swift in Sources */,
|
||||
4539B5861F79348F007141FF /* PushRegistrationManager.swift in Sources */,
|
||||
45FBC5D11DF8592E00E9B410 /* SignalCall.swift in Sources */,
|
||||
C35E8AAC2485D1FE00ACB629 /* CSVUtilities.swift in Sources */,
|
||||
B8B26C91234D8CBD004ED98C /* MentionCandidateSelectionViewDelegate.swift in Sources */,
|
||||
340FC8BB204DAC8D007AEB0F /* OWSAddToContactViewController.m in Sources */,
|
||||
45F32C232057297A00A300D5 /* MediaPageViewController.swift in Sources */,
|
||||
|
|
296323
Signal/CSV/GeoLite2-Country-Blocks-IPv4.csv
Normal file
296323
Signal/CSV/GeoLite2-Country-Blocks-IPv4.csv
Normal file
File diff suppressed because it is too large
Load diff
253
Signal/CSV/GeoLite2-Country-Locations-English.csv
Normal file
253
Signal/CSV/GeoLite2-Country-Locations-English.csv
Normal file
|
@ -0,0 +1,253 @@
|
|||
geoname_id,locale_code,continent_code,continent_name,country_iso_code,country_name,is_in_european_union
|
||||
49518,en,AF,Africa,RW,Rwanda,0
|
||||
51537,en,AF,Africa,SO,Somalia,0
|
||||
69543,en,AS,Asia,YE,Yemen,0
|
||||
99237,en,AS,Asia,IQ,Iraq,0
|
||||
102358,en,AS,Asia,SA,"Saudi Arabia",0
|
||||
130758,en,AS,Asia,IR,Iran,0
|
||||
146669,en,EU,Europe,CY,Cyprus,1
|
||||
149590,en,AF,Africa,TZ,Tanzania,0
|
||||
163843,en,AS,Asia,SY,Syria,0
|
||||
174982,en,AS,Asia,AM,Armenia,0
|
||||
192950,en,AF,Africa,KE,Kenya,0
|
||||
203312,en,AF,Africa,CD,"DR Congo",0
|
||||
223816,en,AF,Africa,DJ,Djibouti,0
|
||||
226074,en,AF,Africa,UG,Uganda,0
|
||||
239880,en,AF,Africa,CF,"Central African Republic",0
|
||||
241170,en,AF,Africa,SC,Seychelles,0
|
||||
248816,en,AS,Asia,JO,"Hashemite Kingdom of Jordan",0
|
||||
272103,en,AS,Asia,LB,Lebanon,0
|
||||
285570,en,AS,Asia,KW,Kuwait,0
|
||||
286963,en,AS,Asia,OM,Oman,0
|
||||
289688,en,AS,Asia,QA,Qatar,0
|
||||
290291,en,AS,Asia,BH,Bahrain,0
|
||||
290557,en,AS,Asia,AE,"United Arab Emirates",0
|
||||
294640,en,AS,Asia,IL,Israel,0
|
||||
298795,en,AS,Asia,TR,Turkey,0
|
||||
337996,en,AF,Africa,ET,Ethiopia,0
|
||||
338010,en,AF,Africa,ER,Eritrea,0
|
||||
357994,en,AF,Africa,EG,Egypt,0
|
||||
366755,en,AF,Africa,SD,Sudan,0
|
||||
390903,en,EU,Europe,GR,Greece,1
|
||||
433561,en,AF,Africa,BI,Burundi,0
|
||||
453733,en,EU,Europe,EE,Estonia,1
|
||||
458258,en,EU,Europe,LV,Latvia,1
|
||||
587116,en,AS,Asia,AZ,Azerbaijan,0
|
||||
597427,en,EU,Europe,LT,"Republic of Lithuania",1
|
||||
607072,en,EU,Europe,SJ,"Svalbard and Jan Mayen",0
|
||||
614540,en,AS,Asia,GE,Georgia,0
|
||||
617790,en,EU,Europe,MD,"Republic of Moldova",0
|
||||
630336,en,EU,Europe,BY,Belarus,0
|
||||
660013,en,EU,Europe,FI,Finland,1
|
||||
661882,en,EU,Europe,AX,"Åland",1
|
||||
690791,en,EU,Europe,UA,Ukraine,0
|
||||
718075,en,EU,Europe,MK,"North Macedonia",0
|
||||
719819,en,EU,Europe,HU,Hungary,1
|
||||
732800,en,EU,Europe,BG,Bulgaria,1
|
||||
783754,en,EU,Europe,AL,Albania,0
|
||||
798544,en,EU,Europe,PL,Poland,1
|
||||
798549,en,EU,Europe,RO,Romania,1
|
||||
831053,en,EU,Europe,XK,Kosovo,0
|
||||
878675,en,AF,Africa,ZW,Zimbabwe,0
|
||||
895949,en,AF,Africa,ZM,Zambia,0
|
||||
921929,en,AF,Africa,KM,Comoros,0
|
||||
927384,en,AF,Africa,MW,Malawi,0
|
||||
932692,en,AF,Africa,LS,Lesotho,0
|
||||
933860,en,AF,Africa,BW,Botswana,0
|
||||
934292,en,AF,Africa,MU,Mauritius,0
|
||||
934841,en,AF,Africa,SZ,Eswatini,0
|
||||
935317,en,AF,Africa,RE,Réunion,1
|
||||
953987,en,AF,Africa,ZA,"South Africa",0
|
||||
1024031,en,AF,Africa,YT,Mayotte,1
|
||||
1036973,en,AF,Africa,MZ,Mozambique,0
|
||||
1062947,en,AF,Africa,MG,Madagascar,0
|
||||
1149361,en,AS,Asia,AF,Afghanistan,0
|
||||
1168579,en,AS,Asia,PK,Pakistan,0
|
||||
1210997,en,AS,Asia,BD,Bangladesh,0
|
||||
1218197,en,AS,Asia,TM,Turkmenistan,0
|
||||
1220409,en,AS,Asia,TJ,Tajikistan,0
|
||||
1227603,en,AS,Asia,LK,"Sri Lanka",0
|
||||
1252634,en,AS,Asia,BT,Bhutan,0
|
||||
1269750,en,AS,Asia,IN,India,0
|
||||
1282028,en,AS,Asia,MV,Maldives,0
|
||||
1282588,en,AS,Asia,IO,"British Indian Ocean Territory",0
|
||||
1282988,en,AS,Asia,NP,Nepal,0
|
||||
1327865,en,AS,Asia,MM,Myanmar,0
|
||||
1512440,en,AS,Asia,UZ,Uzbekistan,0
|
||||
1522867,en,AS,Asia,KZ,Kazakhstan,0
|
||||
1527747,en,AS,Asia,KG,Kyrgyzstan,0
|
||||
1546748,en,AN,Antarctica,TF,"French Southern Territories",0
|
||||
1547314,en,AN,Antarctica,HM,"Heard Island and McDonald Islands",0
|
||||
1547376,en,AS,Asia,CC,"Cocos [Keeling] Islands",0
|
||||
1559582,en,OC,Oceania,PW,Palau,0
|
||||
1562822,en,AS,Asia,VN,Vietnam,0
|
||||
1605651,en,AS,Asia,TH,Thailand,0
|
||||
1643084,en,AS,Asia,ID,Indonesia,0
|
||||
1655842,en,AS,Asia,LA,Laos,0
|
||||
1668284,en,AS,Asia,TW,Taiwan,0
|
||||
1694008,en,AS,Asia,PH,Philippines,0
|
||||
1733045,en,AS,Asia,MY,Malaysia,0
|
||||
1814991,en,AS,Asia,CN,China,0
|
||||
1819730,en,AS,Asia,HK,"Hong Kong",0
|
||||
1820814,en,AS,Asia,BN,Brunei,0
|
||||
1821275,en,AS,Asia,MO,Macao,0
|
||||
1831722,en,AS,Asia,KH,Cambodia,0
|
||||
1835841,en,AS,Asia,KR,"South Korea",0
|
||||
1861060,en,AS,Asia,JP,Japan,0
|
||||
1873107,en,AS,Asia,KP,"North Korea",0
|
||||
1880251,en,AS,Asia,SG,Singapore,0
|
||||
1899402,en,OC,Oceania,CK,"Cook Islands",0
|
||||
1966436,en,OC,Oceania,TL,"East Timor",0
|
||||
2017370,en,EU,Europe,RU,Russia,0
|
||||
2029969,en,AS,Asia,MN,Mongolia,0
|
||||
2077456,en,OC,Oceania,AU,Australia,0
|
||||
2078138,en,OC,Oceania,CX,"Christmas Island",0
|
||||
2080185,en,OC,Oceania,MH,"Marshall Islands",0
|
||||
2081918,en,OC,Oceania,FM,"Federated States of Micronesia",0
|
||||
2088628,en,OC,Oceania,PG,"Papua New Guinea",0
|
||||
2103350,en,OC,Oceania,SB,"Solomon Islands",0
|
||||
2110297,en,OC,Oceania,TV,Tuvalu,0
|
||||
2110425,en,OC,Oceania,NR,Nauru,0
|
||||
2134431,en,OC,Oceania,VU,Vanuatu,0
|
||||
2139685,en,OC,Oceania,NC,"New Caledonia",0
|
||||
2155115,en,OC,Oceania,NF,"Norfolk Island",0
|
||||
2186224,en,OC,Oceania,NZ,"New Zealand",0
|
||||
2205218,en,OC,Oceania,FJ,Fiji,0
|
||||
2215636,en,AF,Africa,LY,Libya,0
|
||||
2233387,en,AF,Africa,CM,Cameroon,0
|
||||
2245662,en,AF,Africa,SN,Senegal,0
|
||||
2260494,en,AF,Africa,CG,"Congo Republic",0
|
||||
2264397,en,EU,Europe,PT,Portugal,1
|
||||
2275384,en,AF,Africa,LR,Liberia,0
|
||||
2287781,en,AF,Africa,CI,"Ivory Coast",0
|
||||
2300660,en,AF,Africa,GH,Ghana,0
|
||||
2309096,en,AF,Africa,GQ,"Equatorial Guinea",0
|
||||
2328926,en,AF,Africa,NG,Nigeria,0
|
||||
2361809,en,AF,Africa,BF,"Burkina Faso",0
|
||||
2363686,en,AF,Africa,TG,Togo,0
|
||||
2372248,en,AF,Africa,GW,Guinea-Bissau,0
|
||||
2378080,en,AF,Africa,MR,Mauritania,0
|
||||
2395170,en,AF,Africa,BJ,Benin,0
|
||||
2400553,en,AF,Africa,GA,Gabon,0
|
||||
2403846,en,AF,Africa,SL,"Sierra Leone",0
|
||||
2410758,en,AF,Africa,ST,"São Tomé and Príncipe",0
|
||||
2411586,en,EU,Europe,GI,Gibraltar,1
|
||||
2413451,en,AF,Africa,GM,Gambia,0
|
||||
2420477,en,AF,Africa,GN,Guinea,0
|
||||
2434508,en,AF,Africa,TD,Chad,0
|
||||
2440476,en,AF,Africa,NE,Niger,0
|
||||
2453866,en,AF,Africa,ML,Mali,0
|
||||
2461445,en,AF,Africa,EH,"Western Sahara",0
|
||||
2464461,en,AF,Africa,TN,Tunisia,0
|
||||
2510769,en,EU,Europe,ES,Spain,1
|
||||
2542007,en,AF,Africa,MA,Morocco,0
|
||||
2562770,en,EU,Europe,MT,Malta,1
|
||||
2589581,en,AF,Africa,DZ,Algeria,0
|
||||
2622320,en,EU,Europe,FO,"Faroe Islands",0
|
||||
2623032,en,EU,Europe,DK,Denmark,1
|
||||
2629691,en,EU,Europe,IS,Iceland,0
|
||||
2635167,en,EU,Europe,GB,"United Kingdom",1
|
||||
2658434,en,EU,Europe,CH,Switzerland,0
|
||||
2661886,en,EU,Europe,SE,Sweden,1
|
||||
2750405,en,EU,Europe,NL,Netherlands,1
|
||||
2782113,en,EU,Europe,AT,Austria,1
|
||||
2802361,en,EU,Europe,BE,Belgium,1
|
||||
2921044,en,EU,Europe,DE,Germany,1
|
||||
2960313,en,EU,Europe,LU,Luxembourg,1
|
||||
2963597,en,EU,Europe,IE,Ireland,1
|
||||
2993457,en,EU,Europe,MC,Monaco,0
|
||||
3017382,en,EU,Europe,FR,France,1
|
||||
3041565,en,EU,Europe,AD,Andorra,0
|
||||
3042058,en,EU,Europe,LI,Liechtenstein,0
|
||||
3042142,en,EU,Europe,JE,Jersey,0
|
||||
3042225,en,EU,Europe,IM,"Isle of Man",0
|
||||
3042362,en,EU,Europe,GG,Guernsey,0
|
||||
3057568,en,EU,Europe,SK,Slovakia,1
|
||||
3077311,en,EU,Europe,CZ,Czechia,1
|
||||
3144096,en,EU,Europe,NO,Norway,0
|
||||
3164670,en,EU,Europe,VA,"Vatican City",0
|
||||
3168068,en,EU,Europe,SM,"San Marino",0
|
||||
3175395,en,EU,Europe,IT,Italy,1
|
||||
3190538,en,EU,Europe,SI,Slovenia,1
|
||||
3194884,en,EU,Europe,ME,Montenegro,0
|
||||
3202326,en,EU,Europe,HR,Croatia,1
|
||||
3277605,en,EU,Europe,BA,"Bosnia and Herzegovina",0
|
||||
3351879,en,AF,Africa,AO,Angola,0
|
||||
3355338,en,AF,Africa,NA,Namibia,0
|
||||
3370751,en,AF,Africa,SH,"Saint Helena",0
|
||||
3371123,en,AN,Antarctica,BV,"Bouvet Island",0
|
||||
3374084,en,NA,"North America",BB,Barbados,0
|
||||
3374766,en,AF,Africa,CV,"Cabo Verde",0
|
||||
3378535,en,SA,"South America",GY,Guyana,0
|
||||
3381670,en,SA,"South America",GF,"French Guiana",1
|
||||
3382998,en,SA,"South America",SR,Suriname,0
|
||||
3424932,en,NA,"North America",PM,"Saint Pierre and Miquelon",0
|
||||
3425505,en,NA,"North America",GL,Greenland,0
|
||||
3437598,en,SA,"South America",PY,Paraguay,0
|
||||
3439705,en,SA,"South America",UY,Uruguay,0
|
||||
3469034,en,SA,"South America",BR,Brazil,0
|
||||
3474414,en,SA,"South America",FK,"Falkland Islands",0
|
||||
3474415,en,AN,Antarctica,GS,"South Georgia and the South Sandwich Islands",0
|
||||
3489940,en,NA,"North America",JM,Jamaica,0
|
||||
3508796,en,NA,"North America",DO,"Dominican Republic",0
|
||||
3562981,en,NA,"North America",CU,Cuba,0
|
||||
3570311,en,NA,"North America",MQ,Martinique,1
|
||||
3572887,en,NA,"North America",BS,Bahamas,0
|
||||
3573345,en,NA,"North America",BM,Bermuda,0
|
||||
3573511,en,NA,"North America",AI,Anguilla,0
|
||||
3573591,en,NA,"North America",TT,"Trinidad and Tobago",0
|
||||
3575174,en,NA,"North America",KN,"St Kitts and Nevis",0
|
||||
3575830,en,NA,"North America",DM,Dominica,0
|
||||
3576396,en,NA,"North America",AG,"Antigua and Barbuda",0
|
||||
3576468,en,NA,"North America",LC,"Saint Lucia",0
|
||||
3576916,en,NA,"North America",TC,"Turks and Caicos Islands",0
|
||||
3577279,en,NA,"North America",AW,Aruba,0
|
||||
3577718,en,NA,"North America",VG,"British Virgin Islands",0
|
||||
3577815,en,NA,"North America",VC,"Saint Vincent and the Grenadines",0
|
||||
3578097,en,NA,"North America",MS,Montserrat,0
|
||||
3578421,en,NA,"North America",MF,"Saint Martin",1
|
||||
3578476,en,NA,"North America",BL,"Saint Barthélemy",0
|
||||
3579143,en,NA,"North America",GP,Guadeloupe,1
|
||||
3580239,en,NA,"North America",GD,Grenada,0
|
||||
3580718,en,NA,"North America",KY,"Cayman Islands",0
|
||||
3582678,en,NA,"North America",BZ,Belize,0
|
||||
3585968,en,NA,"North America",SV,"El Salvador",0
|
||||
3595528,en,NA,"North America",GT,Guatemala,0
|
||||
3608932,en,NA,"North America",HN,Honduras,0
|
||||
3617476,en,NA,"North America",NI,Nicaragua,0
|
||||
3624060,en,NA,"North America",CR,"Costa Rica",0
|
||||
3625428,en,SA,"South America",VE,Venezuela,0
|
||||
3658394,en,SA,"South America",EC,Ecuador,0
|
||||
3686110,en,SA,"South America",CO,Colombia,0
|
||||
3703430,en,NA,"North America",PA,Panama,0
|
||||
3723988,en,NA,"North America",HT,Haiti,0
|
||||
3865483,en,SA,"South America",AR,Argentina,0
|
||||
3895114,en,SA,"South America",CL,Chile,0
|
||||
3923057,en,SA,"South America",BO,Bolivia,0
|
||||
3932488,en,SA,"South America",PE,Peru,0
|
||||
3996063,en,NA,"North America",MX,Mexico,0
|
||||
4030656,en,OC,Oceania,PF,"French Polynesia",0
|
||||
4030699,en,OC,Oceania,PN,"Pitcairn Islands",0
|
||||
4030945,en,OC,Oceania,KI,Kiribati,0
|
||||
4031074,en,OC,Oceania,TK,Tokelau,0
|
||||
4032283,en,OC,Oceania,TO,Tonga,0
|
||||
4034749,en,OC,Oceania,WF,"Wallis and Futuna",0
|
||||
4034894,en,OC,Oceania,WS,Samoa,0
|
||||
4036232,en,OC,Oceania,NU,Niue,0
|
||||
4041468,en,OC,Oceania,MP,"Northern Mariana Islands",0
|
||||
4043988,en,OC,Oceania,GU,Guam,0
|
||||
4566966,en,NA,"North America",PR,"Puerto Rico",0
|
||||
4796775,en,NA,"North America",VI,"U.S. Virgin Islands",0
|
||||
5854968,en,OC,Oceania,UM,"U.S. Minor Outlying Islands",0
|
||||
5880801,en,OC,Oceania,AS,"American Samoa",0
|
||||
6251999,en,NA,"North America",CA,Canada,0
|
||||
6252001,en,NA,"North America",US,"United States",0
|
||||
6254930,en,AS,Asia,PS,Palestine,0
|
||||
6255147,en,AS,Asia,,,0
|
||||
6255148,en,EU,Europe,,,0
|
||||
6290252,en,EU,Europe,RS,Serbia,0
|
||||
6697173,en,AN,Antarctica,AQ,Antarctica,0
|
||||
7609695,en,NA,"North America",SX,"Sint Maarten",0
|
||||
7626836,en,NA,"North America",CW,Curaçao,0
|
||||
7626844,en,NA,"North America",BQ,"Bonaire, Sint Eustatius, and Saba",0
|
||||
7909807,en,AF,Africa,SS,"South Sudan",0
|
|
4
Signal/src/Loki/Utilities/CSVUtilities.swift
Normal file
4
Signal/src/Loki/Utilities/CSVUtilities.swift
Normal file
|
@ -0,0 +1,4 @@
|
|||
import SwiftCSV
|
||||
|
||||
@inline(never)
|
||||
public func preload(_ x: CSV) { }
|
|
@ -84,6 +84,10 @@ final class HomeVC : BaseVC, UITableViewDataSource, UITableViewDelegate, UIScrol
|
|||
// MARK: Lifecycle
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
DispatchQueue.global(qos: .userInitiated).async {
|
||||
preload(PathVC.ipv4Table)
|
||||
preload(PathVC.countryNamesTable)
|
||||
}
|
||||
SignalApp.shared().homeViewController = self
|
||||
setUpGradientBackground()
|
||||
if navigationController?.navigationBar != nil {
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
import NVActivityIndicatorView
|
||||
import SwiftCSV
|
||||
|
||||
final class PathVC : BaseVC {
|
||||
|
||||
static let ipv4Table = try! CSV(name: "GeoLite2-Country-Blocks-IPv4", extension: "csv", bundle: .main, delimiter: ",", encoding: .utf8, loadColumns: true)!
|
||||
static let countryNamesTable = try! CSV(name: "GeoLite2-Country-Locations-English", extension: "csv", bundle: .main, delimiter: ",", encoding: .utf8, loadColumns: true)!
|
||||
static var countryNamesCache: [String:String] = [:]
|
||||
|
||||
// MARK: Components
|
||||
private lazy var pathStackView: UIStackView = {
|
||||
let result = UIStackView()
|
||||
|
@ -163,13 +168,27 @@ final class PathVC : BaseVC {
|
|||
}
|
||||
|
||||
private func getPathRow(snode: LokiAPITarget, location: LineView.Location, dotAnimationStartDelay: Double, dotAnimationRepeatInterval: Double, isGuardSnode: Bool) -> UIStackView {
|
||||
var snodeIP = snode.description
|
||||
if snodeIP.hasPrefix("https://") { snodeIP.removeFirst(8) }
|
||||
if let colonIndex = snodeIP.lastIndex(of: ":") {
|
||||
snodeIP = String(snodeIP[snodeIP.startIndex..<colonIndex])
|
||||
var snodeIP = snode.ip
|
||||
func getCountry() -> String {
|
||||
if let country = PathVC.countryNamesCache[snode.address] { return country }
|
||||
if let ipv4TableIndex = PathVC.ipv4Table.namedColumns["network"]!.firstIndex(where: { $0.starts(with: snodeIP) }) {
|
||||
let countryID = PathVC.ipv4Table.namedColumns["registered_country_geoname_id"]![ipv4TableIndex]
|
||||
if let countryNamesTableIndex = PathVC.countryNamesTable.namedColumns["geoname_id"]!.firstIndex(of: countryID) {
|
||||
let country = PathVC.countryNamesTable.namedColumns["country_name"]![countryNamesTableIndex]
|
||||
PathVC.countryNamesCache[snode.address] = country
|
||||
return country
|
||||
}
|
||||
}
|
||||
if snodeIP.contains(".") && !snodeIP.hasSuffix(".") { // The fuzziest we want to go is xxx.x
|
||||
snodeIP.removeLast()
|
||||
if snodeIP.hasSuffix(".") { snodeIP.removeLast() }
|
||||
return getCountry()
|
||||
} else {
|
||||
return "Unknown Country"
|
||||
}
|
||||
}
|
||||
let title = isGuardSnode ? NSLocalizedString("Guard Node", comment: "") : NSLocalizedString("Service Node", comment: "")
|
||||
return getPathRow(title: title, subtitle: snodeIP, location: location, dotAnimationStartDelay: dotAnimationStartDelay, dotAnimationRepeatInterval: dotAnimationRepeatInterval)
|
||||
return getPathRow(title: title, subtitle: getCountry(), location: location, dotAnimationStartDelay: dotAnimationStartDelay, dotAnimationRepeatInterval: dotAnimationRepeatInterval)
|
||||
}
|
||||
|
||||
// MARK: Interaction
|
||||
|
|
|
@ -3,10 +3,14 @@ public typealias Snode = LokiAPITarget
|
|||
|
||||
/// Either a service node or another client if P2P is enabled.
|
||||
public final class LokiAPITarget : NSObject, NSCoding {
|
||||
internal let address: String
|
||||
internal let port: UInt16
|
||||
public let address: String
|
||||
public let port: UInt16
|
||||
internal let publicKeySet: KeySet?
|
||||
|
||||
public var ip: String {
|
||||
String(address[address.index(address.startIndex, offsetBy: 8)..<address.endIndex])
|
||||
}
|
||||
|
||||
// MARK: Nested Types
|
||||
internal enum Method : String {
|
||||
/// Only supported by snode targets.
|
||||
|
|
1
ThirdParty/Cartfile
vendored
1
ThirdParty/Cartfile
vendored
|
@ -1 +1,2 @@
|
|||
github "TheLevelUp/ZXingObjC"
|
||||
github "swiftcsv/SwiftCSV"
|
||||
|
|
1
ThirdParty/Cartfile.resolved
vendored
1
ThirdParty/Cartfile.resolved
vendored
|
@ -1 +1,2 @@
|
|||
github "TheLevelUp/ZXingObjC" "3.6.4"
|
||||
github "swiftcsv/SwiftCSV" "0.5.6"
|
||||
|
|
Loading…
Reference in a new issue