// 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.notifications.new_notifications.RemoteActions; import android.content.Context; import android.database.sqlite.SQLiteDatabase; import android.os.Parcel; import com.olio.communication.messages.MessagePayload; import com.olio.olios.model.DataContract; import com.olio.olios.model.OlioDatabaseHelper; import com.olio.olios.model.record.DatabaseRecord; import com.olio.util.ALog; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; // Referenced classes of package com.olio.communication.notifications.new_notifications.RemoteActions: // RemoteAction public class ClearDatabaseTableRemoteAction extends RemoteAction { public static final android.os.Parcelable.Creator CREATOR = new android.os.Parcelable.Creator() { public MessagePayload createFromParcel(Parcel parcel) { return RemoteAction.unpackParcel(parcel); } public volatile Object createFromParcel(Parcel parcel) { return createFromParcel(parcel); } public MessagePayload[] newArray(int i) { return new ClearDatabaseTableRemoteAction[i]; } public volatile Object[] newArray(int i) { return newArray(i); } }; private static final long serialVersionUID = 140L; private String tableName; public ClearDatabaseTableRemoteAction() { } public ClearDatabaseTableRemoteAction(String s) { tableName = s; } public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } else { ClearDatabaseTableRemoteAction cleardatabasetableremoteaction = (ClearDatabaseTableRemoteAction)obj; return (new EqualsBuilder()).appendSuper(super.equals(obj)).append(tableName, cleardatabasetableremoteaction.tableName).isEquals(); } } public String getTableName() { return tableName; } public int hashCode() { return (new HashCodeBuilder(17, 37)).appendSuper(super.hashCode()).append(tableName).toHashCode(); } public boolean runAction(Context context, Long long1) { ALog.d("CLEARING TABLE: %s", new Object[] { tableName }); if (tableName == null || tableName.isEmpty()) { ALog.e("Clear table failed. Error: TableName not informed.", new Object[0]); logResult(context, long1, false, "TableName not informed"); return false; } boolean flag = false; com.olio.olios.model.record.DatabaseRecord.DatabaseRecordFactory adatabaserecordfactory[] = DataContract.getDatabaseTables(); int j = adatabaserecordfactory.length; for (int i = 0; i < j; i++) { if (adatabaserecordfactory[i].getRecordInstance().tableName().equals(tableName)) { flag = true; SQLiteDatabase sqlitedatabase = (new OlioDatabaseHelper(context)).getWritableDatabase(); int k = sqlitedatabase.delete(tableName, "1", null); sqlitedatabase.close(); ALog.d("%s rows deleted from table '%s'", new Object[] { Integer.valueOf(k), tableName }); logResult(context, long1, true, String.format("%s rows deleted from table %s", new Object[] { Integer.valueOf(k), tableName })); } } if (!flag) { logResult(context, long1, true, String.format("TableName(%s) not found", new Object[] { tableName })); return false; } else { return true; } } public void setTableName(String s) { tableName = s; } }