Skip to content

Instantly share code, notes, and snippets.

View SyncHack's full-sized avatar

Makoto NARA (Mc.N) SyncHack

View GitHub Profile
String getRawCpuinfo_old() {
String ret = "";
InputStream in = null;
byte[] buf = new byte[4096];
try {
String[] args = {
"/system/bin/cat", "/proc/cpuinfo"
};
String getRawCpuinfo() {
String ret = "";
FileReader fr = null;
char[] buf = new char[4096];
try {
fr = new FileReader("/proc/cpuinfo");
int len = fr.read(buf);
String getVersionName(Context context) {
String versionStr = "(none)";
PackageManager pm = context.getPackageManager();
try {
PackageInfo info = pm.getPackageInfo(context.getPackageName(), 0);
versionStr = info.versionName;
} catch (Exception e) {
// no mentenance...
}
return versionStr;
String androidid = Secure.getString(getContentResolver(),Secure.ANDROID_ID);
String serialid = android.os.Build.SERIAL;
Log.i("test", androidid + "," + serialid);
@SyncHack
SyncHack / vold.fstab
Created March 2, 2012 10:54
vold.fstab (REGZA Tablet AT300, Android 3.1)
## Vold 2.0 fstab for tostab03
#######################
## Regular device mount
##
## Format: dev_mount <label> <mount_point> <part> <sysfs_path1...>
## label - Label for the volume
## mount_point - Where the volume will be mounted
## part - Partition # (1 based), or 'auto' for first usable partition.
## <sysfs_path> - List of sysfs paths to source devices
@SyncHack
SyncHack / vold.fstab
Created March 2, 2012 10:55
vold.fstab (XOOM, Android 4.0)
## Vold 2.0 fstab for Stingray
#######################
## Regular device mount
##
## Format: dev_mount <label> <mount_point> <part> <sysfs_path1...>
## label - Label for the volume
## mount_point - Where the volume will be mounted
## part - Partition # (1 based), or 'auto' for first usable partition.
## <sysfs_path> - List of sysfs paths to source devices
@SyncHack
SyncHack / vold.fstab
Created March 2, 2012 11:41
vold.fstab (Nexus One, Android 2.3.6)
## Vold 2.0 fstab for HTC Passion
#
## - San Mehat (san@android.com)
##
#######################
## Regular device mount
##
## Format: dev_mount <label> <mount_point> <part> <sysfs_path1...>
## label - Label for the volume
File getTrueExternalStorageDirectory() {
final File standard = Environment.getExternalStorageDirectory();
// SUMSUNG製品が他のどの製品よりも優れた独自仕様
final File sd = new File(standard, "sd");
final File ext = new File(standard, "external_sd");
if (sd.exists() && sd.isDirectory())
return sd;
else if (ext.exists() && ext.isDirectory())
return ext;
String getPseudoStoragePath(){
String storage_path;
if(Build.MODEL.equals("Xoom")){
// XOOM専用w
storage_path = System.getenv("SECONDARY_STORAGE");
}else{
storage_path = System.getenv("EXTERNAL_STORAGE");
}
return storage_path;
}
@SyncHack
SyncHack / gist:1966942
Created March 3, 2012 16:49
/proc/mounts (Nexus One, Android 2.3.6)
rootfs / rootfs ro,relatime 0 0
tmpfs /dev tmpfs rw,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
/dev/block/mtdblock3 /system yaffs2 ro,relatime 0 0