0

コードから独自の Android アプリケーション ファイルを読み取りたい。私のファイル名が abc.apk で、電話にインストールされているとします。同じアプリケーション (abc.apk) を使用して、abc.apk ファイルをバイト単位で読み取りたいとします。コードで可能ですか?

編集:さらに使用するために質問を編集しています。Android アプリケーションの現在のファイル名をネイティブ コードから取得するにはどうすればよいですか。

ありがとう、チェタン

4

2 に答える 2

1

It is possible. Here is example project that does it: http://dl.dropbox.com/u/1923577/android_native_read_apk.7z

It includes all the source code (java nad C++). If you install apk file from bin folder and run on device it will print out to android log "D/TEST (18107): First 4 bytes = 50 4b 03 04". And that is exactly first 4 bytes of apk file (check it with hexeditor). I am running this on non-rooted device.

于 2012-04-20T21:41:01.433 に答える
0

ストックデバイスではこれは不可能だと思います。data/app/ ディレクトリには、ルートなしで直接アクセスすることはできません。

于 2012-04-20T19:35:33.617 に答える