import java.io.*; import java.util.zip.Deflater; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; /** * decompiled from csc.apk */ public class OmcTextDecoder { private final int SALT_LENGTH = 256; private final String XML_HEADER = ">> (8 - this.shifts[i % 256]))); results[i] = (byte) (results[i] ^ this.salts[i % 256]); } return results; } private byte[] _encode(byte[] source) { byte[] results = new byte[source.length]; for (int i = 0; i < source.length; i++) { results[i] = (byte) (source[i] ^ this.salts[i % 256]); results[i] = (byte) (((results[i] & 255) >> this.shifts[i % 256]) | ((results[i] & 255) << (8 - this.shifts[i % 256]))); } return results; } private byte[] _decompressGzip(byte[] sourceGz) throws IOException { ByteArrayInputStream bis = new ByteArrayInputStream(sourceGz); GZIPInputStream gis = new GZIPInputStream(bis); ByteArrayOutputStream buffer = new ByteArrayOutputStream(); int nRead; byte[] data = new byte[1024]; while ((nRead = gis.read(data, 0, data.length)) != -1) { buffer.write(data, 0, nRead); } buffer.flush(); return buffer.toByteArray(); } private byte[] _compressGzip(byte[] data) throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(data.length); GZIPOutputStream gzip = new GZIPOutputStream(bos) { { this.def.setLevel(Deflater.BEST_COMPRESSION); } }; gzip.write(data); gzip.finish(); gzip.close(); byte[] compressed = bos.toByteArray(); bos.close(); return compressed; } public boolean isXmlEncoded(File featureXmlFile) { try { BufferedReader ptrRead = new BufferedReader(new FileReader(featureXmlFile)); String headerStr = ptrRead.readLine(); if (ptrRead != null) { ptrRead.close(); } if (headerStr.contains("