修复 所有脚本在Android 4.4都不能正常运行的问题
This commit is contained in:
@@ -93,6 +93,9 @@ public class JavaScriptHighlighter implements SimpleTextWatcher.AfterTextChanged
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void updateTokens(String sourceString) {
|
public void updateTokens(String sourceString) {
|
||||||
|
if(mTheme == null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
final int id = mRunningHighlighterId.incrementAndGet();
|
final int id = mRunningHighlighterId.incrementAndGet();
|
||||||
mExecutorService.execute(() -> {
|
mExecutorService.execute(() -> {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -31,7 +31,9 @@ runtime.init();
|
|||||||
var len = functions.length;
|
var len = functions.length;
|
||||||
for(var i = 0; i < len; i++) {
|
for(var i = 0; i < len; i++) {
|
||||||
var funcName = functions[i];
|
var funcName = functions[i];
|
||||||
global[funcName] = obj[funcName].bind(obj);
|
if(obj[funcName]){
|
||||||
|
global[funcName] = obj[funcName].bind(obj);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
module.exports = function (runtime, scope) {
|
module.exports = function (runtime, scope) {
|
||||||
function images(){
|
function images(){
|
||||||
}
|
}
|
||||||
util.__assignFunctions__(runtime.images, images, ['requestScreenCapture', 'captureScreen', 'read', 'copy', 'load', 'clip', 'pixel'])
|
if(android.os.Build.VERSION.SDK_INT >= 21){
|
||||||
|
util.__assignFunctions__(runtime.images, images, ['requestScreenCapture', 'captureScreen', 'read', 'copy', 'load', 'clip', 'pixel'])
|
||||||
|
}
|
||||||
images.opencvImporter = JavaImporter(
|
images.opencvImporter = JavaImporter(
|
||||||
org.opencv.core.Point,
|
org.opencv.core.Point,
|
||||||
org.opencv.core.Point3,
|
org.opencv.core.Point3,
|
||||||
|
|||||||
Reference in New Issue
Block a user