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