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
In the project proguard-project.txt file see: | |
# If your project uses WebView with JS, uncomment the following | |
# and specify the fully qualified class name to the JavaScript interface | |
# class: | |
-keepclassmembers class com.me.MeWebViewHelper.MyJSInterface { | |
public *; | |
} |
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
import android.hardware.SensorManager; | |
private SensorManager mSensorManager; | |
mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE); | |
List<Sensor> deviceSensors = mSensorManager.getSensorList(Sensor.TYPE_ALL); |
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
echo "#include <bogus.h>" | arm-linux-gnueabi-gcc -v -x c - |
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
class LooperThread extends Thread { | |
public Handler mHandler; | |
@Override | |
public void run() { | |
Looper.prepare(); | |
mHandler = new Handler(); | |
Looper.loop(); |
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
adb -d shell am force-stop com.android.Settings | |
adb -d shell am startservice com.android.Settings/com.android.Settings.ServiceName | |
#list intent receivers | |
adb shell dumpsys package com.ubnt.restapi | grep intent | |
adb shell pm list packages | |
#force factory reset | |
adb shell "am broadcast -n "com.android.server/com.android.server.MasterClearReceiver" -a android.intent.action.FACTORY_RESET" |
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
Blowfish in CFB | |
---- exchange password with bob ------> | |
export PASSWORD=no_nsa | |
echo "hello, bob!" > plaintext.doc | |
openssl bf-cfb -salt -in plaintext.doc -out ciphertext.bin -pass env:PASSWORD | |
openssl base64 -in ciphertext.bin -out base64.txt | |
---- send to bob -----> |
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
private static String getSha1Hash(String value) { | |
MessageDigest digester = null; | |
String sha1Value = null; | |
try { | |
digester = MessageDigest.getInstance("SHA-1"); | |
digester.update(value.getBytes("UTF-8"), 0, value.length()); | |
byte[] sha1hash = digester.digest(); | |
StringBuilder sb = new StringBuilder(); | |
for( byte b : sha1hash ) | |
{ |
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
The exec command is not implemend by default for init.rc despite what the readme.txt says. Add the following to get it working. | |
file: android/system/core/init/builtins.c | |
int do_exec(int nargs, char **args) | |
{ | |
const int cmd_line_max = 256; | |
char cmd_line[cmd_line_max]; | |
int cmd_length, i; | |
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
"The point here is that a lot of terms are thrown around in this industry, and not everyone | |
uses them properly. Additionally, as in this case, the definitions may be nebulous; this, | |
of course, leads to confusion." - Network Warrior page 2 |
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
//From AOSP Doc | |
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> | |
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | |
/* Checks if external storage is available for read and write */ | |
public boolean isExternalStorageWritable() { | |
String state = Environment.getExternalStorageState(); | |
if (Environment.MEDIA_MOUNTED.equals(state)) { | |
return true; | |
} |