package csdk.glucustomersupport.util; import java.util.HashMap; import java.util.Map; /* loaded from: classes4.dex */ public class StringStore { private static final String gcsClassName = "csdk.glucentralservices.kvstore.StringStore"; private static final String getMethodName = "get"; private static final Map keys = new HashMap() { // from class: csdk.glucustomersupport.util.StringStore.1 { put(Key.ANALYTICS_ID, "AnalyticsID"); put(Key.LOCATION_ISO_CODE, "LocationISOCode"); put(Key.IDENTITY_PIN, "IdentityPin"); put(Key.UNDER_AGE_USER, "UnderAge"); put(Key.PREEXISTING_UNDER_AGE_USER, "PreExistingUnderAge"); } }; private static final String setMethodName = "set"; public enum Key { ANALYTICS_ID, LOCATION_ISO_CODE, IDENTITY_PIN, UNDER_AGE_USER, PREEXISTING_UNDER_AGE_USER } private static void log(String str) { } public static void init() { set("*init", "glucustomersupport"); } public static void destroy() { set("*destroy", "glucustomersupport"); } private static String get(String str) { try { return (String) csdk.glucentralservices.kvstore.StringStore.class.getMethod(getMethodName, String.class).invoke(null, str); } catch (ClassNotFoundException | NoSuchMethodException unused) { log("Can't find GCS"); return null; } catch (Exception e) { e.printStackTrace(); return null; } } private static void set(String str, String str2) { try { csdk.glucentralservices.kvstore.StringStore.class.getMethod(setMethodName, String.class, String.class).invoke(null, str, str2); } catch (ClassNotFoundException | NoSuchMethodException unused) { log("Can't find GCS"); } catch (Exception e) { e.printStackTrace(); } } public static String get(Key key) { Map map = keys; if (!map.containsKey(key)) { log("Invalid Key: " + key); return null; } return get(map.get(key)); } public static String getOrDefault(Key key, String str) { String str2 = get(key); return (str2 == null || str2.isEmpty()) ? str : str2; } public static void set(Key key, String str) { Map map = keys; if (!map.containsKey(key)) { log("Invalid Key: " + key); return; } set(map.get(key), str); } }