// 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.olios.model; import android.content.ContentResolver; import android.net.Uri; import com.olio.communication.messages.MessagePayload; import com.olio.data.object.assistant.AndroidGroupNotificationsToDelete; import com.olio.data.object.assistant.AndroidGroupNotificationsToIgnore; import com.olio.data.object.assistant.ApplicationDisplayMapperSettings; import com.olio.data.object.assistant.AvailableCategories; import com.olio.data.object.assistant.CategoriesToIgnore; import com.olio.data.object.assistant.CategoryDisplayMapperSettings; import com.olio.data.object.assistant.DefaultPackagesToIgnore; import com.olio.data.object.assistant.UserSpecifiedPackagesToIgnore; import com.olio.data.object.unit.ui.TimeSkew; import com.olio.data.object.unit.ui.TimeZones; import com.olio.data.object.unit.ui.WatchUi; import com.olio.data.object.unit.ui.complication.ComplicationsSettings; import com.olio.data.object.user.ActivityTimes; import com.olio.data.object.user.CalendarSettings; import com.olio.data.object.user.ContactDisplaySettings; import com.olio.data.object.user.FavoriteContacts; import com.olio.data.object.user.InstalledApps; import com.olio.data.object.user.Locations; import com.olio.data.object.user.TransportationSettings; import com.olio.olios.model.record.SerializedRecord; import com.olio.state.DoNotDisturb; import com.olio.util.ALog; import java.io.Serializable; import java.util.List; import java.util.Objects; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; public abstract class SerializedUserRecordMessagePayload extends MessagePayload implements Serializable, com.olio.olios.model.record.SerializedRecord.SerializedRecordObject, SyncableMessageMonitor.SyncableMessage { private static final long serialVersionUID = 0x1a786bd9e5c0926eL; private Long dateCreated; private Long dateModified; private long versionNumber; public SerializedUserRecordMessagePayload() { versionNumber = 0L; } public static Object get(String s, ContentResolver contentresolver) { ALog.d("SerializedUserRecordMessagePayload.get", new Object[0]); com.olio.olios.model.record.SerializedRecord.SerializedRecordObject serializedrecordobject = SerializedRecord.get(s, null, contentresolver); contentresolver = serializedrecordobject; if (serializedrecordobject == null) { contentresolver = ((ContentResolver) (getDefault(s))); } return contentresolver; } public static List getByType(String s, ContentResolver contentresolver) { return SerializedRecord.getByType(s, null, contentresolver); } private static Object getDefault(String s) { byte byte0 = -1; s.hashCode(); JVM INSTR lookupswitch 20: default 705 // -2004463387: 365 // -1568841997: 190 // -1197189282: 380 // -1157120317: 425 // -979433006: 320 // -393168686: 290 // -289166521: 260 // -264650848: 176 // -36337957: 335 // -35398120: 218 // -9540598: 410 // 393364324: 395 // 457582948: 350 // 545098834: 275 // 807749384: 305 // 1329521552: 204 // 1368213123: 246 // 1609314439: 232 // 1990599276: 440 // 2135661203: 455; goto _L1 _L2 _L3 _L4 _L5 _L6 _L7 _L8 _L9 _L10 _L11 _L12 _L13 _L14 _L15 _L16 _L17 _L18 _L19 _L20 _L21 _L9: if (s.equals("available-categories")) { byte0 = 0; } goto _L1 _L3: if (s.equals("categories-to-ignore")) { byte0 = 1; } goto _L1 _L17: if (s.equals("default-packages-to-ignore")) { byte0 = 2; } goto _L1 _L11: if (s.equals("notification-display-mapper-settings-packages")) { byte0 = 3; } goto _L1 _L19: if (s.equals("notification-display-mapper-settings-categories")) { byte0 = 4; } goto _L1 _L18: if (s.equals("user-specified-packages-to-ignore")) { byte0 = 5; } goto _L1 _L8: if (s.equals("time-zones")) { byte0 = 6; } goto _L1 _L15: if (s.equals("watch-ui")) { byte0 = 7; } goto _L1 _L7: if (s.equals("complication-settings")) { byte0 = 8; } goto _L1 _L16: if (s.equals("activity-times")) { byte0 = 9; } goto _L1 _L6: if (s.equals("calendar-settings")) { byte0 = 10; } goto _L1 _L10: if (s.equals("contact-display-settings")) { byte0 = 11; } goto _L1 _L14: if (s.equals("favorite-contacts")) { byte0 = 12; } goto _L1 _L2: if (s.equals("installed-apps")) { byte0 = 13; } goto _L1 _L4: if (s.equals("locations")) { byte0 = 14; } goto _L1 _L13: if (s.equals("transportation-settings")) { byte0 = 15; } goto _L1 _L12: if (s.equals("time-skew")) { byte0 = 16; } goto _L1 _L5: if (s.equals("do-not-disturb")) { byte0 = 17; } goto _L1 _L20: if (s.equals("android-group-notifications-to-delete")) { byte0 = 18; } goto _L1 _L21: if (s.equals("android-group-notifications-to-ignore")) { byte0 = 19; } goto _L1 _L44: return (new AvailableCategories()).getDefaultObject(); _L24: return (new CategoriesToIgnore()).getDefaultObject(); _L25: return (new DefaultPackagesToIgnore()).getDefaultObject(); _L26: return (new ApplicationDisplayMapperSettings()).getDefaultObject(); _L27: return (new CategoryDisplayMapperSettings()).getDefaultObject(); _L28: return (new UserSpecifiedPackagesToIgnore()).getDefaultObject(); _L29: return (new TimeZones()).getDefaultObject(); _L30: return (new WatchUi()).getDefaultObject(); _L31: return (new ComplicationsSettings()).getDefaultObject(); _L32: return (new ActivityTimes()).getDefaultObject(); _L33: return (new CalendarSettings()).getDefaultObject(); _L34: return (new ContactDisplaySettings()).getDefaultObject(); _L35: return (new FavoriteContacts()).getDefaultObject(); _L36: return (new InstalledApps()).getDefaultObject(); _L37: return (new Locations()).getDefaultObject(); _L38: return (new TransportationSettings()).getDefaultObject(); _L39: return (new TimeSkew()).getDefaultObject(); _L40: return (new DoNotDisturb()).getDefaultObject(); _L41: return (new AndroidGroupNotificationsToDelete()).getDefaultObject(); _L42: s = (new AndroidGroupNotificationsToIgnore()).getDefaultObject(); return s; s; ALog.e("Error casting class in SerializedUserRecordMessagePayload for getDefault", s, new Object[0]); return null; _L1: byte0; JVM INSTR tableswitch 0 19: default 800 // 0 470 // 1 481 // 2 492 // 3 503 // 4 514 // 5 525 // 6 536 // 7 547 // 8 558 // 9 569 // 10 580 // 11 591 // 12 602 // 13 613 // 14 624 // 15 635 // 16 646 // 17 657 // 18 668 // 19 679; goto _L22 _L23 _L24 _L25 _L26 _L27 _L28 _L29 _L30 _L31 _L32 _L33 _L34 _L35 _L36 _L37 _L38 _L39 _L40 _L41 _L42 _L23: if (true) goto _L44; else goto _L43 _L43: _L22: return null; } public void applyObjectSync(ContentResolver contentresolver) { com.olio.olios.model.record.SerializedRecord.SerializedRecordObject serializedrecordobject = SerializedRecord.get(getObjectId(), null, contentresolver); ALog.d("Received object %s with value %s", new Object[] { typeName(), toString() }); String s; boolean flag; if (serializedrecordobject == null) { s = "Did not find"; } else { s = "Found"; } ALog.d("%s existing object in DB with id=%s", new Object[] { s, getObjectId() }); flag = true; if (Objects.equals(this, serializedrecordobject)) { flag = false; } ALog.d("Params for saving: %s shouldAlert: %b, version: %d", new Object[] { typeName(), Boolean.valueOf(flag), Long.valueOf(getVersionNumber()) }); ALog.d("Source point flags: %d for %s", new Object[] { Integer.valueOf(getSourcePointsFlags()), typeName() }); if (serializedrecordobject == null || !hasVersionNumberControl() || serializedrecordobject.getVersionNumber() < getVersionNumber()) { ALog.d("Saving user object %s", new Object[] { typeName() }); SerializedRecord.save(this, null, 0, contentresolver, flag); } } public void delete(ContentResolver contentresolver) { SerializedRecord.delete(this, null, contentresolver); } public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } else { SerializedUserRecordMessagePayload serializeduserrecordmessagepayload = (SerializedUserRecordMessagePayload)obj; return (new EqualsBuilder()).appendSuper(super.equals(obj)).append(getObjectId(), serializeduserrecordmessagepayload.getObjectId()).isEquals(); } } public Long getDateCreated() { return dateCreated; } public Long getDateModified() { return dateModified; } public abstract com.olio.olios.model.record.SerializedRecord.SerializedRecordObject getDefaultObject(); public int getEndPointsFlags() { return 7; } public MessagePayload getMessagePayload() { return this; } public int getSourcePointsFlags() { return 7; } public long getVersionNumber() { return versionNumber; } public boolean hasVersionNumberControl() { return true; } public int hashCode() { return (new HashCodeBuilder(17, 37)).appendSuper(super.hashCode()).append(getObjectId()).toHashCode(); } public void save(ContentResolver contentresolver) { if (Objects.equals(this, SerializedRecord.get(getObjectId(), null, contentresolver))) { return; } else { SerializedRecord.save(this, null, 1, contentresolver); return; } } public void setDateCreated(Long long1) { dateCreated = long1; } public void setDateModified(Long long1) { dateModified = long1; } public void setVersionNumber(long l) { versionNumber = l; } public abstract String typeName(); public Uri uriForRecords(ContentResolver contentresolver) { ALog.d("uriForRecords", new Object[0]); Uri uri1 = SerializedRecord.uriForObject(getObjectId(), null, contentresolver); Uri uri = uri1; if (uri1 == null) { ALog.d("uri == null", new Object[0]); getDefaultObject().save(contentresolver); uri = SerializedRecord.uriForObject(getObjectId(), null, contentresolver); } return uri; } }