// 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; import com.olio.util.ALog; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectInputStream; import java.io.ObjectOutput; import java.io.ObjectOutputStream; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Utilities { private static final SimpleDateFormat sAncsSimpleDateFormat = new SimpleDateFormat("yyyyMMdd'T'HHmmss", Locale.getDefault()); public Utilities() { } public static String byteArrayToString(byte abyte0[]) { if (abyte0 == null) { return ""; } StringBuilder stringbuilder = new StringBuilder(abyte0.length * 2); int j = abyte0.length; for (int i = 0; i < j; i++) { stringbuilder.append(String.format("{%02X}", new Object[] { Byte.valueOf(abyte0[i]) })); } return stringbuilder.toString(); } public static transient byte[] concatenateArrays(byte abyte0[][]) { int k = 0; for (int i = 0; i < abyte0.length; i++) { k += abyte0[i].length; } byte abyte1[] = new byte[k]; k = 0; for (int j = 0; j < abyte0.length; j++) { System.arraycopy(abyte0[j], 0, abyte1, k, abyte0[j].length); k += abyte0[j].length; } return abyte1; } public static Object decode(byte abyte0[]) { if (abyte0 != null) goto _L2; else goto _L1 _L1: return null; _L2: Object obj1; Object obj3; Object obj4; Object obj5; ByteArrayInputStream bytearrayinputstream; bytearrayinputstream = new ByteArrayInputStream(abyte0); obj3 = null; obj4 = null; obj5 = null; abyte0 = null; obj1 = null; Object obj = new ObjectInputStream(bytearrayinputstream); abyte0 = ((byte []) (((ObjectInput) (obj)).readObject())); Object obj2; try { bytearrayinputstream.close(); } // Misplaced declaration of an exception variable catch (Object obj2) { } if (obj != null) { try { ((ObjectInput) (obj)).close(); } // Misplaced declaration of an exception variable catch (Object obj) { return abyte0; } } return abyte0; abyte0; obj = obj1; obj1 = abyte0; _L9: abyte0 = ((byte []) (obj)); ALog.e("IOException decoding an object", ((Throwable) (obj1)), new Object[0]); try { bytearrayinputstream.close(); } // Misplaced declaration of an exception variable catch (byte abyte0[]) { } if (obj != null) { try { ((ObjectInput) (obj)).close(); } // Misplaced declaration of an exception variable catch (byte abyte0[]) { return null; } return null; } goto _L1 obj2; obj = obj3; _L8: abyte0 = ((byte []) (obj)); ALog.e("ClassNotFoundException decoding an object", ((Throwable) (obj2)), new Object[0]); try { bytearrayinputstream.close(); } // Misplaced declaration of an exception variable catch (byte abyte0[]) { } if (obj != null) { try { ((ObjectInput) (obj)).close(); } // Misplaced declaration of an exception variable catch (byte abyte0[]) { return null; } return null; } goto _L1 obj2; obj = obj4; _L7: abyte0 = ((byte []) (obj)); ALog.e("Illegal Argument Exception", ((Throwable) (obj2)), new Object[0]); try { bytearrayinputstream.close(); } // Misplaced declaration of an exception variable catch (byte abyte0[]) { } if (obj != null) { try { ((ObjectInput) (obj)).close(); } // Misplaced declaration of an exception variable catch (byte abyte0[]) { return null; } return null; } goto _L1 obj2; obj = obj5; _L6: abyte0 = ((byte []) (obj)); ALog.e("General exception when decoding object", ((Throwable) (obj2)), new Object[0]); try { bytearrayinputstream.close(); } // Misplaced declaration of an exception variable catch (byte abyte0[]) { } if (obj == null) goto _L1; else goto _L3 _L3: try { ((ObjectInput) (obj)).close(); } // Misplaced declaration of an exception variable catch (byte abyte0[]) { return null; } return null; obj; _L5: try { bytearrayinputstream.close(); } // Misplaced declaration of an exception variable catch (Object obj2) { } if (abyte0 != null) { try { abyte0.close(); } // Misplaced declaration of an exception variable catch (byte abyte0[]) { } } throw obj; obj2; abyte0 = ((byte []) (obj)); obj = obj2; if (true) goto _L5; else goto _L4 _L4: obj2; goto _L6 obj2; goto _L7 obj2; goto _L8 obj2; goto _L9 } public static byte[] encodeWithSerialization(Object obj) { Object obj1; Object obj3; ByteArrayOutputStream bytearrayoutputstream; bytearrayoutputstream = new ByteArrayOutputStream(); obj1 = null; obj3 = null; Object obj2 = new ObjectOutputStream(bytearrayoutputstream); ((ObjectOutput) (obj2)).writeObject(obj); obj = bytearrayoutputstream.toByteArray(); if (obj2 != null) { try { ((ObjectOutput) (obj2)).close(); } // Misplaced declaration of an exception variable catch (Object obj1) { } } try { bytearrayoutputstream.close(); } // Misplaced declaration of an exception variable catch (Object obj1) { return ((byte []) (obj)); } return ((byte []) (obj)); obj2; obj = obj3; _L4: obj1 = obj; ALog.e("Cannot serialize object", ((Throwable) (obj2)), new Object[0]); if (obj != null) { try { ((ObjectOutput) (obj)).close(); } // Misplaced declaration of an exception variable catch (Object obj) { } } try { bytearrayoutputstream.close(); } // Misplaced declaration of an exception variable catch (Object obj) { return null; } return null; obj; _L2: if (obj1 != null) { try { ((ObjectOutput) (obj1)).close(); } // Misplaced declaration of an exception variable catch (Object obj1) { } } try { bytearrayoutputstream.close(); } // Misplaced declaration of an exception variable catch (Object obj1) { } throw obj; obj; obj1 = obj2; if (true) goto _L2; else goto _L1 _L1: IOException ioexception; ioexception; obj = obj2; obj2 = ioexception; if (true) goto _L4; else goto _L3 _L3: } public static boolean equals(Object obj, Object obj1) { boolean flag; if (obj == null) { if (obj1 == null) { flag = true; } else { flag = false; } } else { flag = obj.equals(obj1); } return Boolean.valueOf(flag).booleanValue(); } public static String formatANCSDate(Date date) { if (date != null) { return sAncsSimpleDateFormat.format(date); } else { return null; } } public static byte[] hexStringToByteArray(String s) { int j = s.length(); byte abyte0[] = new byte[j / 2]; for (int i = 0; i < j; i += 2) { abyte0[i / 2] = (byte)((Character.digit(s.charAt(i), 16) << 4) + Character.digit(s.charAt(i + 1), 16)); } return abyte0; } public static Date parseANCSDate(String s) { try { s = sAncsSimpleDateFormat.parse(s); } // Misplaced declaration of an exception variable catch (String s) { ALog.e("Couldn't parse date", new Object[0]); return null; } return s; } }