Skip to content

Instantly share code, notes, and snippets.

View jmazzahacks's full-sized avatar

Jason Byteforgia jmazzahacks

View GitHub Profile
// decrypt our resource string back into it's source format.
public static String decrypt(String cipherText) throws Exception {
SecretKeySpec keySpec = new SecretKeySpec(keyBytes, "AES");
// init cipher
Cipher cipher = Cipher.getInstance("AES");
cipher.init(Cipher.DECRYPT_MODE, keySpec);
byte[] clearText = cipher.doFinal(Base64.decode(cipherText.getBytes()));
// bytes used for the encryption key, MAKE SURE YOU CHANGE THESE VALUES
private static byte[] keyBytes = new byte[] { 0x0f, 0x01, 0x07, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x00, 0x10, 0x11, 0x12, 0x09, 0x14, 0x15, 0x11, 0x17 };
// encrypt the clearText, base64 encode the cipher text and return it.
public static String encrypt(String clearText) throws Exception {
SecretKeySpec keySpec = new SecretKeySpec(keyBytes, "AES");
// init cipher
package com.tunewiki.common.view;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import android.R;
import android.content.Context;
import android.content.res.TypedArray;
package com.motorola.android.fmradio;
public class FMRadioUtil {
/**
* Constant for stereo audio mode.
*/
public final static int FMRADIO_AUDIO_MODE_STEREO = 1;
/**
* Constant for mono audio mode.
*/