// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.geocities.com/kpdus/jad.html // Decompiler options: braces fieldsfirst space lnc package com.olio.communication.bluetooth.channel_messages; import android.content.ContentResolver; import android.content.ContentValues; import android.database.Cursor; import android.net.Uri; import com.olio.communication.notifications.NotificationFilters; import com.olio.communication.notifications.Utilities; import com.olio.olios.model.record.DatabaseRecord; import com.olio.olios.model.record.DatabaseRecordMixins; import com.olio.util.ALog; import java.io.Serializable; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.Arrays; import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import org.apache.commons.codec.binary.Hex; import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; public class ANCSNotification implements DatabaseRecord, Serializable { static final class AppCategory extends Enum { private static final AppCategory $VALUES[]; public static final AppCategory UNKNOWN; public static AppCategory valueOf(String s) { return (AppCategory)Enum.valueOf(com/olio/communication/bluetooth/channel_messages/ANCSNotification$AppCategory, s); } public static AppCategory[] values() { return (AppCategory[])$VALUES.clone(); } static { UNKNOWN = new AppCategory("UNKNOWN", 0); $VALUES = (new AppCategory[] { UNKNOWN }); } private AppCategory(String s, int i) { super(s, i); } } public static final class AppleNotificationCenterStatus extends Enum { private static final AppleNotificationCenterStatus $VALUES[]; public static final AppleNotificationCenterStatus removed; public static final AppleNotificationCenterStatus visible; public static AppleNotificationCenterStatus valueOf(String s) { return (AppleNotificationCenterStatus)Enum.valueOf(com/olio/communication/bluetooth/channel_messages/ANCSNotification$AppleNotificationCenterStatus, s); } public static AppleNotificationCenterStatus[] values() { return (AppleNotificationCenterStatus[])$VALUES.clone(); } static { visible = new AppleNotificationCenterStatus("visible", 0); removed = new AppleNotificationCenterStatus("removed", 1); $VALUES = (new AppleNotificationCenterStatus[] { visible, removed }); } private AppleNotificationCenterStatus(String s, int i) { super(s, i); } } static final class CommandId extends Enum { private static final CommandId $VALUES[]; public static final CommandId App; public static final CommandId Notification; public static CommandId valueOf(String s) { return (CommandId)Enum.valueOf(com/olio/communication/bluetooth/channel_messages/ANCSNotification$CommandId, s); } public static CommandId[] values() { return (CommandId[])$VALUES.clone(); } static { Notification = new CommandId("Notification", 0); App = new CommandId("App", 1); $VALUES = (new CommandId[] { Notification, App }); } private CommandId(String s, int i) { super(s, i); } } static final class NotificationAttributeId extends Enum { private static final NotificationAttributeId $VALUES[]; public static final NotificationAttributeId AppIdentifier; public static final NotificationAttributeId Date; public static final NotificationAttributeId Message; public static final NotificationAttributeId MessageSize; public static final NotificationAttributeId NegativeActionLabel; public static final NotificationAttributeId PositiveActionLabel; public static final NotificationAttributeId Subtitle; public static final NotificationAttributeId Title; public static NotificationAttributeId valueOf(String s) { return (NotificationAttributeId)Enum.valueOf(com/olio/communication/bluetooth/channel_messages/ANCSNotification$NotificationAttributeId, s); } public static NotificationAttributeId[] values() { return (NotificationAttributeId[])$VALUES.clone(); } static { AppIdentifier = new NotificationAttributeId("AppIdentifier", 0); Title = new NotificationAttributeId("Title", 1); Subtitle = new NotificationAttributeId("Subtitle", 2); Message = new NotificationAttributeId("Message", 3); MessageSize = new NotificationAttributeId("MessageSize", 4); Date = new NotificationAttributeId("Date", 5); PositiveActionLabel = new NotificationAttributeId("PositiveActionLabel", 6); NegativeActionLabel = new NotificationAttributeId("NegativeActionLabel", 7); $VALUES = (new NotificationAttributeId[] { AppIdentifier, Title, Subtitle, Message, MessageSize, Date, PositiveActionLabel, NegativeActionLabel }); } private NotificationAttributeId(String s, int i) { super(s, i); } } private class NotificationField { public int mEnd; public NotificationAttributeId mNotificationAttribute; public int mStart; final ANCSNotification this$0; public NotificationField(NotificationAttributeId notificationattributeid, int i, int j) { this$0 = ANCSNotification.this; super(); mNotificationAttribute = notificationattributeid; mStart = i; mEnd = j; } } public static String ANCS_ID = "ancs_id"; public static String APP_IDENTIFIER = "app_identifier"; private static final byte APP_IDENTIFIER_ARRAY[] = Utilities.hexStringToByteArray("00"); static final Byte APP_IDENTIFIER_ID; public static String CATEGORY = "category"; static final byte COMMAND_APP_ATTRIBUTES_ID = 1; private static final int COMMAND_COUNT = 8; private static final byte COMMAND_ID_ARRAY[] = Utilities.hexStringToByteArray("00"); static final byte COMMAND_NOTIFICATION_ATTRIBUTES_ID = 0; public static String DATE = "date"; private static final byte DATE_ARRAY[] = Utilities.hexStringToByteArray("05"); static final Byte DATE_ID; public static String ID_INTEGER = "id_integer"; public static String MESSAGE = "message"; private static final byte MESSAGE_ARRAY[] = Utilities.hexStringToByteArray("03ffff"); static final Byte MESSAGE_ID; public static String MESSAGE_SIZE = "message_size"; private static final byte MESSAGE_SIZE_ARRAY[] = Utilities.hexStringToByteArray("04"); static final Byte MESSAGE_SIZE_ID; public static String NEGATIVE_ACTION_LABEL = "negative_action_label"; private static final byte NEGATIVE_ACTION_LABEL_ARRAY[] = Utilities.hexStringToByteArray("07"); static final Byte NEGATIVE_ACTION_LABEL_ID; private static final int PARTIAL_REQUEST_COMMAND_COUNT = 2; public static String POSITIVE_ACTION_LABEL = "positive_action_label"; private static final byte POSITIVE_ACTION_LABEL_ARRAY[] = Utilities.hexStringToByteArray("06"); static final Byte POSITIVE_ACTION_LABEL_ID; public static String SUBTITLE = "subtitle"; private static final byte SUBTITLE_ARRAY[] = Utilities.hexStringToByteArray("02ffff"); static final Byte SUBTITLE_ID; public static final String TABLE_NAME = "ancs_notifications"; public static String TITLE = "title"; private static final byte TITLE_ARRAY[] = Utilities.hexStringToByteArray("01ffff"); static final Byte TITLE_ID; private static String columnProjection[]; private static com.olio.olios.model.record.DatabaseRecord.DatabaseRecordFactory databaseRecordFactory = new com.olio.olios.model.record.DatabaseRecord.DatabaseRecordFactory() { public DatabaseRecord getRecordInstance() { return new ANCSNotification(); } }; static final Map notificationAttributesMap; private static final List recordFields; private static final long serialVersionUID = 0x1140bfddL; private long ancsDate; private byte ancsId[]; private String appIdentifier; private com.olio.communication.notifications.NotificationFilters.Category category; private int databaseId; private int idInteger; private AppleNotificationCenterStatus mANCStatus; private byte mCompleteMessage[]; private String message; private String messageSize; private String negativeActionLabel; private String positiveActionLabel; private String subtitle; private String title; public ANCSNotification() { mCompleteMessage = new byte[0]; } public ANCSNotification(byte abyte0[]) { mCompleteMessage = new byte[0]; setANCSId(abyte0); setIdInteger(Integer.valueOf(ByteBuffer.wrap(getANCSId()).order(ByteOrder.LITTLE_ENDIAN).getInt())); } private static byte[] byteArrayFromShort(short word0) { ByteBuffer bytebuffer = ByteBuffer.allocate(2); bytebuffer.order(ByteOrder.LITTLE_ENDIAN); bytebuffer.putShort(word0); return bytebuffer.array(); } public static int byteToUnsignedInt(byte byte0) { return byte0 & 0xff; } public static void clearNotificationsWithInvalidIds(ContentResolver contentresolver) { Cursor cursor = null; Cursor cursor1 = contentresolver.query(DatabaseRecordMixins.baseUriForTable(staticFactory()), staticColumnProjection(), (new StringBuilder()).append(ID_INTEGER).append(" = ? ").toString(), new String[] { "-1" }, null); cursor = cursor1; Iterator iterator = DatabaseRecordMixins.recordsFromCursor(cursor1, staticFactory()).iterator(); _L2: cursor = cursor1; if (!iterator.hasNext()) { break; /* Loop/switch isn't completed */ } cursor = cursor1; com.olio.communication.notifications.NotificationContract.Notifications.delete(contentresolver, ((ANCSNotification)iterator.next()).hashedId()); if (true) goto _L2; else goto _L1 contentresolver; if (cursor != null) { cursor.close(); } throw contentresolver; _L1: if (cursor1 != null) { cursor1.close(); } contentresolver.delete(DatabaseRecordMixins.baseUriForTable(staticFactory()), (new StringBuilder()).append(ID_INTEGER).append(" = ? ").toString(), new String[] { "-1" }); return; } public static void conditionalAddANCSNotification(ANCSNotification ancsnotification, ContentResolver contentresolver) { ContentValues contentvalues; Uri uri; int i; uri = DatabaseRecordMixins.baseUriForTable(staticFactory()); String s3 = ancsnotification.getAppName(); long l = ancsnotification.getANCSDate(); String s2 = ancsnotification.getTitle(); String s1 = ancsnotification.getSubtitle(); String s = ancsnotification.getMessage(); contentvalues = DatabaseRecordMixins.valuesForRecord(ancsnotification); i = contentresolver.update(uri, contentvalues, (new StringBuilder()).append(APP_IDENTIFIER).append(" = ? AND ").append(DATE).append(" = ? AND ").append(TITLE).append(" = ? AND ").append(SUBTITLE).append(" = ? AND ").append(MESSAGE).append(" = ? ").toString(), new String[] { s3, String.valueOf(l), s2, s1, s }); if (i != 0) { break MISSING_BLOCK_LABEL_165; } contentresolver.insert(uri, contentvalues); if (i <= 1) { break MISSING_BLOCK_LABEL_228; } ALog.e("ANCSNotification found %s rows with same values for APP_IDENTIFIER(%s) DATE(%s) TITLE(%s) SUBTITLE(%s) MESSAGE(%s)", new Object[] { Integer.valueOf(i), ancsnotification.getAppName(), String.valueOf(ancsnotification.getANCSDate()), ancsnotification.getTitle(), ancsnotification.getSubtitle(), ancsnotification.getMessage() }); if (false) { throw new NullPointerException(); } else { return; } ancsnotification; if (false) { throw new NullPointerException(); } else { throw ancsnotification; } } public static void conditionalRemoveNotification(ANCSNotification ancsnotification, ContentResolver contentresolver) { contentresolver.delete(DatabaseRecordMixins.baseUriForTable(staticFactory()), (new StringBuilder()).append(APP_IDENTIFIER).append(" = ? AND ").append(TITLE).append(" = ? AND ").append(SUBTITLE).append(" = ? AND ").append(MESSAGE).append(" = ? ").toString(), new String[] { ancsnotification.getAppName(), ancsnotification.getTitle(), ancsnotification.getSubtitle(), ancsnotification.getMessage() }); } public static Cursor cursorForCategory(ContentResolver contentresolver, com.olio.communication.notifications.NotificationFilters.Category category1) { Uri uri = DatabaseRecordMixins.baseUriForTable(staticFactory()); String s = ID_INTEGER; String s1 = (new StringBuilder()).append(CATEGORY).append(" = ? ").toString(); category1 = Integer.toString(category1.ANCSValue); String s2 = (new StringBuilder()).append(DATE).append(" DESC").toString(); return contentresolver.query(uri, new String[] { s }, s1, new String[] { category1 }, s2); } private static byte[] encodedANCSArrayForAttributeAndValue(byte byte0, String s) { byte abyte0[] = s.getBytes(); ByteBuffer bytebuffer = ByteBuffer.allocate(abyte0.length + 3); bytebuffer.put(byte0); bytebuffer.put(byteArrayFromShort((short)s.length())); bytebuffer.put(abyte0); return bytebuffer.array(); } public static ANCSNotification findLastNotificationsForCategory(ContentResolver contentresolver, com.olio.communication.notifications.NotificationFilters.Category category1) { com.olio.communication.notifications.NotificationFilters.Category category2; ANCSNotification ancsnotification; ancsnotification = null; category2 = ancsnotification; Uri uri = DatabaseRecordMixins.baseUriForTable(staticFactory()); category2 = ancsnotification; String as[] = staticColumnProjection(); category2 = ancsnotification; String s = (new StringBuilder()).append(CATEGORY).append(" = ? ").toString(); category2 = ancsnotification; category1 = Integer.toString(category1.ANCSValue); category2 = ancsnotification; String s1 = (new StringBuilder()).append(DATE).append(" DESC").toString(); category2 = ancsnotification; category1 = contentresolver.query(uri, as, s, new String[] { category1 }, s1); if (category1 == null) { break MISSING_BLOCK_LABEL_223; } category2 = category1; if (category1.getCount() <= 0) { break MISSING_BLOCK_LABEL_223; } category2 = category1; category1.moveToFirst(); category2 = category1; ancsnotification = new ANCSNotification(); category2 = category1; contentresolver = recordFields.iterator(); _L2: category2 = category1; if (!contentresolver.hasNext()) { break; /* Loop/switch isn't completed */ } category2 = category1; ((com.olio.olios.model.record.DatabaseRecord.RecordField)contentresolver.next()).assignFromCursor(ancsnotification, category1); if (true) goto _L2; else goto _L1 contentresolver; category2 = category1; ALog.e("Attempting to cast to the wrong object type", contentresolver, new Object[0]); if (category1 != null) { category1.close(); } contentresolver = null; _L4: return contentresolver; _L1: contentresolver = ancsnotification; if (category1 == null) goto _L4; else goto _L3 _L3: category1.close(); return ancsnotification; if (category1 != null) { category1.close(); } return null; contentresolver; if (category2 != null) { category2.close(); } throw contentresolver; } public static ANCSNotification firstNotificationFromUri(Uri uri, ContentResolver contentresolver) { return (ANCSNotification)DatabaseRecordMixins.firstRecordFromUri(uri, staticFactory(), contentresolver); } public static byte[] getNotificationAttributes(byte abyte0[]) { return Utilities.concatenateArrays(new byte[][] { COMMAND_ID_ARRAY, abyte0, APP_IDENTIFIER_ARRAY, TITLE_ARRAY, SUBTITLE_ARRAY, MESSAGE_ARRAY, MESSAGE_SIZE_ARRAY, DATE_ARRAY, POSITIVE_ACTION_LABEL_ARRAY, NEGATIVE_ACTION_LABEL_ARRAY }); } public static byte[] getPartialRequestNotificationAttributes(byte abyte0[]) { return Utilities.concatenateArrays(new byte[][] { COMMAND_ID_ARRAY, abyte0, MESSAGE_SIZE_ARRAY, DATE_ARRAY }); } public static boolean hasCompleteAttributeSet(byte abyte0[]) { return hasCompleteAttributeSet(abyte0, 8); } private static boolean hasCompleteAttributeSet(byte abyte0[], int i) { int j; int k; k = 5; j = 0; _L4: if (k + 2 < abyte0.length) goto _L2; else goto _L1 _L1: return false; _L2: int l; int i1; byte byte0 = abyte0[k + 2]; byte byte1 = abyte0[k + 1]; l = k + ((byteToUnsignedInt(byte0) << 8) + byteToUnsignedInt(byte1)) + 3; k = l; i1 = j + 1; if (l >= abyte0.length) { break; /* Loop/switch isn't completed */ } j = i1; if (i1 < i) goto _L4; else goto _L3 _L3: if (l > abyte0.length || i1 != i) goto _L1; else goto _L5 _L5: return true; } public static boolean hasCompletePartialRequestAttributeSet(byte abyte0[]) { return hasCompleteAttributeSet(abyte0, 2); } public static Integer notificationIdForDataResponse(byte abyte0[]) { Integer integer = Integer.valueOf(0); for (int i = 0; i < abyte0.length; i++) { int j = Byte.valueOf(abyte0[i]).intValue(); integer = Integer.valueOf(integer.intValue() + (j << i * 8)); } return integer; } public static List notifications(ContentResolver contentresolver) { return DatabaseRecordMixins.allRecordsFromUri(staticFactory().getRecordInstance().tableUri(), staticFactory(), contentresolver); } public static List notificationsForANCSId(int i, ContentResolver contentresolver) { ContentResolver contentresolver1 = null; contentresolver = contentresolver.query(DatabaseRecordMixins.baseUriForTable(staticFactory()), staticColumnProjection(), (new StringBuilder()).append(ID_INTEGER).append(" = ? ").toString(), new String[] { Integer.toString(i) }, null); contentresolver1 = contentresolver; List list = DatabaseRecordMixins.recordsFromCursor(contentresolver, staticFactory()); if (contentresolver != null) { contentresolver.close(); } return list; contentresolver; if (contentresolver1 != null) { contentresolver1.close(); } throw contentresolver; } private NotificationField parseField(byte abyte0[], int i) { byte byte0 = abyte0[i]; byte byte1 = abyte0[i + 2]; byte byte2 = abyte0[i + 1]; int j = byteToUnsignedInt(byte1); int k = byteToUnsignedInt(byte2); return new NotificationField((NotificationAttributeId)notificationAttributesMap.get(Byte.valueOf(byte0)), i + 3, i + ((j << 8) + k) + 3); } public static void removeNotification(Integer integer, ContentResolver contentresolver) { if (integer == null) { return; } else { ALog.d("ANCSNotification, removeNotification deleted %d rows", new Object[] { Integer.valueOf(contentresolver.delete(DatabaseRecordMixins.baseUriForTable(staticFactory()), (new StringBuilder()).append(ID_INTEGER).append(" = ?").toString(), new String[] { Integer.toString(integer.intValue()) })) }); return; } } public static void resetAllNotificationIds(ContentResolver contentresolver) { ContentValues contentvalues = new ContentValues(); contentvalues.put(ID_INTEGER, Integer.valueOf(-1)); contentresolver.update(DatabaseRecordMixins.baseUriForTable(staticFactory()), contentvalues, null, null); } public static String[] staticColumnProjection() { return columnProjection; } public static com.olio.olios.model.record.DatabaseRecord.DatabaseRecordFactory staticFactory() { return databaseRecordFactory; } public static boolean updateId(ANCSNotification ancsnotification, ContentResolver contentresolver) { ALog.d("RequestManager ANCSRequests: updateID called. Values: %s, %s", new Object[] { Long.valueOf(ancsnotification.getANCSDate()), ancsnotification.getMessageSize() }); if (ancsnotification.getMessageSize() != null) goto _L2; else goto _L1 _L1: boolean flag; ALog.e("RequestManager ANCSRequests: the messageSize is null", new Object[0]); flag = true; _L4: return flag; _L2: Cursor cursor; Cursor cursor1; cursor1 = null; cursor = cursor1; Uri uri = DatabaseRecordMixins.baseUriForTable(staticFactory()); cursor = cursor1; Object obj = (new StringBuilder()).append(DATE).append(" = ? AND ").append(MESSAGE_SIZE).append(" = ? ").toString(); cursor = cursor1; String s = Long.toString(ancsnotification.getANCSDate()); cursor = cursor1; String s1 = ancsnotification.getMessageSize(); cursor = cursor1; cursor1 = contentresolver.query(uri, new String[] { "_id" }, ((String) (obj)), new String[] { s, s1 }, null, null); if (cursor1 == null) { break MISSING_BLOCK_LABEL_172; } cursor = cursor1; if (cursor1.getCount() == 1) { break; /* Loop/switch isn't completed */ } cursor = cursor1; ALog.d("RequestManager ANCSRequests: cursor is null, count is zero or count is greater than one", new Object[0]); flag = false; if (cursor1 != null) { cursor1.close(); return false; } if (true) goto _L4; else goto _L3 _L3: cursor = cursor1; cursor1.moveToFirst(); cursor = cursor1; int i = cursor1.getInt(0); cursor = cursor1; obj = new ContentValues(); cursor = cursor1; ((ContentValues) (obj)).put(ANCS_ID, ancsnotification.getANCSId()); cursor = cursor1; ((ContentValues) (obj)).put(ID_INTEGER, ancsnotification.getIdInteger()); cursor = cursor1; i = contentresolver.update(uri, ((ContentValues) (obj)), "_id = ?", new String[] { Integer.toString(i) }); if (i != 1) { break; /* Loop/switch isn't completed */ } cursor = cursor1; ALog.d("Successfully updated one row", new Object[0]); flag = true; if (cursor1 != null) { cursor1.close(); return true; } if (true) goto _L4; else goto _L5 _L5: cursor = cursor1; ALog.e("Updated rows: %d, only should have updated one row", new Object[] { Integer.valueOf(i) }); flag = false; if (cursor1 == null) goto _L4; else goto _L6 _L6: cursor1.close(); return false; ancsnotification; if (cursor != null) { cursor.close(); } throw ancsnotification; } public String[] columnProjection() { return staticColumnProjection(); } public List columns(Set set) { LinkedList linkedlist = new LinkedList(); Iterator iterator = recordFields().iterator(); do { if (!iterator.hasNext()) { break; } com.olio.olios.model.record.DatabaseRecord.RecordField recordfield = (com.olio.olios.model.record.DatabaseRecord.RecordField)iterator.next(); if (set.contains(recordfield.columnName())) { linkedlist.add(recordfield); } } while (true); return linkedlist; } public String defaultOrderBy() { return (new StringBuilder()).append(DATE).append(" DESC ").toString(); } public byte[] encode() { ByteBuffer bytebuffer = ByteBuffer.allocate(2048); bytebuffer.order(ByteOrder.LITTLE_ENDIAN); bytebuffer.put((byte)0); bytebuffer.putInt(getIdInteger().intValue()); byte abyte0[] = encodedANCSArrayForAttributeAndValue(APP_IDENTIFIER_ID.byteValue(), getAppName()); bytebuffer.put(abyte0); int i = abyte0.length; bytebuffer.put(encodedANCSArrayForAttributeAndValue(TITLE_ID.byteValue(), getTitle())); bytebuffer.put(encodedANCSArrayForAttributeAndValue(SUBTITLE_ID.byteValue(), getSubtitle())); bytebuffer.put(encodedANCSArrayForAttributeAndValue(MESSAGE_ID.byteValue(), getMessage())); bytebuffer.put(encodedANCSArrayForAttributeAndValue(MESSAGE_SIZE_ID.byteValue(), getMessageSize())); bytebuffer.put(encodedANCSArrayForAttributeAndValue(DATE_ID.byteValue(), Utilities.formatANCSDate(new Date(getANCSDate())))); bytebuffer.put(encodedANCSArrayForAttributeAndValue(POSITIVE_ACTION_LABEL_ID.byteValue(), getPositiveActionLabel())); bytebuffer.put(encodedANCSArrayForAttributeAndValue(NEGATIVE_ACTION_LABEL_ID.byteValue(), getNegativeActionLabel())); return bytebuffer.array(); } public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } else { obj = (ANCSNotification)obj; return (new EqualsBuilder()).append(idInteger, ((ANCSNotification) (obj)).idInteger).append(appIdentifier, ((ANCSNotification) (obj)).appIdentifier).append(title, ((ANCSNotification) (obj)).title).append(subtitle, ((ANCSNotification) (obj)).subtitle).append(message, ((ANCSNotification) (obj)).message).append(messageSize, ((ANCSNotification) (obj)).messageSize).append(ancsDate, ((ANCSNotification) (obj)).ancsDate).append(category, ((ANCSNotification) (obj)).category).append(getPositiveActionLabel(), ((ANCSNotification) (obj)).getPositiveActionLabel()).append(getNegativeActionLabel(), ((ANCSNotification) (obj)).getNegativeActionLabel()).append(mANCStatus, ((ANCSNotification) (obj)).mANCStatus).isEquals(); } } public com.olio.olios.model.record.DatabaseRecord.DatabaseRecordFactory factory() { return staticFactory(); } public long getANCSDate() { return ancsDate; } public byte[] getANCSId() { if (ancsId == null) { return ByteBuffer.wrap(new byte[4]).putInt(0).array(); } else { return ancsId; } } public AppleNotificationCenterStatus getANCSStatus() { return mANCStatus; } public String getAppName() { if (appIdentifier == null) { return ""; } else { return appIdentifier; } } public com.olio.communication.notifications.NotificationFilters.Category getCategory() { return category; } public int getDatabaseId() { return databaseId; } public Integer getIdInteger() { return Integer.valueOf(idInteger); } public String getMessage() { if (message == null) { return ""; } else { return message; } } public String getMessageSize() { return messageSize; } public String getNegativeActionLabel() { if (negativeActionLabel == null) { return ""; } else { return negativeActionLabel; } } public String getPositiveActionLabel() { if (positiveActionLabel == null) { return ""; } else { return positiveActionLabel; } } public String getSubtitle() { if (subtitle == null) { return ""; } else { return subtitle; } } public String getTitle() { if (title == null) { return ""; } else { return title; } } public Cursor handleCustomUriQuery(Uri uri, String as[], String s, String as1[], String s1) { return null; } public boolean hasCompleteAttributeSet() { return hasCompleteAttributeSet(mCompleteMessage); } public boolean hasCompletePartialRequestAttributeSet() { return hasCompletePartialRequestAttributeSet(mCompleteMessage); } public int hashCode() { return (new HashCodeBuilder(17, 37)).append(appIdentifier).append(title).append(subtitle).append(message).append(messageSize).append(ancsDate).append(category).append(idInteger).append(getPositiveActionLabel()).append(getNegativeActionLabel()).append(mANCStatus).toHashCode(); } public String hashedId() { return new String(Hex.encodeHex(DigestUtils.md5((new StringBuilder()).append(appIdentifier).append(title).append(subtitle).append(message).append(ancsDate).toString()))); } public String indexColumn() { return "_id"; } public void parseStoredMessage(int i) { int j; int k; setANCSId(Arrays.copyOfRange(mCompleteMessage, 1, 5)); k = 5; j = 0; _L11: NotificationField notificationfield; Object obj; notificationfield = parseField(mCompleteMessage, k); k = notificationfield.mEnd; obj = new String(Arrays.copyOfRange(mCompleteMessage, notificationfield.mStart, notificationfield.mEnd)); static class _cls14 { static final int $SwitchMap$com$olio$communication$bluetooth$channel_messages$ANCSNotification$NotificationAttributeId[]; static { $SwitchMap$com$olio$communication$bluetooth$channel_messages$ANCSNotification$NotificationAttributeId = new int[NotificationAttributeId.values().length]; try { $SwitchMap$com$olio$communication$bluetooth$channel_messages$ANCSNotification$NotificationAttributeId[NotificationAttributeId.AppIdentifier.ordinal()] = 1; } catch (NoSuchFieldError nosuchfielderror7) { } try { $SwitchMap$com$olio$communication$bluetooth$channel_messages$ANCSNotification$NotificationAttributeId[NotificationAttributeId.Title.ordinal()] = 2; } catch (NoSuchFieldError nosuchfielderror6) { } try { $SwitchMap$com$olio$communication$bluetooth$channel_messages$ANCSNotification$NotificationAttributeId[NotificationAttributeId.Subtitle.ordinal()] = 3; } catch (NoSuchFieldError nosuchfielderror5) { } try { $SwitchMap$com$olio$communication$bluetooth$channel_messages$ANCSNotification$NotificationAttributeId[NotificationAttributeId.Message.ordinal()] = 4; } catch (NoSuchFieldError nosuchfielderror4) { } try { $SwitchMap$com$olio$communication$bluetooth$channel_messages$ANCSNotification$NotificationAttributeId[NotificationAttributeId.MessageSize.ordinal()] = 5; } catch (NoSuchFieldError nosuchfielderror3) { } try { $SwitchMap$com$olio$communication$bluetooth$channel_messages$ANCSNotification$NotificationAttributeId[com.olio.communication.bluetooth.channel_messages.NotificationAttributeId.Date.ordinal()] = 6; } catch (NoSuchFieldError nosuchfielderror2) { } try { $SwitchMap$com$olio$communication$bluetooth$channel_messages$ANCSNotification$NotificationAttributeId[NotificationAttributeId.PositiveActionLabel.ordinal()] = 7; } catch (NoSuchFieldError nosuchfielderror1) { } try { $SwitchMap$com$olio$communication$bluetooth$channel_messages$ANCSNotification$NotificationAttributeId[NotificationAttributeId.NegativeActionLabel.ordinal()] = 8; } catch (NoSuchFieldError nosuchfielderror) { return; } } } _cls14..SwitchMap.com.olio.communication.bluetooth.channel_messages.ANCSNotification.NotificationAttributeId[notificationfield.mNotificationAttribute.ordinal()]; JVM INSTR tableswitch 1 8: default 116 // 1 145 // 2 153 // 3 161 // 4 169 // 5 177 // 6 185 // 7 215 // 8 223; goto _L1 _L2 _L3 _L4 _L5 _L6 _L7 _L8 _L9 _L1: break; /* Loop/switch isn't completed */ _L9: break MISSING_BLOCK_LABEL_223; _L12: int l; l = j + 1; if (notificationfield.mEnd >= mCompleteMessage.length) { break; /* Loop/switch isn't completed */ } j = l; if (l < i) goto _L11; else goto _L10 _L10: return; _L2: setAppName(((String) (obj))); goto _L12 _L3: setTitle(((String) (obj))); goto _L12 _L4: setSubtitle(((String) (obj))); goto _L12 _L5: setMessage(((String) (obj))); goto _L12 _L6: setMessageSize(((String) (obj))); goto _L12 _L7: obj = Utilities.parseANCSDate(((String) (obj))); long l1; if (obj != null) { l1 = ((Date) (obj)).getTime(); } else { l1 = 0L; } setANCSDate(l1); goto _L12 _L8: setPositiveActionLabel(((String) (obj))); goto _L12 setNegativeActionLabel(((String) (obj))); goto _L12 } public void receivedData(byte abyte0[], boolean flag) { mCompleteMessage = Utilities.concatenateArrays(new byte[][] { mCompleteMessage, abyte0 }); if (flag && hasCompleteAttributeSet(mCompleteMessage)) { parseStoredMessage(8); } else if (!flag && hasCompletePartialRequestAttributeSet(mCompleteMessage)) { parseStoredMessage(2); return; } } public List recordFields() { return recordFields; } public void setANCSDate(long l) { ancsDate = l; } public void setANCSId(byte abyte0[]) { if (abyte0 != null) { ancsId = Arrays.copyOf(abyte0, abyte0.length); idInteger = ByteBuffer.wrap(abyte0).order(ByteOrder.LITTLE_ENDIAN).getInt(); } } public void setAppName(String s) { String s1 = s; if (s == null) { s1 = ""; } appIdentifier = s1; } public void setCategory(com.olio.communication.notifications.NotificationFilters.Category category1) { category = category1; } public void setDatabaseId(int i) { databaseId = i; } public void setIdInteger(Integer integer) { idInteger = integer.intValue(); ancsId = ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN).putInt(integer.intValue()).array(); } public void setMessage(String s) { message = s; } public void setMessageSize(String s) { messageSize = s; } public void setNegativeActionLabel(String s) { negativeActionLabel = s; } public void setNotificationCenterStatus(ANCSNotificationUpdate.EventType eventtype) { if (eventtype == ANCSNotificationUpdate.EventType.added) { mANCStatus = AppleNotificationCenterStatus.visible; } else { if (eventtype == ANCSNotificationUpdate.EventType.modified) { mANCStatus = AppleNotificationCenterStatus.visible; return; } if (eventtype == ANCSNotificationUpdate.EventType.removed) { mANCStatus = AppleNotificationCenterStatus.removed; return; } } } public void setPositiveActionLabel(String s) { positiveActionLabel = s; } public void setSubtitle(String s) { subtitle = s; } public void setTitle(String s) { title = s; } public String tableName() { return "ancs_notifications"; } public Uri tableUri() { return DatabaseRecordMixins.baseUriForTable(staticFactory()); } public String toString() { return (new StringBuilder()).append("ANCSNotification{ancsDate=").append(ancsDate).append(", appIdentifier='").append(appIdentifier).append('\'').append(", title='").append(title).append('\'').append(", subtitle='").append(subtitle).append('\'').append(", message='").append(message).append('\'').append(", category=").append(category).append(", idInteger=").append(idInteger).append(", positiveActionLabel='").append(positiveActionLabel).append('\'').append(", negativeActionLabel='").append(negativeActionLabel).append('\'').append(", databaseId=").append(databaseId).append(", mCompleteMessage=").append(Arrays.toString(mCompleteMessage)).append(", mANCStatus=").append(mANCStatus).append('}').toString(); } static { APP_IDENTIFIER_ID = Byte.valueOf((byte)0); TITLE_ID = Byte.valueOf((byte)1); SUBTITLE_ID = Byte.valueOf((byte)2); MESSAGE_ID = Byte.valueOf((byte)3); MESSAGE_SIZE_ID = Byte.valueOf((byte)4); DATE_ID = Byte.valueOf((byte)5); POSITIVE_ACTION_LABEL_ID = Byte.valueOf((byte)6); NEGATIVE_ACTION_LABEL_ID = Byte.valueOf((byte)7); notificationAttributesMap = new HashMap(); notificationAttributesMap.put(APP_IDENTIFIER_ID, NotificationAttributeId.AppIdentifier); notificationAttributesMap.put(TITLE_ID, NotificationAttributeId.Title); notificationAttributesMap.put(SUBTITLE_ID, NotificationAttributeId.Subtitle); notificationAttributesMap.put(MESSAGE_ID, NotificationAttributeId.Message); notificationAttributesMap.put(MESSAGE_SIZE_ID, NotificationAttributeId.MessageSize); notificationAttributesMap.put(DATE_ID, com.olio.communication.bluetooth.channel_messages.NotificationAttributeId.Date); notificationAttributesMap.put(POSITIVE_ACTION_LABEL_ID, NotificationAttributeId.PositiveActionLabel); notificationAttributesMap.put(NEGATIVE_ACTION_LABEL_ID, NotificationAttributeId.NegativeActionLabel); recordFields = new LinkedList(); recordFields.add(new com.olio.olios.model.record.DatabaseRecord.RecordFieldSet() { public void assignFromCursorColumn(ANCSNotification ancsnotification, Cursor cursor, int i) { ancsnotification.setAppName(cursor.getString(i)); } public volatile void assignFromCursorColumn(Object obj, Cursor cursor, int i) { assignFromCursorColumn((ANCSNotification)obj, cursor, i); } public String columnName() { return ANCSNotification.APP_IDENTIFIER; } public String createType() { return "TEXT"; } public void writeToContentValues(ANCSNotification ancsnotification, ContentValues contentvalues) { contentvalues.put(columnName(), ancsnotification.getAppName()); } public volatile void writeToContentValues(Object obj, ContentValues contentvalues) { writeToContentValues((ANCSNotification)obj, contentvalues); } }); recordFields.add(new com.olio.olios.model.record.DatabaseRecord.RecordFieldSet() { public void assignFromCursorColumn(ANCSNotification ancsnotification, Cursor cursor, int i) { ancsnotification.setTitle(cursor.getString(i)); } public volatile void assignFromCursorColumn(Object obj, Cursor cursor, int i) { assignFromCursorColumn((ANCSNotification)obj, cursor, i); } public String columnName() { return ANCSNotification.TITLE; } public String createType() { return "TEXT"; } public void writeToContentValues(ANCSNotification ancsnotification, ContentValues contentvalues) { contentvalues.put(columnName(), ancsnotification.getTitle()); } public volatile void writeToContentValues(Object obj, ContentValues contentvalues) { writeToContentValues((ANCSNotification)obj, contentvalues); } }); recordFields.add(new com.olio.olios.model.record.DatabaseRecord.RecordFieldSet() { public void assignFromCursorColumn(ANCSNotification ancsnotification, Cursor cursor, int i) { ancsnotification.setSubtitle(cursor.getString(i)); } public volatile void assignFromCursorColumn(Object obj, Cursor cursor, int i) { assignFromCursorColumn((ANCSNotification)obj, cursor, i); } public String columnName() { return ANCSNotification.SUBTITLE; } public String createType() { return "TEXT"; } public void writeToContentValues(ANCSNotification ancsnotification, ContentValues contentvalues) { contentvalues.put(columnName(), ancsnotification.getSubtitle()); } public volatile void writeToContentValues(Object obj, ContentValues contentvalues) { writeToContentValues((ANCSNotification)obj, contentvalues); } }); recordFields.add(new com.olio.olios.model.record.DatabaseRecord.RecordFieldSet() { public void assignFromCursorColumn(ANCSNotification ancsnotification, Cursor cursor, int i) { ancsnotification.setMessage(cursor.getString(i)); } public volatile void assignFromCursorColumn(Object obj, Cursor cursor, int i) { assignFromCursorColumn((ANCSNotification)obj, cursor, i); } public String columnName() { return ANCSNotification.MESSAGE; } public String createType() { return "TEXT"; } public void writeToContentValues(ANCSNotification ancsnotification, ContentValues contentvalues) { contentvalues.put(columnName(), ancsnotification.getMessage()); } public volatile void writeToContentValues(Object obj, ContentValues contentvalues) { writeToContentValues((ANCSNotification)obj, contentvalues); } }); recordFields.add(new com.olio.olios.model.record.DatabaseRecord.RecordFieldSet() { public void assignFromCursorColumn(ANCSNotification ancsnotification, Cursor cursor, int i) { ancsnotification.setMessageSize(cursor.getString(i)); } public volatile void assignFromCursorColumn(Object obj, Cursor cursor, int i) { assignFromCursorColumn((ANCSNotification)obj, cursor, i); } public String columnName() { return ANCSNotification.MESSAGE_SIZE; } public String createType() { return "TEXT"; } public void writeToContentValues(ANCSNotification ancsnotification, ContentValues contentvalues) { contentvalues.put(columnName(), ancsnotification.getMessageSize()); } public volatile void writeToContentValues(Object obj, ContentValues contentvalues) { writeToContentValues((ANCSNotification)obj, contentvalues); } }); recordFields.add(new com.olio.olios.model.record.DatabaseRecord.RecordFieldSet() { public void assignFromCursorColumn(ANCSNotification ancsnotification, Cursor cursor, int i) { ancsnotification.setANCSDate(cursor.getLong(i)); } public volatile void assignFromCursorColumn(Object obj, Cursor cursor, int i) { assignFromCursorColumn((ANCSNotification)obj, cursor, i); } public String columnName() { return ANCSNotification.DATE; } public String createType() { return "INTEGER"; } public void writeToContentValues(ANCSNotification ancsnotification, ContentValues contentvalues) { contentvalues.put(columnName(), Long.valueOf(ancsnotification.getANCSDate())); } public volatile void writeToContentValues(Object obj, ContentValues contentvalues) { writeToContentValues((ANCSNotification)obj, contentvalues); } }); recordFields.add(new com.olio.olios.model.record.DatabaseRecord.RecordFieldSet() { public void assignFromCursorColumn(ANCSNotification ancsnotification, Cursor cursor, int i) { ancsnotification.setANCSId(cursor.getBlob(i)); } public volatile void assignFromCursorColumn(Object obj, Cursor cursor, int i) { assignFromCursorColumn((ANCSNotification)obj, cursor, i); } public String columnName() { return ANCSNotification.ANCS_ID; } public String createType() { return "BLOB"; } public void writeToContentValues(ANCSNotification ancsnotification, ContentValues contentvalues) { contentvalues.put(columnName(), ancsnotification.getANCSId()); } public volatile void writeToContentValues(Object obj, ContentValues contentvalues) { writeToContentValues((ANCSNotification)obj, contentvalues); } }); recordFields.add(new com.olio.olios.model.record.DatabaseRecord.RecordFieldSet() { public void assignFromCursorColumn(ANCSNotification ancsnotification, Cursor cursor, int i) { ancsnotification.setCategory(NotificationFilters.fromANCSValue(cursor.getInt(i))); } public volatile void assignFromCursorColumn(Object obj, Cursor cursor, int i) { assignFromCursorColumn((ANCSNotification)obj, cursor, i); } public String columnName() { return ANCSNotification.CATEGORY; } public String createType() { return "INTEGER"; } public void writeToContentValues(ANCSNotification ancsnotification, ContentValues contentvalues) { if (ancsnotification == null) { ALog.e("NULL message this: %s\nvalues: %s", new Object[] { this, contentvalues }); contentvalues.put(columnName(), Integer.valueOf(com.olio.communication.notifications.NotificationFilters.Category.OTHER.ANCSValue)); return; } else { contentvalues.put(columnName(), Integer.valueOf(ancsnotification.getCategory().ANCSValue)); return; } } public volatile void writeToContentValues(Object obj, ContentValues contentvalues) { writeToContentValues((ANCSNotification)obj, contentvalues); } }); recordFields.add(new com.olio.olios.model.record.DatabaseRecord.RecordFieldSet() { public void assignFromCursorColumn(ANCSNotification ancsnotification, Cursor cursor, int i) { ancsnotification.setIdInteger(Integer.valueOf(cursor.getInt(i))); } public volatile void assignFromCursorColumn(Object obj, Cursor cursor, int i) { assignFromCursorColumn((ANCSNotification)obj, cursor, i); } public String columnName() { return ANCSNotification.ID_INTEGER; } public String createType() { return "INTEGER"; } public void writeToContentValues(ANCSNotification ancsnotification, ContentValues contentvalues) { contentvalues.put(columnName(), ancsnotification.getIdInteger()); } public volatile void writeToContentValues(Object obj, ContentValues contentvalues) { writeToContentValues((ANCSNotification)obj, contentvalues); } }); recordFields.add(new com.olio.olios.model.record.DatabaseRecord.RecordFieldSet() { public void assignFromCursorColumn(ANCSNotification ancsnotification, Cursor cursor, int i) { ancsnotification.setPositiveActionLabel(cursor.getString(i)); } public volatile void assignFromCursorColumn(Object obj, Cursor cursor, int i) { assignFromCursorColumn((ANCSNotification)obj, cursor, i); } public String columnName() { return ANCSNotification.POSITIVE_ACTION_LABEL; } public String createType() { return "TEXT"; } public void writeToContentValues(ANCSNotification ancsnotification, ContentValues contentvalues) { contentvalues.put(columnName(), ancsnotification.getPositiveActionLabel()); } public volatile void writeToContentValues(Object obj, ContentValues contentvalues) { writeToContentValues((ANCSNotification)obj, contentvalues); } }); recordFields.add(new com.olio.olios.model.record.DatabaseRecord.RecordFieldSet() { public void assignFromCursorColumn(ANCSNotification ancsnotification, Cursor cursor, int i) { ancsnotification.setNegativeActionLabel(cursor.getString(i)); } public volatile void assignFromCursorColumn(Object obj, Cursor cursor, int i) { assignFromCursorColumn((ANCSNotification)obj, cursor, i); } public String columnName() { return ANCSNotification.NEGATIVE_ACTION_LABEL; } public String createType() { return "TEXT"; } public void writeToContentValues(ANCSNotification ancsnotification, ContentValues contentvalues) { contentvalues.put(columnName(), ancsnotification.getNegativeActionLabel()); } public volatile void writeToContentValues(Object obj, ContentValues contentvalues) { writeToContentValues((ANCSNotification)obj, contentvalues); } }); recordFields.add(new com.olio.olios.model.record.DatabaseRecord.RecordFieldSet() { public void assignFromCursorColumn(ANCSNotification ancsnotification, Cursor cursor, int i) { ancsnotification.setDatabaseId(cursor.getInt(i)); } public volatile void assignFromCursorColumn(Object obj, Cursor cursor, int i) { assignFromCursorColumn((ANCSNotification)obj, cursor, i); } public String columnName() { return "_id"; } public String createType() { return "INTEGER"; } public void writeToContentValues(ANCSNotification ancsnotification, ContentValues contentvalues) { } public volatile void writeToContentValues(Object obj, ContentValues contentvalues) { writeToContentValues((ANCSNotification)obj, contentvalues); } }); columnProjection = DatabaseRecordMixins.columnProjectionFromRecordFields(recordFields); } }