Skip to content

android.util.Base64 全局导入了? #185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hlyzhot opened this issue Nov 18, 2023 · 2 comments
Closed

android.util.Base64 全局导入了? #185

hlyzhot opened this issue Nov 18, 2023 · 2 comments
Labels
Apperception 🎯 统觉 Issue closed by the creater on his or her own Doubt ❔ 疑惑 Any doubts about this repository

Comments

@hlyzhot
Copy link

hlyzhot commented Nov 18, 2023

我在导入java.util.Base64时提示无法导入 "Base64", 因同名属性已被定义,翻了下文档,原来新增了Base64模块,但仔细一看调用时是小写的base64,哪来的冲突。于是尝试Base64.encode("xxx"),提示找不到方法 android.util.Base64.encode(string)。
所以这是全局导入了android.util.Base64,这是bug还是设计?

@LYS86
Copy link
Contributor

LYS86 commented Nov 18, 2023

Screenshot_2023-11-18-18-11-07-218_bin mt plus
在这能看到全局的部分属性

@SuperMonster003
Copy link
Owner

为了方便直接使用部分常用的类, AutoJs6 陆续将一些类全局化.

但 Rhino 默认不允许在全局变量存在的情况下进行 importClass, 针对上述问题目前有以下解决方案.

  1. AutoJs6 下一版本将修改 Rhino 源码实现 importClass 时强制覆盖已存在的全局变量而不是报错.
  2. 在 AutoJs6 更新之前, 尝试使用完全限定名称 java.util.Base64 替代 Base64. 或者使用 let Base64 = java.util.Base64 完成类导入.

Sent from my XQ-DQ72 using FastHub

@hlyzhot hlyzhot closed this as completed Dec 3, 2023
@SuperMonster003 SuperMonster003 added Apperception 🎯 统觉 Issue closed by the creater on his or her own Doubt ❔ 疑惑 Any doubts about this repository labels Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Apperception 🎯 统觉 Issue closed by the creater on his or her own Doubt ❔ 疑惑 Any doubts about this repository
Projects
None yet
Development

No branches or pull requests

3 participants