Skip to content

Instantly share code, notes, and snippets.

View zaki50's full-sized avatar

Makoto Yamazaki zaki50

View GitHub Profile
package org.zakky.queue;
import android.app.Activity;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import java.util.List;
@zaki50
zaki50 / install-all.sh
Created May 20, 2011 06:04
install-all.sh
#!/bin/sh
# 対象アプリのパッケージ名。 org.zakky.memopad とか
pkgname="$1"
# 対象アプリの apk。 bin/MemoPad.apk とか
apkpath="$2"
for i in $(adb devices |grep -v "List of devices" | awk '{print $1;}'); do adb -s $i shell pm uninstall -k "$pkgname"; adb -s $i install "$apkpath"; done
@zaki50
zaki50 / skype_for_au.log
Created April 16, 2011 07:03
skype for au(com.skype.android.kddi) での結果
$ cd /data/data/com.skype.android.kddi/files
$ cat shared.xml
shared.xml: No such file or directory
$ cat ★skypeid★/main.db
★skypeid★/main.db: No such file or directory
$
@zaki50
zaki50 / FeliCaLib-fix_RuntimeException_on_alloc.diff
Created March 3, 2011 23:13
コマンドの長さが127を超えると例外がスローされるので修正
Index: src/net/kazzz/felica/lib/FeliCaLib.java
===================================================================
--- src/net/kazzz/felica/lib/FeliCaLib.java (リビジョン 37)
+++ src/net/kazzz/felica/lib/FeliCaLib.java (作業コピー)
@@ -256,7 +256,7 @@
* @return byte[] このデータのバイト列表現を戻します
*/
public byte[] getBytes() {
- ByteBuffer buff = ByteBuffer.allocate(this.length);
+ ByteBuffer buff = ByteBuffer.allocate(this.length & 0xFF);
@zaki50
zaki50 / RedirectorActivity.java
Created February 24, 2011 03:43
https なURLから マーケットを開く
/*
こんなintent filter で
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="https" android:host="market.android.com"/>
</intent-filter>
*/
protected void onResume() {
final KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA");
kpg.initialize(new RSAKeyGenParameterSpec(2048, RSAKeyGenParameterSpec.F4));
Log.i("hamatz", "generating RSA key pair...");
final long start = SystemClock.uptimeMillis();
final KeyPair kp = kpg.generateKeyPair();
final long end = SystemClock.uptimeMillis();
Log.i("hamatz", "done: " + (end-start) + "ms.");
final RSAPrivateKey privkey = (RSAPrivateKey) kp.getPrivate();
final RSAPublicKey pubkey = (RSAPublicKey) kp.getPublic();
class Klass<K> {
public static <K> Klass<K> create(Class<K> c) {
return new Klass<K>(c);
}
private final Class<K> clazz;
private Klass(Class<K> c) {
clazz = c;
}
ユーザーanonymousが実行
[workspace] $ /bin/sh -xe /Library/Tomcat/temp/hudson2161977023374287353.sh
+ echo /Users/zaki/.hudson/secrets/a3e0d4fc-c897-4ca1-9381-e51919ce2917
/Users/zaki/.hudson/secrets/a3e0d4fc-c897-4ca1-9381-e51919ce2917
+ cat /Users/zaki/.hudson/secrets/a3e0d4fc-c897-4ca1-9381-e51919ce2917/aa/bb.txt
secret!
Finished: SUCCESS
ユーザーanonymousが実行
[workspace] $ /bin/sh -xe /Library/Tomcat/temp/hudson2161977023374287353.sh
+ echo /Users/zaki/.hudson/secrets/a3e0d4fc-c897-4ca1-9381-e51919ce2917
/Users/zaki/.hudson/secrets/a3e0d4fc-c897-4ca1-9381-e51919ce2917
+ cat /Users/zaki/.hudson/secrets/a3e0d4fc-c897-4ca1-9381-e51919ce2917/aa/bb.txt
secret!
Finished: SUCCESS
@zaki50
zaki50 / output_of_mount.txt
Created December 24, 2010 09:15
OBBファイルをマウントした際の mount のオプションとか
/dev/block/loop0 /mnt/obb/443968eabe370a269a4f820df69824bb vfat ro,dirsync,nosuid,nodev,uid=10030,fmask=0227,dmask=0227,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0