Skip to content

Commit

Permalink
check path for app name (keybase#24252)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisnojima authored Jul 7, 2020
1 parent 34aac05 commit 878dc50
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,12 @@ private void run() {
} else if (uri != null) {
String filePath = readFileFromUri(getReactContext(), uri);
if (filePath != null) {
engine.setInitialShareFileUrl(filePath);
// ensure not inside ourselves
String appPath = getApplicationInfo().dataDir;

if (filePath.indexOf("io.keybase.ossifrage") == -1) {
engine.setInitialShareFileUrl(filePath);
}
}
} else if (textPayload.length() > 0){
engine.setInitialShareText(textPayload);
Expand All @@ -331,9 +336,13 @@ private void run() {
if (uri != null) {
String filePath = readFileFromUri(getReactContext(), uri);
if (filePath != null) {
WritableMap args = Arguments.createMap();
args.putString("localPath", filePath);
emitter.emit("onShareData", args);
String appPath = getApplicationInfo().dataDir;
// ensure not inside ourselves
if (filePath.indexOf("io.keybase.ossifrage") == -1) {
WritableMap args = Arguments.createMap();
args.putString("localPath", filePath);
emitter.emit("onShareData", args);
}
}
} else if (textPayload.length() > 0) {
WritableMap args = Arguments.createMap();
Expand Down

0 comments on commit 878dc50

Please sign in to comment.