Save in app's own /sdcard directory, doesnt need WRITE_EXTERNAL_STORAGE.

Removed checks for WRITE_EXTERNAL_STORAGE from Android workflow.
This commit is contained in:
michaelrgb
2017-09-11 15:38:58 +01:00
committed by Baldur Karlsson
parent bae429332d
commit 06cfd5383f
7 changed files with 13 additions and 21 deletions
@@ -467,7 +467,6 @@ void CaptureDialog::androidWarn_mouseClick()
msg +=
tr("<b>Missing permissions</b><br>"
"The target APK must have the following permissions:<br>"
"android.permission.WRITE_EXTERNAL_STORAGE<br>"
"android.permission.INTERNET<br><br>");
}
-1
View File
@@ -3319,7 +3319,6 @@ DOCUMENT(R"(A set of flags giving details of the current status of Android traca
The application being checked does not have the requesite permission:
android.permission.WRITE_EXTERNAL_STORAGE
android.permission.INTERNET
.. data:: NotDebuggable
-12
View File
@@ -133,12 +133,6 @@ uint32_t StartAndroidPackageForCapture(const char *host, const char *package)
adbExecCommand(deviceID, "shell am force-stop " + packageName);
adbForwardPorts(index, deviceID);
adbExecCommand(deviceID, "shell setprop debug.vulkan.layers VK_LAYER_RENDERDOC_Capture");
// Creating the capture file
adbExecCommand(deviceID,
"shell pm grant " + packageName + " android.permission.WRITE_EXTERNAL_STORAGE");
// Reading the capture thumbnail
adbExecCommand(deviceID,
"shell pm grant " + packageName + " android.permission.READ_EXTERNAL_STORAGE");
adbExecCommand(deviceID,
"shell monkey -p " + packageName + " -c android.intent.category.LAUNCHER 1");
@@ -438,12 +432,6 @@ bool PullAPK(const string &deviceID, const string &pkgPath, const string &apk)
bool CheckPermissions(const string &dump)
{
if(dump.find("android.permission.WRITE_EXTERNAL_STORAGE") == string::npos)
{
RDCWARN("APK missing WRITE_EXTERNAL_STORAGE permission");
return false;
}
if(dump.find("android.permission.INTERNET") == string::npos)
{
RDCWARN("APK missing INTERNET permission");
@@ -56,9 +56,15 @@ bool GetKeyState(int key)
namespace FileIO
{
const char *GetTempRootPath()
string GetTempRootPath()
{
return "/sdcard";
// Save captures in the app's private /sdcard directory, which doesnt require
// WRITE_EXTERNAL_STORAGE permissions. There is no security enforced here,
// so the replay server can load it as it has READ_EXTERNAL_STORAGE.
// This is the same as returned by getExternalFilesDir(). It might possibly change in the future.
string package;
GetExecutableFilename(package);
return "/sdcard/Android/data/" + package + "/files";
}
string GetAppFolderFilename(const string &filename)
+1 -1
View File
@@ -57,7 +57,7 @@ bool GetKeyState(int key)
namespace FileIO
{
const char *GetTempRootPath()
string GetTempRootPath()
{
return "/tmp";
}
+1 -1
View File
@@ -253,7 +253,7 @@ bool GetKeyState(int key)
namespace FileIO
{
const char *GetTempRootPath()
string GetTempRootPath()
{
return "/tmp";
}
+3 -3
View File
@@ -49,7 +49,7 @@ static int soLocator = 0;
namespace FileIO
{
// in posix/.../..._stringio.cpp
const char *GetTempRootPath();
string GetTempRootPath();
string GetHomeFolderFilename()
{
@@ -61,7 +61,7 @@ string GetHomeFolderFilename()
string GetTempFolderFilename()
{
return string(GetTempRootPath()) + "/";
return GetTempRootPath() + "/";
}
void CreateParentDirectory(const string &filename)
@@ -202,7 +202,7 @@ void GetDefaultFiles(const char *logBaseName, string &capture_filename, string &
char temp_folder[2048] = {0};
strcpy(temp_folder, GetTempRootPath());
strcpy(temp_folder, GetTempRootPath().c_str());
char *temp_override = getenv("RENDERDOC_TEMP");
if(temp_override && temp_override[0] == '/')