修复 一个崩溃
新增 app.parseUri 修复 app.sendEmail当有附件时出错的问题
This commit is contained in:
@@ -131,8 +131,6 @@ public class ExplorerView extends ThemeColorSwipeRefreshLayout implements SwipeR
|
|||||||
loadItemList();
|
loadItemList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
|
public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
|
||||||
mOnItemClickListener = onItemClickListener;
|
mOnItemClickListener = onItemClickListener;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -214,8 +214,10 @@ public class CircularMenu implements Recorder.OnStateChangedListener, LayoutInsp
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void inspectLayout(Func1<NodeInfo, FloatyWindow> windowCreator) {
|
private void inspectLayout(Func1<NodeInfo, FloatyWindow> windowCreator) {
|
||||||
mLayoutInspectDialog.dismiss();
|
if(mLayoutInspectDialog != null){
|
||||||
mLayoutInspectDialog = null;
|
mLayoutInspectDialog.dismiss();
|
||||||
|
mLayoutInspectDialog = null;
|
||||||
|
}
|
||||||
if (AccessibilityService.getInstance() == null) {
|
if (AccessibilityService.getInstance() == null) {
|
||||||
Toast.makeText(mContext, R.string.text_no_accessibility_permission_to_capture, Toast.LENGTH_SHORT).show();
|
Toast.makeText(mContext, R.string.text_no_accessibility_permission_to_capture, Toast.LENGTH_SHORT).show();
|
||||||
AccessibilityServiceTool.goToAccessibilitySetting();
|
AccessibilityServiceTool.goToAccessibilitySetting();
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ module.exports = function(runtime, global){
|
|||||||
i.putExtra(Intent.EXTRA_TEXT, options.text);
|
i.putExtra(Intent.EXTRA_TEXT, options.text);
|
||||||
}
|
}
|
||||||
if(options.attachment){
|
if(options.attachment){
|
||||||
i.putExtra(Intent.EXTRA_STREAM, android.content.Uri.parse("file://" + options.attachment));
|
i.putExtra(Intent.EXTRA_STREAM, app.parseUri(options.attachment));
|
||||||
}
|
}
|
||||||
i.setType("message/rfc822");
|
i.setType("message/rfc822");
|
||||||
context.startActivity(Intent.createChooser(i, "发送邮件").addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
|
context.startActivity(Intent.createChooser(i, "发送邮件").addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
|
||||||
@@ -99,7 +99,17 @@ module.exports = function(runtime, global){
|
|||||||
return arr;
|
return arr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
app.parseUri = function(uri){
|
||||||
|
if(uri.startsWith("file://")){
|
||||||
|
return app.getUriForFile(uri);
|
||||||
|
}
|
||||||
|
return android.net.Uri.parse(uri);
|
||||||
|
}
|
||||||
|
|
||||||
app.getUriForFile = function(path){
|
app.getUriForFile = function(path){
|
||||||
|
if(path.startsWith("file://")){
|
||||||
|
path = path.substring(7);
|
||||||
|
}
|
||||||
return android.support.v4.content.FileProvider.getUriForFile(context,
|
return android.support.v4.content.FileProvider.getUriForFile(context,
|
||||||
"org.autojs.autojs.fileprovider", new java.io.File(files.path(path)));
|
"org.autojs.autojs.fileprovider", new java.io.File(files.path(path)));
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user