A letter '%' is doubled on Android - titanium

Environment Titanium 6.0.3.GA / 6.0.2.GA / 6.0.1.GA
var myname = "%";
Ti.API.info("test:" + myname);
This simple code shows different output
Android
[INFO] test:%%
iOS
[INFO] test:%
THis is the further investigation of Titanium encodeURIComponent returns different value iOS / Android
It might be bug or not ??
I tried these too
var myname = "1%1";
var myname = '1%1';
var myname = "1\%1";
Everything shows (on Android)
[INFO] test:1%%1

Related

getting FindFailed issue in sikuli for image on windows server 2019 (ADO VM)

Getting below error when running script on window server 2019 (ADO VM) through pipeline , same script is working fine on windows 10 (having resolution 1920X1080).
I am using screen resolution utility to change the VM resolution to 1920X1080 in pipeline.
I am setup the path Bundle Folder by using below text:
ImagePath.setBundleFolder(new File(System.getProperty("user.dir")+"/SikuliImages"));
using below code
ImagePath.setBundleFolder(new File(System.getProperty("user.dir")+"/SikuliImages"));
System.out.println("Image Bundle Path="+ImagePath.getBundlePath());
Screen screen=new Screen();
String UserName_Image_Path = System.getProperty("user.dir")+"/SikuliImages/UserName_TextBox.png";
String UserPassword_Image_Path = System.getProperty("user.dir")+"/SikuliImages/UserPassword_TextBox.png";
String SignIn_Image_Path = System.getProperty("user.dir")+"/SikuliImages/SignIn_Button.png";
Pattern P_UserName = new Pattern(UserName_Image_Path);
Pattern P_UserPassword = new Pattern(UserPassword_Image_Path);
Pattern P_SignIn = new Pattern(SignIn_Image_Path);
System.out.println("Wait for popup");
screen.wait(P_UserName,30);
Match UserName_Found = screen.exists(UserName_Image_Path);
UserName_Found.highlight(2);
screen.type(P_UserName,UserName);
Match UserPassword_Found = screen.exists(UserPassword_Image_Path);
UserPassword_Found.highlight(2);
screen.type(P_UserPassword,UserPassword);
Match SignIn_Found = screen.exists(SignIn_Image_Path);
SignIn_Found.highlight(2);
screen.click(P_SignIn);
FindFailed : C:\agent\vsts-agent-win-x64-2.200.2_work\1\s\Automation/SikuliImages/UserName_TextBox.png: (378x54) in R[0,0 1920x1080]#S(0)
Line 2226, in file Region.java
Could someone help me please.
This is not valid windows path since it contains both \ and /

JDK8 - package sun.security.provider.certpath.ldap does not exist - Implementation suggestions

I tried to compile a Spring Boot project (Java 8 + Kotlin 1.5) using Gradle 6.8 and found the error below in Java class.
error: package sun.security.provider.certpath.ldap does not exist
import sun.security.provider.certpath.ldap.LDAPCertStoreHelper;
^
I found a solution to Maven project from:
https://stackoverflow.com/a/43894257/13790777 by adding this config in pom.xml which is work.
<configuration>
<fork>true</fork>
<compilerArgument>-XDignore.symbol.file</compilerArgument>
</configuration>
But I when can't config something like this in build.gradle.kts (Gradle Project). So, I want to know the ways to solve this problem.
If you want to reproduce this problem, you can clone this project: https://github.com/ETDA/PDFSigningAndTimestamp and try to compile this project, and you will encounter the problem immediately.
I encountered the same problem and I discovered the following solutions.
Download and install Java Development Kit 8 https://www.oracle.com/java/technologies/downloads/#java8-mac
Open TestSignAndStamp.java
https://github.com/ETDA/PDFSigningAndTimestamp/blob/master/src/sample/TestSignAndStamp.java
Change the certificate file and comment the timestamp server (the existing one has expired).
/**** Sample Input ****/
String passwordP12 = "password";
String inputFileP12 = "cert_sign_01_new.p12"; // Change the certificate file; the existing one has expired.
String inputFileName = "pdfA3.pdf";
String outputFile = "tsa_signed.pdf";
String filePath = "resources/";
String tsaUrl = ""; // "https://time-test.teda.th"; // Comment the timestamp server; the existing one has expired.
String keystorePath = "KeystorePath";
String keystorePassword = "KeystorePassword";
String keystoreType = "PKCS12";
// String passwordP12 = args[0];
// String inputFileP12 = args[1];
// String inputFileName = args[2];
// String outputFile = args[3];
// String filePath = args[4];
// String tsaUrl = args[5];
// String keystorePath = args[6];
// String keystorePassword = args[7];
// String keystoreType = args[8];
Run TestSignAndStamp.java

