This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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())); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | |
*/ |