package cn.jiguang.ao; import android.content.Context; import android.content.SharedPreferences; import cn.jiguang.al.c; import cn.jiguang.am.a; import cn.jiguang.an.b; public class e { public static final String a = j.a("MDEwMjAzMDQwNTA2MDcwOA"); private static final String b = j.a("LmV4dENvbmZpZw=="); private static final String c = j.a("ZXh0LQ=="); private static SharedPreferences d; private static final String e = j.a("MTJlNDU2N2c5MWszNHI2Nw=="); public static String a(Context context, int i, String str) { if (d == null) { d = context.getSharedPreferences(b, 0); } SharedPreferences sharedPreferences = d; String string = sharedPreferences.getString(c + str + "-" + i, ""); StringBuilder sb = new StringBuilder(); sb.append("g1:"); sb.append(string); b.b("JC", sb.toString()); if (!"".equals(string)) { try { string = new String(i.a(string, e, a)); } catch (Exception unused) { b.b("JC", "decrypt plugin failed"); } } b.b("JC", "g2:" + string); return string; } public static void a(Context context, int i, String str, String str2, boolean z) { int i2; if (z) { i2 = c.a().a(context, i); cn.jiguang.dy.c.a().a(context, i, i2, a.j, 0, null); } else { i2 = -1; } if (d == null) { d = context.getSharedPreferences(b, 0); } try { b.b("JC", "s1:" + str2); str2 = i.a(str2.getBytes(), e, a); b.b("JC", "s2:" + str2); } catch (Throwable th) { b.g("JC", "aesEncrypt error , msg :" + th.getMessage()); if (z) { cn.jiguang.dy.c.a().a(context, i, i2, a.j, 2, th.getMessage()); } } SharedPreferences.Editor edit = d.edit(); edit.putString(c + str + "-" + i, str2); edit.commit(); if (z) { cn.jiguang.dy.c.a().a(context, i, i2, a.j, 1, null); cn.jiguang.dy.c.a().a(context, i, i2, a.f, 1, null); } } }