Godot 3.1 - Load resources dynamically

I'm trying to load resources dynamically. It works normally on the computer, but on android the following error occurs:
Invalid type in built-in function 'dict2inst'. Cannot convert argument 1 from Nil to Dictionary.
I'm trying to load some Curve2D exported earlier.
Here is the code:
extends Node
var paths = []
const path_dir = "res://paths/"
func _ready():
load_paths()
pass
func random_path():
return paths[randi() % paths.size()]
func load_paths():
var dir = Directory.new()
dir.change_dir(path_dir)
dir.list_dir_begin()
var path_file = dir.get_next()
var path
while path_file != "":
if dir.current_is_dir():
pass
else:
print("loading: " + path_dir + path_file)
path = load(path_dir + path_file)
if path && path is Curve2D: #error occours here
paths.append(path)
path_file = dir.get_next()
The problem is because of version 3.1. Isn't a stable version. In godot 3.0.6 works fine...

Which processes can be launched using performTaskWithPathArgumentsTimeout function?

I use UIAutomation to automate an iPad application. I have tried to use
(object) performTaskWithPathArgumentsTimeout(path, args, timeout) to run Safari.app from my script:
var target = UIATarget.localTarget();
var host = target.host();
var result = host.performTaskWithPathArgumentsTimeout("/Applications/Safari.app", ["http://www.google.com"], 30);
UIALogger.logDebug("exitCode: " + result.exitCode);
UIALogger.logDebug("stdout: " + result.stdout);
UIALogger.logDebug("stderr: " + result.stderr);
I got the following results:
exitCode: 5
stdout:
stderr:
I’ve also tried to launch echo:
var target = UIATarget.localTarget();
var host = target.host();
var result = host.performTaskWithPathArgumentsTimeout("/bin/echo", ["Hello
World"], 5);
UIALogger.logDebug("exitCode: " + result.exitCode);
UIALogger.logDebug("stdout: " + result.stdout);
UIALogger.logDebug("stderr: " + result.stderr);
Results:
exitCode: 0
stdout: Hello World
stderr:
So, looks like performTaskWithPathArgumentsTimeout works for specific applications only.
Could you please help me to answer the following questions:
1. What does exitCode = 5 mean?
2. Which processes can be launched using performTaskWithPathArgumentsTimeout function?
1) Exit code 5 is most likely EIO, as defined in : Input/Output error. You're attempting to execute "/Applications/Safari.app", which to the launching task is a directory and not a binary.
2) You can launch any application with performTaskWithPathArgumentsTimeout() that NSTask can launch. As long as it's a valid executable, it should work.
For your specific example though, Safari won't accept an argument passed on the command line like that as a URL to visit. You need to use open /Applications/Safari.app "http://www.google.com" instead:
var result = host.performTaskWithPathArgumentsTimeout("/usr/bin/open", ["/Applications/Safari.app", "http://www.google.com"], 30);

how to obtain version of app?

Is there a way to obtain a version number of a Titanium app?
e.g when installed on an iOS device then perhaps obtain the CFBundleVersion and when installed on Android then obtain its version number.
UPDATED: I was looking in the Titanium.Platform documentation for the app version number. The app version number is under Titanium.App.
Here is my code for sending the version number of my app to the server, so that the server can provide different content depending on the app-version-number.
function obtain_request_header() {
var caps = Titanium.Platform.displayCaps;
var s0 = 'appversion=' + Titanium.App.version;
var s1 = 'osname=' + Titanium.Platform.osname + ',name=' + Titanium.Platform.name + ',version=' + Titanium.Platform.version + ',model=' + Titanium.Platform.model;
var s2 = 'width=' + caps.platformWidth + ',height=' + caps.platformHeight + ',dpi=' + caps.dpi;
return s0 + ',' + s1 + ',' + s2;
}
To obtain the version of your application regardless of OS, simply use:
Titanium.App.version