2

adb shellを実行し、/ mnt / shell / emulated / 0へのレガシーリンクを探しますが、getCanonicalPathは/ mnt / shell / emulated / 0を取得できませんか?

shell @ android:/ storage / emulated $ ls-llrwxrwxrwxルートルート2012-12-0712:01レガシー->/mnt / shell / emulated / 0

File file = new File("/storage/emulated/legacy");
String pachString = null;
try {
    pachString = file.getCanonicalPath();
        // prints /storage/emulated/legacy
} catch (IOException e) {
    e.printStackTrace();
}
4

1 に答える 1

2

shell@android:/mnt $ ls -l /mnt/

ls -l /mnt/ 
drwxr-xr-x root     system            2013-03-13 16:31 asec 
drwxr-xr-x root     system            2013-03-13 16:31 obb 
lrwxrwxrwx root     root              2013-03-13 16:31 sdcard -> /storage/emulated/legacy 
drwx------ root     root              2013-03-13 16:31 secure 
drwx------ shell    shell             2013-03-13 16:31 shell 

'/mnt/shell'directory はシェルのみを受け入れます。

したがって、アプリはできませんread /mnt/shell

于 2013-03-14T06:04:59.907 に答える