Merge pull request #2419 from open-keychain/update-sweetspot

Update NFC sweetspot data, and extract into separate module
This commit is contained in:
Dominik Schürmann 2018-11-21 10:31:56 +01:00 committed by GitHub
commit 1f33102d7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 1213 additions and 415 deletions

View file

@ -56,6 +56,7 @@ dependencies {
// libs as submodules
implementation project(':libkeychain')
implementation project(':openpgp-api-lib')
implementation project(':nfcsweetspot')
implementation project(':sshauthentication-api')
implementation project(':extern:bouncycastle:core')
implementation project(':extern:bouncycastle:pg')

View file

@ -858,7 +858,7 @@
android:theme="@android:style/Theme.NoDisplay" />
<activity
android:name=".ui.ShowNfcSweetspotActivity"
android:name="org.sufficientlysecure.keychain.ui.ShowNfcSweetspotActivity"
android:exported="false"
android:theme="@style/Theme.Keychain.AppCompat.Transparent.Fullscreen"
/>

View file

@ -1,360 +0,0 @@
/*
* Copyright (C) 2017 Schürmann & Breitmoser GbR
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.sufficientlysecure.keychain.securitytoken;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import android.util.Pair;
public class NfcSweetspotData {
public static final Map<String, Pair<Double,Double>> SWEETSPOT_DATA;
static {
Map<String, Pair<Double,Double>> data = new HashMap<>();
// Values scraped from NFC-Ring Sweetspot API, taking the median of these points for all models
data.put("7DTB37", new Pair<>(0.5, 0.410094637224));
data.put("306SH", new Pair<>(0.502777777778, 0.541446208113));
data.put("402ZT", new Pair<>(0.375, 0.496323529412));
data.put("710C", new Pair<>(0.438888888889, 0.363315696649));
data.put("5027B", new Pair<>(0.475, 0.468864468864));
data.put("5042T", new Pair<>(0.508333333333, 0.544715447154));
data.put("5051X", new Pair<>(0.497222222222, 0.517857142857));
data.put("5054S", new Pair<>(0.708333333333, 0.658536585366));
data.put("5054W", new Pair<>(0.469444444444, 0.505691056911));
data.put("5056N", new Pair<>(0.480555555556, 0.477272727273));
data.put("5056W", new Pair<>(0.613888888889, 0.652597402597));
data.put("5065D", new Pair<>(0.468144044321, 0.531604538088));
data.put("5065N", new Pair<>(0.559556786704, 0.544570502431));
data.put("6039A", new Pair<>(0.547222222222, 0.57848324515));
data.put("6039J", new Pair<>(0.227777777778, 0.742504409171));
data.put("6039Y", new Pair<>(0.336111111111, 0.679012345679));
data.put("6044D", new Pair<>(0.6, 0.550264550265));
data.put("6055B", new Pair<>(0.266666666667, 0.220070422535));
data.put("6055K", new Pair<>(0.519444444444, 0.375));
data.put("6055P", new Pair<>(0.525, 0.707746478873));
data.put("7040N", new Pair<>(0.419444444444, 0.461788617886));
data.put("7040T", new Pair<>(0.413888888889, 0.440650406504));
data.put("7045Y", new Pair<>(0.808333333333, 0.49756097561));
data.put("8030Y", new Pair<>(0.713888888889, 0.645528455285));
data.put("8050D", new Pair<>(0.525, 0.282926829268));
data.put("9001D", new Pair<>(0.452777777778, 0.512987012987));
data.put("9001X", new Pair<>(0.522222222222, 0.516233766234));
data.put("9020A", new Pair<>(0.903494176373, 0.688413948256));
data.put("A1", new Pair<>(0.416666666667, 0.39837398374));
data.put("A1-713", new Pair<>(0.813333333333, 0.106203995794));
data.put("A1-734", new Pair<>(0.724584103512, 0.594382022472));
data.put("A1P", new Pair<>(0.638888888889, 0.241883116883));
data.put("A2", new Pair<>(0.384375, 0.592519685039));
data.put("A3-A20", new Pair<>(0.45375, 0.12676056338));
data.put("A3-A30", new Pair<>(0.17625, 0.135874067937));
data.put("A5", new Pair<>(0.208333333333, 0.24025974026));
data.put("A6", new Pair<>(0.702777777778, 0.460162601626));
data.put("A7", new Pair<>(0.705555555556, 0.632520325203));
data.put("A11w", new Pair<>(0.49375, 0.126838235294));
data.put("A33f", new Pair<>(0.716666666667, 0.525203252033));
data.put("A37f", new Pair<>(0.469444444444, 0.594855305466));
data.put("a4", new Pair<>(0.45, 0.297244094488));
data.put("A464BG", new Pair<>(0.365625, 0.452747252747));
data.put("A466BG", new Pair<>(0.46875, 0.492156862745));
data.put("A521L", new Pair<>(0.515625, 0.523622047244));
data.put("A621BL", new Pair<>(0.45, 0.549593495935));
data.put("A1601", new Pair<>(0.494444444444, 0.516077170418));
data.put("Alcatel_4060A", new Pair<>(0.65625, 0.522058823529));
data.put("Alcatel_5054O", new Pair<>(0.511111111111, 0.422764227642));
data.put("Alcatel_5056O", new Pair<>(0.447222222222, 0.452032520325));
data.put("Alcatel_5098O", new Pair<>(0.466666666667, 0.608766233766));
data.put("Alcatel_6055U", new Pair<>(0.480555555556, 0.505281690141));
data.put("Alcatel_7049D", new Pair<>(0.463888888889, 0.564227642276));
data.put("ALCATEL ONE TOUCH 5036A", new Pair<>(0.285416666667, 0.810049019608));
data.put("ALCATEL ONE TOUCH 7041D", new Pair<>(0.414583333333, 0.47181372549));
data.put("ALCATEL ONE TOUCH 7047D", new Pair<>(0.333333333333, 0.416485900217));
data.put("ALCATEL ONETOUCH P310A", new Pair<>(0.555, 0.574132492114));
data.put("AP54", new Pair<>(0.571875, 0.560661764706));
data.put("Aquaris E4", new Pair<>(0.45625, 0.505905511811));
data.put("Aquaris E6", new Pair<>(0.297222222222, 0.617886178862));
data.put("Aquaris M5", new Pair<>(0.469444444444, 0.49512987013));
data.put("Aquaris M5.5", new Pair<>(0.452777777778, 0.491883116883));
data.put("Aquaris U", new Pair<>(0.216666666667, 0.503246753247));
data.put("Aquaris X", new Pair<>(0.3625, 0.603669724771));
data.put("Aquaris X5 Plus", new Pair<>(0.561111111111, 0.258802816901));
data.put("Archos 50c Platinum", new Pair<>(0.660194174757, 0.4243281471));
data.put("Bay", new Pair<>(0.647222222222, 0.894308943089));
data.put("Blade L2 Plus", new Pair<>(0.6875, 0.443014705882));
data.put("Blade S6", new Pair<>(0.441666666667, 0.242276422764));
data.put("Blade V6", new Pair<>(0.463888888889, 0.482926829268));
data.put("BV6000", new Pair<>(0.447222222222, 0.568181818182));
data.put("BV7000", new Pair<>(0.8, 0.714285714286));
data.put("C1", new Pair<>(0.658333333333, 0.522727272727));
data.put("C1+", new Pair<>(0.658333333333, 0.522727272727));
data.put("C103", new Pair<>(0.543689320388, 0.58615819209));
data.put("CHC-U23", new Pair<>(0.488888888889, 0.452032520325));
data.put("Che1-CL10", new Pair<>(0.438888888889, 0.473170731707));
data.put("Che1-L04", new Pair<>(0.419444444444, 0.536585365854));
data.put("Che2-L11", new Pair<>(0.194444444444, 0.112195121951));
data.put("CHM-U01", new Pair<>(0.65, 0.126829268293));
data.put("Classic", new Pair<>(0.48375, 0.46057571965));
data.put("CPH1609", new Pair<>(0.536111111111, 0.487138263666));
data.put("CPH1701", new Pair<>(0.472222222222, 0.435691318328));
data.put("Cynus T6", new Pair<>(0.552777777778, 0.0682926829268));
data.put("DARKSIDE", new Pair<>(0.552777777778, 0.442276422764));
data.put("Discovery II Mini", new Pair<>(0.55, 0.431985294118));
data.put("DROID RAZR M", new Pair<>(0.608333333333, 0.42328042328));
data.put("E500", new Pair<>(0.641666666667, 0.549868766404));
data.put("e6_plus", new Pair<>(0.530555555556, 0.671544715447));
data.put("Easy", new Pair<>(0.484375, 0.103296703297));
data.put("ELUGA Turbo", new Pair<>(0.480555555556, 0.554471544715));
data.put("Energy X 2", new Pair<>(0.266666666667, 0.115447154472));
data.put("F1f", new Pair<>(0.544444444444, 0.520325203252));
data.put("F5", new Pair<>(0.419444444444, 0.59512195122));
data.put("F5_15", new Pair<>(0.108333333333, 0.139837398374));
data.put("FEVER", new Pair<>(0.488888888889, 0.551056338028));
data.put("Fire", new Pair<>(0.341666666667, 0.0926829268293));
data.put("FRD-L02", new Pair<>(0.638888888889, 0.567944250871));
data.put("FS451", new Pair<>(0.546875, 0.573529411765));
data.put("G7-L01", new Pair<>(0.458333333333, 0.440917107584));
data.put("G620S-L01", new Pair<>(0.458333333333, 0.432520325203));
data.put("G620S-L03", new Pair<>(0.316666666667, 0.40162601626));
data.put("G630-U10", new Pair<>(0.522222222222, 0.307317073171));
data.put("G630-U20", new Pair<>(0.477777777778, 0.160975609756));
data.put("G735-L03", new Pair<>(0.413888888889, 0.606504065041));
data.put("G735-L12", new Pair<>(0.605555555556, 0.0829268292683));
data.put("Galaxy Nexus", new Pair<>(0.230555555556, 0.485915492958));
data.put("GETAWAY", new Pair<>(0.558333333333, 0.157723577236));
data.put("H30-L02", new Pair<>(0.288888888889, 0.50406504065));
data.put("H60-L04", new Pair<>(0.455555555556, 0.726631393298));
data.put("H60-L12", new Pair<>(0.825, 0.580487804878));
data.put("HIGHWAY PURE", new Pair<>(0.433333333333, 0.52733686067));
data.put("HM-N501-FL", new Pair<>(0.458333333333, 0.565853658537));
data.put("HM NOTE 1W", new Pair<>(0.497222222222, 0.231707317073));
data.put("HTC Desire 610", new Pair<>(0.490625, 0.534274193548));
data.put("HTC Desire 628 dual sim", new Pair<>(0.772222222222, 0.559082892416));
data.put("HTC One", new Pair<>(0.458333333333, 0.232520325203));
data.put("HTC One mini", new Pair<>(0.802777777778, 0.182113821138));
data.put("HTC U11", new Pair<>(0.663888888889, 0.126623376623));
data.put("HTV31", new Pair<>(0.391666666667, 0.543209876543));
data.put("Hudl 2", new Pair<>(0.888333333333, 0.942502818489));
data.put("I216X", new Pair<>(0.481481481481, 0.54114994363));
data.put("Ilium X510", new Pair<>(0.765625, 0.492673992674));
data.put("IM-100K", new Pair<>(0.430555555556, 0.595238095238));
data.put("IM-100S", new Pair<>(0.688888888889, 0.836734693878));
data.put("IM-A870K", new Pair<>(0.577777777778, 0.550264550265));
data.put("IM-A880S", new Pair<>(0.547222222222, 0.572357723577));
data.put("IM-A910L", new Pair<>(0.563888888889, 0.565853658537));
data.put("IM-A910S", new Pair<>(0.430555555556, 0.681300813008));
data.put("IQ4514 Quad", new Pair<>(0.394444444444, 0.123577235772));
data.put("JAZZ", new Pair<>(0.455555555556, 0.670689655172));
data.put("JERRY", new Pair<>(0.5, 0.485347985348));
data.put("K88", new Pair<>(0.858569051581, 0.208988764045));
data.put("Kurio7S", new Pair<>(0.758333333333, 0.542586750789));
data.put("L-EMENT 505", new Pair<>(0.5125, 0.624542124542));
data.put("L-EMENT551", new Pair<>(0.558333333333, 0.0113821138211));
data.put("LENNY", new Pair<>(0.55625, 0.801470588235));
data.put("LENNY2", new Pair<>(0.4375, 0.522058823529));
data.put("LENNY3", new Pair<>(0.513888888889, 0.574675324675));
data.put("Le X507", new Pair<>(0.427480916031, 0.0941558441558));
data.put("Le X509", new Pair<>(0.582697201018, 0.0207407407407));
data.put("L-ITE 506 HD", new Pair<>(0.483333333333, 0.592532467532));
data.put("LS-5002", new Pair<>(0.469444444444, 0.52557319224));
data.put("LS-5018", new Pair<>(0.686111111111, 0.634146341463));
data.put("M3s", new Pair<>(0.425, 0.417886178862));
data.put("M4 SS4453", new Pair<>(0.725, 0.237676056338));
data.put("M5", new Pair<>(0.694444444444, 0.482142857143));
data.put("M5 Plus", new Pair<>(0.475, 0.489430894309));
data.put("M8", new Pair<>(0.45, 0.39674796748));
data.put("M9", new Pair<>(0.5, 0.947967479675));
data.put("M370i", new Pair<>(0.672222222222, 0.579225352113));
data.put("Maya", new Pair<>(0.588888888889, 0.551948051948));
data.put("M bot 60", new Pair<>(0.583333333333, 0.600649350649));
data.put("MI 3W", new Pair<>(0.488888888889, 0.595161290323));
data.put("Mi 4i", new Pair<>(0.366666666667, 0.411290322581));
data.put("MI 4LTE", new Pair<>(0.205555555556, 0.353225806452));
data.put("MI 5s Plus", new Pair<>(0.496183206107, 0.456553755523));
data.put("MI MAX", new Pair<>(0.519083969466, 0.353460972018));
data.put("MI MAX 2", new Pair<>(0.549618320611, 0.0913107511046));
data.put("MI NOTE LTE", new Pair<>(0.58524173028, 0.546391752577));
data.put("MI PAD", new Pair<>(0.47265625, 0.449449449449));
data.put("MIX", new Pair<>(0.435114503817, 0.338733431517));
data.put("Moto C", new Pair<>(0.590625, 0.457875457875));
data.put("MS60", new Pair<>(0.738888888889, 0.39512195122));
data.put("MW6617", new Pair<>(0.283251231527, 0.895265423242));
data.put("N1", new Pair<>(0.465740740741, 0.372357723577));
data.put("N2", new Pair<>(0.575, 0.71568627451));
data.put("N817", new Pair<>(0.38125, 0.620078740157));
data.put("N9100", new Pair<>(0.488888888889, 0.580487804878));
data.put("N9132", new Pair<>(0.609375, 0.306985294118));
data.put("N9510", new Pair<>(0.469444444444, 0.492682926829));
data.put("N9515", new Pair<>(0.725, 0.0910569105691));
data.put("N9518", new Pair<>(0.641666666667, 0.458536585366));
data.put("N9520", new Pair<>(0.0194444444444, 0.463414634146));
data.put("N9521", new Pair<>(0.441666666667, 0.217886178862));
data.put("Nexus 4", new Pair<>(0.502604166667, 0.52733686067));
data.put("Nexus 5", new Pair<>(0.444444444444, 0.506172839506));
data.put("Nexus 5X", new Pair<>(0.211165048544, 0.159090909091));
data.put("Nexus 6", new Pair<>(0.495145631068, 0.585735963581));
data.put("Nexus 6P", new Pair<>(0.179611650485, 0.0409090909091));
data.put("Nexus 7 (2013)", new Pair<>(0.35269121813, 0.384688090737));
data.put("Nexus 9", new Pair<>(0.463541666667, 0.11974789916));
data.put("Nexus 10", new Pair<>(0.95875, 0.544324772162));
data.put("NX404H", new Pair<>(0.819444444444, 0.383739837398));
data.put("NX505J", new Pair<>(0.541666666667, 0.234185733513));
data.put("NX511J", new Pair<>(0.755555555556, 0.819512195122));
data.put("NX512J", new Pair<>(0.602777777778, 0.419512195122));
data.put("NX513J", new Pair<>(0.608333333333, 0.639024390244));
data.put("NXA8QC116", new Pair<>(0.77375, 0.488372093023));
data.put("One", new Pair<>(0.477777777778, 0.0861788617886));
data.put("One (M8)", new Pair<>(0.444444444444, 0.0864197530864));
data.put("OWN_S4025", new Pair<>(0.47962962963, 0.522776572668));
data.put("P2M", new Pair<>(0.696875, 0.314960629921));
data.put("P5 mini", new Pair<>(0.478125, 0.441176470588));
data.put("P5W", new Pair<>(0.547222222222, 0.554471544715));
data.put("P6_Energy", new Pair<>(0.533333333333, 0.523577235772));
data.put("P6 PRO", new Pair<>(0.527777777778, 0.0652557319224));
data.put("P7", new Pair<>(0.155555555556, 0.627642276423));
data.put("P7 Max", new Pair<>(0.536111111111, 0.402597402597));
data.put("PE-TL10", new Pair<>(0.619444444444, 0.68430335097));
data.put("PGN517", new Pair<>(0.394444444444, 0.530081300813));
data.put("PGN605", new Pair<>(0.497222222222, 0.278048780488));
data.put("Picasso", new Pair<>(0.480555555556, 0.469135802469));
data.put("Pixel", new Pair<>(0.723300970874, 0.225757575758));
data.put("Pixel XL", new Pair<>(0.46359223301, 0.159090909091));
data.put("Power", new Pair<>(0.461111111111, 0.532467532468));
data.put("PRO5043", new Pair<>(0.553125, 0.137867647059));
data.put("PSP3527DUO", new Pair<>(0.476454293629, 0.46925566343));
data.put("PSP3531DUO", new Pair<>(0.452777777778, 0.479020979021));
data.put("PSP5506DUO", new Pair<>(0.566666666667, 0.49756097561));
data.put("PSP5509DUO", new Pair<>(0.488888888889, 0.453658536585));
data.put("PULP 4G", new Pair<>(0.794444444444, 0.63139329806));
data.put("PULP FAB 4G", new Pair<>(0.433333333333, 0.553791887125));
data.put("PURE XL", new Pair<>(0.477777777778, 0.447154471545));
data.put("R1 HD", new Pair<>(0.344444444444, 0.383802816901));
data.put("R7kf", new Pair<>(0.619444444444, 0.372357723577));
data.put("R8006", new Pair<>(0.429166666667, 0.0626016260163));
data.put("RAINBOW", new Pair<>(0.502777777778, 0.276422764228));
data.put("RAINBOW JAM", new Pair<>(0.877777777778, 0.252204585538));
data.put("RAINBOW LITE 4G", new Pair<>(0.453125, 0.472426470588));
data.put("RAZR HD", new Pair<>(0.455555555556, 0.537918871252));
data.put("RealPad MA7BX2", new Pair<>(0.432291666667, 0.46898002103));
data.put("Redmi 3", new Pair<>(0.525, 0.551219512195));
data.put("Redmi 3S", new Pair<>(0.427777777778, 0.480519480519));
data.put("Redmi 4", new Pair<>(0.480555555556, 0.503225806452));
data.put("Redmi 4A", new Pair<>(0.527777777778, 0.605519480519));
data.put("Redmi Note 3", new Pair<>(0.491666666667, 0.451612903226));
data.put("Redmi Note 4", new Pair<>(0.416666666667, 0.446774193548));
data.put("Redmi Pro", new Pair<>(0.955555555556, 0.641935483871));
data.put("RIDGE 4G", new Pair<>(0.488888888889, 0.529100529101));
data.put("RIDGE FAB 4G", new Pair<>(0.433333333333, 0.537918871252));
data.put("ROBBY", new Pair<>(0.455555555556, 0.489436619718));
data.put("Robin", new Pair<>(0.302777777778, 0.575704225352));
data.put("s4", new Pair<>(0.452777777778, 0.0780487804878));
data.put("S6", new Pair<>(0.384375, 0.265625));
data.put("S6s", new Pair<>(0.658333333333, 0.465909090909));
data.put("S7", new Pair<>(0.541666666667, 0.510569105691));
data.put("S30", new Pair<>(0.677777777778, 0.488636363636));
data.put("S40", new Pair<>(0.486111111111, 0.258536585366));
data.put("S50", new Pair<>(0.786111111111, 0.783068783069));
data.put("S60", new Pair<>(0.405555555556, 0.522727272727));
data.put("S550", new Pair<>(0.566666666667, 0.291056910569));
data.put("Shaker-Slim", new Pair<>(0.5, 0.523897058824));
data.put("Signature Touch", new Pair<>(0.563888888889, 0.514991181658));
data.put("SMART 4G 5.5 Enterprise", new Pair<>(0.366666666667, 0.476422764228));
data.put("STARADDICT 4", new Pair<>(0.713888888889, 0.112195121951));
data.put("STUDIO M HD", new Pair<>(0.755555555556, 0.378861788618));
data.put("SUNNY", new Pair<>(0.44375, 0.543137254902));
data.put("SUNSET2", new Pair<>(0.621875, 0.51968503937));
data.put("T1", new Pair<>(0.461111111111, 0.540492957746));
data.put("T5", new Pair<>(0.9, 0.459415584416));
data.put("T9", new Pair<>(0.407552083333, 0.565720294427));
data.put("T11", new Pair<>(0.647222222222, 0.429268292683));
data.put("T12", new Pair<>(0.563888888889, 0.0357723577236));
data.put("TOMMY", new Pair<>(0.402777777778, 0.549295774648));
data.put("Tornado 348", new Pair<>(0.441666666667, 0.834146341463));
data.put("TREKKER-M1 CORE", new Pair<>(0.34375, 0.81684981685));
data.put("U673C", new Pair<>(0.44375, 0.535294117647));
data.put("U FEEL", new Pair<>(0.472222222222, 0.447183098592));
data.put("U FEEL LITE", new Pair<>(0.605555555556, 0.338028169014));
data.put("V3", new Pair<>(0.588888888889, 0.117886178862));
data.put("V3+", new Pair<>(0.588888888889, 0.117886178862));
data.put("V5", new Pair<>(0.45, 0.261788617886));
data.put("V6", new Pair<>(0.479201331115, 0.759871931697));
data.put("V9", new Pair<>(0.515625, 0.0625));
data.put("V355", new Pair<>(0.588888888889, 0.730519480519));
data.put("VF695", new Pair<>(0.3625, 0.23031496063));
data.put("Vodafone 785", new Pair<>(0.545833333333, 0.45406824147));
data.put("Vodafone Smart ultra 6", new Pair<>(0.447222222222, 0.460162601626));
data.put("VSP355s", new Pair<>(0.352777777778, 0.567901234568));
data.put("X1", new Pair<>(0.533333333333, 0.460162601626));
data.put("X3", new Pair<>(0.59375, 0.511029411765));
data.put("X5", new Pair<>(0.447222222222, 0.586991869919));
data.put("X7", new Pair<>(0.425058548009, 0.643734643735));
data.put("X9S", new Pair<>(0.397222222222, 0.0959349593496));
data.put("X11", new Pair<>(0.444444444444, 0.530081300813));
data.put("X12", new Pair<>(0.605555555556, 0.482926829268));
data.put("X17", new Pair<>(0.506361323155, 0.440652818991));
data.put("X600", new Pair<>(0.616666666667, 0.53064516129));
data.put("X9006", new Pair<>(0.464814814815, 0.283468834688));
data.put("X9009", new Pair<>(0.5, 0.488745980707));
data.put("X9076", new Pair<>(0.486111111111, 0.572357723577));
data.put("Xperia SP", new Pair<>(0.5, 0.786971830986));
data.put("Xperia T", new Pair<>(0.680555555556, 0.613756613757));
data.put("Xperia Z", new Pair<>(0.594444444444, 0.375));
data.put("Xperia Z1", new Pair<>(0.583333333333, 0.155202821869));
data.put("Xperia Z1 Compact", new Pair<>(0.486111111111, 0.195767195767));
data.put("Xperia Z2", new Pair<>(0.425, 0.20811287478));
data.put("Xperia Z3", new Pair<>(0.647222222222, 0.336860670194));
data.put("Xperia Z3+", new Pair<>(0.647222222222, 0.336860670194));
data.put("Xperia ZL", new Pair<>(0.469444444444, 0.573943661972));
data.put("Y541-U02", new Pair<>(0.39375, 0.454044117647));
data.put("Y635-L01", new Pair<>(0.490625, 0.505514705882));
data.put("Y635-L03", new Pair<>(0.4375, 0.602941176471));
data.put("Y635-L21", new Pair<>(0.41875, 0.354779411765));
data.put("Z1", new Pair<>(0.6, 0.673170731707));
data.put("Z3", new Pair<>(0.702777777778, 0.608465608466));
data.put("Z9 Plus", new Pair<>(0.380555555556, 0.245528455285));
data.put("Z10", new Pair<>(0.544270833333, 0.556218057922));
data.put("Z667T", new Pair<>(0.4375, 0.479120879121));
data.put("Z716BL", new Pair<>(0.50625, 0.594488188976));
data.put("Z717VL", new Pair<>(0.671875, 0.405511811024));
data.put("Z755", new Pair<>(0.603125, 0.564960629921));
data.put("Z792", new Pair<>(0.353125, 0.516544117647));
data.put("Z793C", new Pair<>(0.496875, 0.448529411765));
data.put("Z812", new Pair<>(0.471875, 0.431985294118));
data.put("Z813", new Pair<>(0.596875, 0.522058823529));
data.put("Z818L", new Pair<>(0.528125, 0.485294117647));
data.put("Z820", new Pair<>(0.425, 0.538602941176));
data.put("Z828", new Pair<>(0.375, 0.261029411765));
data.put("Z832", new Pair<>(0.4375, 0.604395604396));
data.put("Z833", new Pair<>(0.51875, 0.64652014652));
data.put("Z850", new Pair<>(0.494444444444, 0.608130081301));
data.put("Z936L", new Pair<>(0.630555555556, 0.367479674797));
data.put("Z956", new Pair<>(0.472222222222, 0.469155844156));
data.put("Z958", new Pair<>(0.486111111111, 0.569105691057));
data.put("Z959", new Pair<>(0.522222222222, 0.546341463415));
data.put("Z963VL", new Pair<>(0.761111111111, 0.391869918699));
data.put("Z970", new Pair<>(0.5, 0.531707317073));
data.put("Z981", new Pair<>(0.497222222222, 0.469155844156));
data.put("Z987", new Pair<>(0.472222222222, 0.453262786596));
data.put("ZTE Blade L5", new Pair<>(0.590625, 0.369485294118));
data.put("ZTE BLADE V0720", new Pair<>(0.458333333333, 0.487012987013));
SWEETSPOT_DATA = Collections.unmodifiableMap(data);
}
}

View file

@ -33,6 +33,7 @@ import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.animation.Animation;
import de.cotech.sweetspot.NfcSweetspotData;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.securitytoken.SecurityTokenInfo;
@ -92,7 +93,7 @@ public class CreateSecurityTokenWaitFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.create_security_token_wait_fragment, container, false);
boolean showLocateSweetspot = ShowNfcSweetspotActivity.hasSweetspotData();
boolean showLocateSweetspot = NfcSweetspotData.hasSweetspotData();
View buttonLocateSweetspot = view.findViewById(R.id.button_locate_nfc);
buttonLocateSweetspot.setVisibility(showLocateSweetspot ? View.VISIBLE : View.GONE);
buttonLocateSweetspot.setOnClickListener(new OnClickListener() {

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2017 Schürmann & Breitmoser GbR
* Copyright (C) 2018 Schürmann & Breitmoser GbR
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -20,18 +20,14 @@ package org.sufficientlysecure.keychain.ui;
import android.app.Activity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.DisplayMetrics;
import android.util.Pair;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.DecelerateInterpolator;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.securitytoken.NfcSweetspotData;
import de.cotech.sweetspot.NfcSweetspotData;
import org.sufficientlysecure.keychain.securitytoken.SecurityTokenConnection;
import org.sufficientlysecure.keychain.ui.base.BaseSecurityTokenActivity;
@ -46,15 +42,16 @@ public class ShowNfcSweetspotActivity extends BaseSecurityTokenActivity {
private View sweetspotCircle3;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
protected void onCreate(Bundle savedInstanceState) {
setTheme(android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
overridePendingTransition(de.cotech.sweetspot.R.anim.fade_in_quick, de.cotech.sweetspot.R.anim.fade_out_quick);
super.onCreate(savedInstanceState);
overridePendingTransition(R.anim.fade_in_quick, R.anim.fade_out_quick);
setContentView(de.cotech.sweetspot.R.layout.activity_nfc_sweetspot);
sweetspotIndicator = findViewById(de.cotech.sweetspot.R.id.indicator_nfc_sweetspot);
setContentView(R.layout.show_nfc_sweetspot_activity);
sweetspotIndicator = findViewById(R.id.nfc_sweetspot_indicator);
Pair<Double, Double> nfcPosition = NfcSweetspotData.SWEETSPOT_DATA.get(Build.MODEL);
Pair<Double, Double> nfcPosition = NfcSweetspotData.getSweetspotForBuildModel();
if (nfcPosition == null) {
throw new IllegalArgumentException("No data available for this model. This activity should not be called!");
}
@ -63,18 +60,15 @@ public class ShowNfcSweetspotActivity extends BaseSecurityTokenActivity {
final float translationX = (float) (displayDimensions.widthPixels * nfcPosition.first);
final float translationY = (float) (displayDimensions.heightPixels * nfcPosition.second);
sweetspotIndicator.post(new Runnable() {
@Override
public void run() {
sweetspotIndicator.setTranslationX(translationX - sweetspotIndicator.getWidth() / 2);
sweetspotIndicator.setTranslationY(translationY - sweetspotIndicator.getHeight() / 2);
}
sweetspotIndicator.post(() -> {
sweetspotIndicator.setTranslationX(translationX - sweetspotIndicator.getWidth() / 2);
sweetspotIndicator.setTranslationY(translationY - sweetspotIndicator.getHeight() / 2);
});
sweetspotIcon = findViewById(R.id.nfc_sweetspot_icon);
sweetspotCircle1 = findViewById(R.id.nfc_sweetspot_circle_1);
sweetspotCircle2 = findViewById(R.id.nfc_sweetspot_circle_2);
sweetspotCircle3 = findViewById(R.id.nfc_sweetspot_circle_3);
sweetspotIcon = findViewById(de.cotech.sweetspot.R.id.icon_nfc_sweetspot);
sweetspotCircle1 = findViewById(de.cotech.sweetspot.R.id.circle_nfc_sweetspot_1);
sweetspotCircle2 = findViewById(de.cotech.sweetspot.R.id.circle_nfc_sweetspot_2);
sweetspotCircle3 = findViewById(de.cotech.sweetspot.R.id.circle_nfc_sweetspot_3);
sweetspotIcon.setAlpha(0.0f);
sweetspotCircle1.setAlpha(0.0f);
@ -82,6 +76,14 @@ public class ShowNfcSweetspotActivity extends BaseSecurityTokenActivity {
sweetspotCircle3.setAlpha(0.0f);
}
@Override
protected void onSecurityTokenPostExecute(SecurityTokenConnection stConnection) {
Intent result = new Intent();
result.putExtra(EXTRA_TOKEN_INFO, tokenInfo);
setResult(Activity.RESULT_OK, result);
finish();
}
@Override
public void onEnterAnimationComplete() {
super.onEnterAnimationComplete();
@ -93,24 +95,11 @@ public class ShowNfcSweetspotActivity extends BaseSecurityTokenActivity {
sweetspotCircle3.animate().alpha(1.0f).setInterpolator(interpolator).setDuration(1000).setStartDelay(300).start();
}
@Override
protected void initTheme() {
// do nothing
}
@Override
public void finish() {
super.finish();
overridePendingTransition(R.anim.fade_in_quick, R.anim.fade_out_quick);
}
@Override
protected void onSecurityTokenPostExecute(SecurityTokenConnection stConnection) {
Intent result = new Intent();
result.putExtra(EXTRA_TOKEN_INFO, tokenInfo);
setResult(Activity.RESULT_OK, result);
finish();
overridePendingTransition(de.cotech.sweetspot.R.anim.fade_in_quick, de.cotech.sweetspot.R.anim.fade_out_quick);
}
@Override
@ -124,15 +113,10 @@ public class ShowNfcSweetspotActivity extends BaseSecurityTokenActivity {
return super.onTouchEvent(event);
}
@NonNull
private DisplayMetrics getDisplaySize() {
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
return metrics;
}
public static boolean hasSweetspotData() {
return NfcSweetspotData.SWEETSPOT_DATA.containsKey(Build.MODEL);
}
}

33
nfcsweetspot/.gitignore vendored Normal file
View file

@ -0,0 +1,33 @@
#Android specific
bin
gen
obj
lint.xml
local.properties
release.properties
ant.properties
*.class
*.apk
#Gradle
.gradle
build
gradle.properties
#Maven
target
pom.xml.*
#Eclipse
.project
.classpath
.settings
.metadata
#IntelliJ IDEA
.idea
*.iml
#Lint output
lint-report.html
lint-report_files/*

18
nfcsweetspot/build.gradle Normal file
View file

@ -0,0 +1,18 @@
apply plugin: 'com.android.library'
dependencies {
}
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
minSdkVersion 14
}
// Do not abort build if lint finds errors
lintOptions {
abortOnError false
}
}

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="de.cotech.sweetspot" />

View file

@ -0,0 +1,985 @@
/*
* Copyright (C) 2017 Schürmann & Breitmoser GbR
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.cotech.sweetspot;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import android.os.Build;
import android.util.Pair;
public class NfcSweetspotData {
public static final Map<String, Pair<Double,Double>> SWEETSPOT_DATA;
static {
Map<String, Pair<Double,Double>> data = new HashMap<>();
// Values scraped from NFC-Ring Sweetspot API, taking the median of these points for all models
data.put("4G", new Pair<>(0.541666666667, 0.050406504065));
data.put("7DTB37", new Pair<>(0.5, 0.410094637224));
data.put("10DTB42", new Pair<>(0.635, 0.304942166141));
data.put("306SH", new Pair<>(0.494444444444, 0.553791887125));
data.put("402ZT", new Pair<>(0.375, 0.496323529412));
data.put("404SC", new Pair<>(0.947222222222, 0.930194805195));
data.put("503KC", new Pair<>(0.561111111111, 0.547535211268));
data.put("601SO", new Pair<>(0.336111111111, 0.621478873239));
data.put("710C", new Pair<>(0.438888888889, 0.363315696649));
data.put("4047X", new Pair<>(0.559375, 0.637362637363));
data.put("5011A", new Pair<>(0.533333333333, 0.56514084507));
data.put("5017B", new Pair<>(0.59375, 0.444852941176));
data.put("5027B", new Pair<>(0.459375, 0.461538461538));
data.put("5042T", new Pair<>(0.508333333333, 0.569105691057));
data.put("5049W", new Pair<>(0.558333333333, 0.485915492958));
data.put("5049Z", new Pair<>(0.45, 0.521126760563));
data.put("5051J", new Pair<>(0.544444444444, 0.569805194805));
data.put("5051X", new Pair<>(0.497222222222, 0.517857142857));
data.put("5054S", new Pair<>(0.466666666667, 0.658536585366));
data.put("5054W", new Pair<>(0.469444444444, 0.505691056911));
data.put("5056A", new Pair<>(0.45, 0.563311688312));
data.put("5056D", new Pair<>(0.341666666667, 0.512987012987));
data.put("5056E", new Pair<>(0.572222222222, 0.75));
data.put("5056I", new Pair<>(0.444444444444, 0.517857142857));
data.put("5056N", new Pair<>(0.513888888889, 0.456168831169));
data.put("5056W", new Pair<>(0.563888888889, 0.607142857143));
data.put("5065D", new Pair<>(0.468144044321, 0.531604538088));
data.put("5065N", new Pair<>(0.559556786704, 0.544570502431));
data.put("5070D", new Pair<>(0.438888888889, 0.582113821138));
data.put("5080A", new Pair<>(0.522222222222, 0.628246753247));
data.put("5560S", new Pair<>(0.385041551247, 0.741767764298));
data.put("6039A", new Pair<>(0.547222222222, 0.57848324515));
data.put("6039J", new Pair<>(0.227777777778, 0.742504409171));
data.put("6039Y", new Pair<>(0.336111111111, 0.735915492958));
data.put("6044D", new Pair<>(0.6, 0.550264550265));
data.put("6055A", new Pair<>(0.463888888889, 0.429577464789));
data.put("6055B", new Pair<>(0.191666666667, 0.25176056338));
data.put("6055K", new Pair<>(0.497222222222, 0.375));
data.put("6055P", new Pair<>(0.247222222222, 0.508802816901));
data.put("6062W", new Pair<>(0.366666666667, 0.449386503067));
data.put("7040N", new Pair<>(0.419444444444, 0.461788617886));
data.put("7040T", new Pair<>(0.413888888889, 0.440650406504));
data.put("7045Y", new Pair<>(0.808333333333, 0.49756097561));
data.put("8030Y", new Pair<>(0.713888888889, 0.645528455285));
data.put("8050D", new Pair<>(0.513888888889, 0.481300813008));
data.put("8050G", new Pair<>(0.539408866995, 0.694404591105));
data.put("9001D", new Pair<>(0.452777777778, 0.512987012987));
data.put("9001X", new Pair<>(0.522222222222, 0.516233766234));
data.put("9020A", new Pair<>(0.903494176373, 0.688413948256));
data.put("9024W", new Pair<>(0.494176372712, 0.0415730337079));
data.put("A0001", new Pair<>(0.458333333333, 0.487804878049));
data.put("A1", new Pair<>(0.577777777778, 0.39837398374));
data.put("A1-713", new Pair<>(0.813333333333, 0.106203995794));
data.put("A1-734", new Pair<>(0.724584103512, 0.594382022472));
data.put("A1 lite", new Pair<>(0.491666666667, 0.519480519481));
data.put("A1P", new Pair<>(0.638888888889, 0.241883116883));
data.put("A2", new Pair<>(0.384375, 0.592519685039));
data.put("A3-A20", new Pair<>(0.45375, 0.12676056338));
data.put("A3-A30", new Pair<>(0.17625, 0.135874067937));
data.put("a4", new Pair<>(0.45, 0.297244094488));
data.put("A5", new Pair<>(0.208333333333, 0.24025974026));
data.put("A5_Ready", new Pair<>(0.4125, 0.543137254902));
data.put("A6", new Pair<>(0.702777777778, 0.460162601626));
data.put("A7", new Pair<>(0.544444444444, 0.595070422535));
data.put("A7Pro", new Pair<>(0.597222222222, 0.392857142857));
data.put("A8", new Pair<>(0.5, 0.396330275229));
data.put("A11w", new Pair<>(0.49375, 0.126838235294));
data.put("A33f", new Pair<>(0.716666666667, 0.552845528455));
data.put("A33w", new Pair<>(0.488888888889, 0.413008130081));
data.put("A37f", new Pair<>(0.611111111111, 0.352090032154));
data.put("A37fw", new Pair<>(0.511111111111, 0.516077170418));
data.put("A51f", new Pair<>(0.469444444444, 0.49593495935));
data.put("A51w", new Pair<>(0.722222222222, 0.486178861789));
data.put("A101", new Pair<>(0.947222222222, 0.946428571429));
data.put("A464BG", new Pair<>(0.425, 0.487912087912));
data.put("A466BG", new Pair<>(0.471875, 0.48431372549));
data.put("A521L", new Pair<>(0.515625, 0.523622047244));
data.put("A571VL", new Pair<>(0.490625, 0.544117647059));
data.put("A577VL", new Pair<>(0.547222222222, 0.630281690141));
data.put("A621BL", new Pair<>(0.45, 0.547967479675));
data.put("A846L", new Pair<>(0.603125, 0.454044117647));
data.put("A1601", new Pair<>(0.530555555556, 0.485530546624));
data.put("Action-X3", new Pair<>(0.927777777778, 0.447183098592));
data.put("AGM X1", new Pair<>(0.491666666667, 0.513821138211));
data.put("Alcatel_4060A", new Pair<>(0.584375, 0.533088235294));
data.put("Alcatel_5044C", new Pair<>(0.465625, 0.558608058608));
data.put("Alcatel_5054O", new Pair<>(0.586111111111, 0.232520325203));
data.put("Alcatel_5056O", new Pair<>(0.455555555556, 0.383739837398));
data.put("Alcatel_5098O", new Pair<>(0.466666666667, 0.608766233766));
data.put("Alcatel_6055U", new Pair<>(0.5, 0.505281690141));
data.put("Alcatel_6060C", new Pair<>(0.466666666667, 0.649647887324));
data.put("Alcatel_7049D", new Pair<>(0.463888888889, 0.564227642276));
data.put("ALCATEL ONE TOUCH 5036A", new Pair<>(0.61875, 0.730392156863));
data.put("ALCATEL ONE TOUCH 7041D", new Pair<>(0.414583333333, 0.487745098039));
data.put("ALCATEL ONE TOUCH 7047D", new Pair<>(0.333333333333, 0.416485900217));
data.put("ALCATEL ONETOUCH P310A", new Pair<>(0.555, 0.574132492114));
data.put("Alpha_X", new Pair<>(0.538888888889, 0.291666666667));
data.put("AP54", new Pair<>(0.571875, 0.560661764706));
data.put("Aqua", new Pair<>(0.471875, 0.0330882352941));
data.put("Aquaris E4", new Pair<>(0.45625, 0.505905511811));
data.put("Aquaris E5", new Pair<>(0.313888888889, 0.738211382114));
data.put("Aquaris E6", new Pair<>(0.297222222222, 0.617886178862));
data.put("Aquaris M5", new Pair<>(0.472222222222, 0.49512987013));
data.put("Aquaris M5.5", new Pair<>(0.452777777778, 0.491883116883));
data.put("Aquaris U", new Pair<>(0.434375, 0.525974025974));
data.put("Aquaris U Plus", new Pair<>(0.430555555556, 0.522727272727));
data.put("Aquaris V", new Pair<>(0.577777777778, 0.319805194805));
data.put("Aquaris X", new Pair<>(0.477777777778, 0.461038961039));
data.put("Aquaris X5 Plus", new Pair<>(0.561111111111, 0.258802816901));
data.put("Aquaris X Pro", new Pair<>(0.461111111111, 0.475649350649));
data.put("Archos 50c Platinum", new Pair<>(0.660194174757, 0.4243281471));
data.put("Archos Access 45 4G", new Pair<>(0.534375, 0.377510040161));
data.put("Archos Core 50 4G", new Pair<>(0.771844660194, 0.689393939394));
data.put("Armor_2", new Pair<>(0.541666666667, 0.541087231353));
data.put("Armor_X", new Pair<>(0.311111111111, 0.610632183908));
data.put("ASUS_A001", new Pair<>(0.924074074074, 0.711538461538));
data.put("ASUS_A002", new Pair<>(0.206310679612, 0.110169491525));
data.put("ASUS_A006", new Pair<>(0.759708737864, 0.0508474576271));
data.put("ASUS_A007", new Pair<>(0.725, 0.491883116883));
data.put("ASUS_A009", new Pair<>(0.445754716981, 0.492455418381));
data.put("ASUS_T00E", new Pair<>(0.459375, 0.646365422397));
data.put("ASUS_T00F", new Pair<>(0.541666666667, 0.546341463415));
data.put("ASUS_T00G", new Pair<>(0.6, 0.471544715447));
data.put("ASUS_T00I", new Pair<>(0.4875, 0.509842519685));
data.put("ASUS_T00J", new Pair<>(0.508333333333, 0.273170731707));
data.put("ASUS_T00K", new Pair<>(0.511111111111, 0.469918699187));
data.put("ASUS_T00N", new Pair<>(0.486111111111, 0.530864197531));
data.put("ASUS_T00Q", new Pair<>(0.584375, 0.529411764706));
data.put("ASUS_X00DD", new Pair<>(0.491666666667, 0.555194805195));
data.put("ASUS_X00ID", new Pair<>(0.508333333333, 0.49512987013));
data.put("ASUS_X00QD", new Pair<>(0.438888888889, 0.520710059172));
data.put("ASUS_X007D", new Pair<>(0.427777777778, 0.517857142857));
data.put("ASUS_X008", new Pair<>(0.508333333333, 0.0721830985915));
data.put("ASUS_X550", new Pair<>(0.486111111111, 0.52733686067));
data.put("ASUS_Z00VD", new Pair<>(0.425, 0.466666666667));
data.put("ASUS_Z002", new Pair<>(0.272222222222, 0.718699186992));
data.put("ASUS_Z007", new Pair<>(0.721875, 0.4375));
data.put("AX1065", new Pair<>(0.828125, 0.955882352941));
data.put("B5531", new Pair<>(0.438888888889, 0.572357723577));
data.put("Bay", new Pair<>(0.647222222222, 0.894308943089));
data.put("BERRY", new Pair<>(0.36875, 0.406593406593));
data.put("BL5000", new Pair<>(0.488888888889, 0.43661971831));
data.put("BL7000", new Pair<>(0.438888888889, 0.545454545455));
data.put("BL12000", new Pair<>(0.530555555556, 0.58024691358));
data.put("Blade A460", new Pair<>(0.565625, 0.556985294118));
data.put("Blade A510", new Pair<>(0.4, 0.555194805195));
data.put("BLADE A520", new Pair<>(0.602777777778, 0.397727272727));
data.put("Blade L2 Plus", new Pair<>(0.6875, 0.443014705882));
data.put("Blade L5", new Pair<>(0.534375, 0.564338235294));
data.put("BLADE L7", new Pair<>(0.515625, 0.587912087912));
data.put("Blade S6", new Pair<>(0.441666666667, 0.242276422764));
data.put("Blade V6", new Pair<>(0.463888888889, 0.482926829268));
data.put("Blade V6 Plus", new Pair<>(0.388888888889, 0.543831168831));
data.put("BLADE V8 SE", new Pair<>(0.758333333333, 0.902597402597));
data.put("BQru-4500", new Pair<>(0.35, 0.177655677656));
data.put("BV6000", new Pair<>(0.461111111111, 0.566558441558));
data.put("BV6000S", new Pair<>(0.505555555556, 0.482142857143));
data.put("BV7000", new Pair<>(0.75, 0.496753246753));
data.put("BV7000 Pro", new Pair<>(0.455555555556, 0.689935064935));
data.put("BV8000Pro", new Pair<>(0.494444444444, 0.49025974026));
data.put("BV9000Pro", new Pair<>(0.438888888889, 0.483024691358));
data.put("BV9000Pro-F", new Pair<>(0.455188679245, 0.470360824742));
data.put("C1", new Pair<>(0.658333333333, 0.522727272727));
data.put("C1+", new Pair<>(0.658333333333, 0.522727272727));
data.put("C4", new Pair<>(0.0555555555556, 0.456168831169));
data.put("C5", new Pair<>(0.41875, 0.526104417671));
data.put("C8", new Pair<>(0.51875, 0.492957746479));
data.put("C103", new Pair<>(0.543689320388, 0.58615819209));
data.put("C1904", new Pair<>(0.460416666667, 0.536290322581));
data.put("C1905", new Pair<>(0.4375, 0.502688172043));
data.put("C2004", new Pair<>(0.483333333333, 0.509408602151));
data.put("C2005", new Pair<>(0.497916666667, 0.786290322581));
data.put("C2105", new Pair<>(0.3625, 0.529569892473));
data.put("C2305", new Pair<>(0.296296296296, 0.310588235294));
data.put("C5302", new Pair<>(0.458333333333, 0.649911816578));
data.put("C5303", new Pair<>(0.490277777778, 0.721340388007));
data.put("C5502", new Pair<>(0.486111111111, 0.179894179894));
data.put("C5503", new Pair<>(0.405555555556, 0.26102292769));
data.put("C6502", new Pair<>(0.55, 0.493827160494));
data.put("C6503", new Pair<>(0.561111111111, 0.358024691358));
data.put("C6506", new Pair<>(0.502777777778, 0.499118165785));
data.put("C6530N", new Pair<>(0.5, 0.469631236443));
data.put("C6602", new Pair<>(0.511111111111, 0.291005291005));
data.put("C6603", new Pair<>(0.444444444444, 0.320987654321));
data.put("C6606", new Pair<>(0.577777777778, 0.487360376249));
data.put("C6725", new Pair<>(0.455555555556, 0.469918699187));
data.put("C6730", new Pair<>(0.313888888889, 0.635772357724));
data.put("C6740", new Pair<>(0.469444444444, 0.610229276896));
data.put("C6740N", new Pair<>(0.569444444444, 0.377425044092));
data.put("C6743", new Pair<>(0.463888888889, 0.458553791887));
data.put("C6802", new Pair<>(0.592592592593, 0.317925591883));
data.put("C6806", new Pair<>(0.503703703704, 0.811724915445));
data.put("C6833", new Pair<>(0.574074074074, 0.354002254791));
data.put("C6902", new Pair<>(0.480555555556, 0.322751322751));
data.put("C6903", new Pair<>(0.45, 0.275132275132));
data.put("C6906", new Pair<>(0.483333333333, 0.458553791887));
data.put("CHC-U23", new Pair<>(0.488888888889, 0.452032520325));
data.put("Che1-CL10", new Pair<>(0.438888888889, 0.473170731707));
data.put("Che1-L04", new Pair<>(0.419444444444, 0.536585365854));
data.put("Che2-L11", new Pair<>(0.452777777778, 0.274796747967));
data.put("CHM-U01", new Pair<>(0.65, 0.126829268293));
data.put("Classic", new Pair<>(0.5325, 0.486858573217));
data.put("COMIO S1", new Pair<>(0.422222222222, 0.480633802817));
data.put("cp3636a", new Pair<>(0.444444444444, 0.530844155844));
data.put("CPH1605", new Pair<>(0.502777777778, 0.104501607717));
data.put("CPH1607", new Pair<>(0.475, 0.480707395498));
data.put("CPH1609", new Pair<>(0.591666666667, 0.498392282958));
data.put("CPH1611", new Pair<>(0.558333333333, 0.0980707395498));
data.put("CPH1613", new Pair<>(0.669444444444, 0.567524115756));
data.put("CPH1701", new Pair<>(0.491666666667, 0.466237942122));
data.put("CPH1707", new Pair<>(0.636111111111, 0.16077170418));
data.put("CPH1717", new Pair<>(0.444444444444, 0.139871382637));
data.put("CPH1719", new Pair<>(0.463888888889, 0.585626911315));
data.put("CPH1723", new Pair<>(0.486111111111, 0.488603988604));
data.put("CPH1725", new Pair<>(0.605555555556, 0.495412844037));
data.put("CPH1727", new Pair<>(0.502777777778, 0.396024464832));
data.put("CPH1729", new Pair<>(0.455555555556, 0.39755351682));
data.put("CPH1801", new Pair<>(0.563888888889, 0.581993569132));
data.put("CPH1819", new Pair<>(0.544444444444, 0.327988338192));
data.put("CPH1821", new Pair<>(0.6, 0.752186588921));
data.put("CPH1859", new Pair<>(0.577777777778, 0.576452599388));
data.put("CPH1871", new Pair<>(0.602777777778, 0.489389920424));
data.put("CT50", new Pair<>(0.444444444444, 0.518699186992));
data.put("CUBOT X18", new Pair<>(0.533333333333, 0.143518518519));
data.put("Cynus T6", new Pair<>(0.552777777778, 0.0682926829268));
data.put("D504", new Pair<>(0.444444444444, 0.538732394366));
data.put("D2005", new Pair<>(0.415625, 0.545647558386));
data.put("D2203", new Pair<>(0.5375, 0.421370967742));
data.put("D2212", new Pair<>(0.459375, 0.379032258065));
data.put("D2302", new Pair<>(0.472222222222, 0.57671957672));
data.put("D2303", new Pair<>(0.527777777778, 0.486772486772));
data.put("D2305", new Pair<>(0.477777777778, 0.352733686067));
data.put("D2306", new Pair<>(0.447222222222, 0.227513227513));
data.put("D2403", new Pair<>(0.469444444444, 0.442680776014));
data.put("D2406", new Pair<>(0.466666666667, 0.26278659612));
data.put("D2502", new Pair<>(0.495833333333, 0.342307692308));
data.put("D2533", new Pair<>(0.533333333333, 0.421794871795));
data.put("D5103", new Pair<>(0.591666666667, 0.218694885362));
data.put("D5106", new Pair<>(0.419444444444, 0.259259259259));
data.put("D5303", new Pair<>(0.591666666667, 0.508974358974));
data.put("D5306", new Pair<>(0.460416666667, 0.197435897436));
data.put("D5322", new Pair<>(0.55625, 0.462820512821));
data.put("D5503", new Pair<>(0.488888888889, 0.365079365079));
data.put("D5788", new Pair<>(0.886111111111, 0.582010582011));
data.put("D5803", new Pair<>(0.463888888889, 0.383802816901));
data.put("D5833", new Pair<>(0.413888888889, 0.306878306878));
data.put("D6502", new Pair<>(0.5, 0.299823633157));
data.put("D6503", new Pair<>(0.477777777778, 0.343309859155));
data.put("D6543", new Pair<>(0.666666666667, 0.677248677249));
data.put("D6603", new Pair<>(0.452777777778, 0.278169014085));
data.put("D6616", new Pair<>(0.544444444444, 0.3139329806));
data.put("D6633", new Pair<>(0.491666666667, 0.225352112676));
data.put("D6646", new Pair<>(0.461111111111, 0.422535211268));
data.put("D6653", new Pair<>(0.583333333333, 0.197530864198));
data.put("D6683", new Pair<>(0.225, 0.268077601411));
data.put("D6708", new Pair<>(0.463888888889, 0.299823633157));
data.put("DARKSIDE", new Pair<>(0.552777777778, 0.442276422764));
data.put("Discovery II Mini", new Pair<>(0.446875, 0.431985294118));
data.put("DM-01G", new Pair<>(0.722222222222, 0.493891797557));
data.put("DROID RAZR HD", new Pair<>(0.308333333333, 0.721340388007));
data.put("DROID RAZR M", new Pair<>(0.608333333333, 0.42328042328));
data.put("E500", new Pair<>(0.641666666667, 0.549868766404));
data.put("E505", new Pair<>(0.921875, 0.685661764706));
data.put("E506", new Pair<>(0.4875, 0.520220588235));
data.put("E2006", new Pair<>(0.541666666667, 0.409171075838));
data.put("E2053", new Pair<>(0.152777777778, 0.492063492063));
data.put("E2104", new Pair<>(0.525, 0.460207612457));
data.put("E2105", new Pair<>(0.847222222222, 0.721453287197));
data.put("E2115", new Pair<>(0.402777777778, 0.349480968858));
data.put("E2124", new Pair<>(0.508333333333, 0.43598615917));
data.put("E2303", new Pair<>(0.438888888889, 0.345679012346));
data.put("E2306", new Pair<>(0.463888888889, 0.279929577465));
data.put("E2312", new Pair<>(0.466666666667, 0.197530864198));
data.put("E2333", new Pair<>(0.430555555556, 0.380952380952));
data.put("E2353", new Pair<>(0.402777777778, 0.645502645503));
data.put("E2363", new Pair<>(0.5, 0.462081128748));
data.put("E5303", new Pair<>(0.758333333333, 0.656084656085));
data.put("E5306", new Pair<>(0.455555555556, 0.452464788732));
data.put("E5333", new Pair<>(0.516666666667, 0.146384479718));
data.put("E5353", new Pair<>(0.491666666667, 0.475352112676));
data.put("E5363", new Pair<>(0.45, 0.424295774648));
data.put("E5506", new Pair<>(0.463888888889, 0.342151675485));
data.put("E5533", new Pair<>(0.458333333333, 0.36684303351));
data.put("E5553", new Pair<>(0.747222222222, 0.579225352113));
data.put("E5563", new Pair<>(0.45, 0.43485915493));
data.put("E5603", new Pair<>(0.508333333333, 0.380281690141));
data.put("E5606", new Pair<>(0.480555555556, 0.406690140845));
data.put("E5633", new Pair<>(0.45, 0.397887323944));
data.put("E5653", new Pair<>(0.461111111111, 0.352112676056));
data.put("E5663", new Pair<>(0.6, 0.47442680776));
data.put("E5803", new Pair<>(0.419444444444, 0.390845070423));
data.put("E5823", new Pair<>(0.458333333333, 0.403169014085));
data.put("E6533", new Pair<>(0.45, 0.290492957746));
data.put("E6553", new Pair<>(0.483333333333, 0.24823943662));