TA_ActivateFromFile : TA_FAILAnswered

On Windows 10 x64 (TurboActivate 4.4.4.0) we are getting TA_FAIL from TA_ActivateFromFile.

We use TA_ActivationRequestToFile and then pass the XML data to the server and then instantly call TA_ActivateFromFile. 

At first we thought it was because of badly encoded characters in ACTIVATE_OPTIONS extra-data,  but even with an empty extra-data we still get the error.

The same code works fine on macOS & Linux.

Can provide more info if needed

, edited

Yes, provide code. 

Also, what version of Windows 10 (there are 7 years of versions).

Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.19044.

Activation request is requested like this:

ACTIVATE_OPTIONS opts {sizeof(ACTIVATE_OPTIONS), nullptr};
 QTemporaryFile tmpf;
 tmpf.open();
 auto filepath = tmpf.fileName();
auto hr = TA_ActivationRequestToFile((uint32_t)handle, filepath.toStdWString().c_str(), &opts);

//… handle hr

auto requestContent = QString::fromUtf8(tmpf.readAll());
// This is further cleaned-up removing \n \r and \ characters to send to our servers which then send it to LimeLM via the web API

Request look like this:

<?xml version="1.0" encoding="utf-8"?><ActivationRequest><ablock data="Hvs8fvNEgILpKBBn+pPWikLQgwFndcNDQsqoZLa7Lqhc3qVEW03fjoE69rSqUoNXffHbDuE0h9N6iWh6NDjiyKbb9aAvquGx3r05R/b34VfwSUA/x1S7xoUQlTfYQo3OCu5WNsz36z3RTMjDISkxI+m/dqZUSCnDFu590WmcaiEr7fOBprBVk1V5w7OqukgtpvV8TX7I2Ipf3JtwkXOZkMBLM3x0f4VM2KrxdmEMwiktzVVCn4pmL/Kd56KS3zMTvH2rHQ+K8g64v3jZ5H0EyaWpkfYO39QFKRUo9DMkS9qTWD+LdzhnAqrG/RB5w9lVJ58I1SJPY5k/oXdQIwuQbB8yNYvDMxMpr6kZ5qu7Ob69n/AcL+NOZL+WN3KBdBj12CL2GEpHDPo4/gGLi2XHv7q3apQ2wiv9MdOzYAR0DcANK79WkwTBp3tPRO3/F+WVyl/1PLuYt0OxNT2YJdPpMv9e/6S9Tq+vAsxvGXXHCn0yvn4+Tog1uVh+sySg/177C8bYZin4+N3KmZBso/Dvli4XoZ1uKiCMEjZJZrLirS7bgt3MI7zt7Z5F22M7hNlIME4w4T30YzjdVjzNlRli+qHahI9egRMCgrEdgh5O9VumzvPAVkD3++cwjR/NXcbGAdhy5Se/JNua+47ZMeReUsDXygH//xbjdNg7hewuP/o=" id="7958"/></ActivationRequest>

In response, we forwrd the response from LimeLM web-api to the application with  the license file XML which looks like this:

<?xml version="1.0" encoding="utf-8"?>
<Response><activation data="nj3QcCDg8xnfRs8U9Fwxa/hwOOUr8cUhVmOkgS36ZRzetqu/1nAu8dDyiR5ipJlp5HRXuvUQhK62X7ghbPH3qHTUoxWnoNFnrb8yyQeCwhp9SRrIaHbr32Z8GcSAKn5FdtTjaBUXOAdwBcKTRJJ9e3NhhzbPaaG5tBjM9r3/ZwEJJ3xbPvw0h3CtkhUDtCFxx27UXz68OSKcVSu5LOGFDyUZCkJXN+NSuf7NCfuGO4dSkHuHoMuqWFbIWy3e/J+fNl1qL/FatNqmxc06fclAe6kHrwhhoPuvfL+erOm7+a7n9axD7q+tpIhXNgUq1yV74XaTQRfij/0ZRYt5jXC9+Q==" avm="0" ts="ACASEBkC5gc=" feats="AREAAABsYXN0X21vZGlmaWNhdGlvbgITAAAAMjAyMC0wMS0wMSAxMjowMDowMAEHAAAAZXhwRGF0ZQIEAAAATlVMTAEKAAAAbWF4VmVyc2lvbgIBAAAAMf8=" exp="GwLmBw=="/></Response>

We then write it in a temporary file and call TA_ActivateFromFile on it

QTemporaryFile tmpf;
   tmpf.setFileTemplate(QString("%1/XXXXXX_Resp.xml").arg(QDir::tempPath()));
   tmpf.open();
   tmpf.write(licenseFile.toUtf8());
   tmpf.close();
   qCInfo(DBG_LIC) << "Tmp file: " << tmpf.fileName();
   auto hr = TA_ActivateFromFile((uint32_t)handle,   tmpf.fileName().toStdWString().c_str());

This works fine on mac & linux but not on Windows

I must also add that when we added extra-data to ACTIVATE_OPTIONS, then the license activation file would look weird with chinese characters in it, indicating probably a bad encoding at some point:

<?xml version="1.0" encoding="utf-8"?>
<Response><activation data="D8/gnmg/ftMRWmqaiVIw87rygjs7eTIaq5sA1bfyto4veMRNUb1h07HNWruoD3NYifaCv/pLnptHPghldGp13ZhTjSOMQkFXbXqoeo72WsptltMnqEvXQ+3YWAg34PKcz7V+FbTaFTVb6mTl4hNLrBugwLb7aXNAawkhvTznQvYU0vQYTJyzmMeJSwcpf4d1Et3WFfw17IR7aaYZbdxIgeR59BbUBZgHYtARp/PRNGMrsW3uH9U1fL9Ux4fwj5TTbHDUFhZo8SgjeJjg5F5SilmqbQjOi0KoVmJpJceU6V02R1W84aJRoaOgdCAF4am9HpVDYh0LRdyL7WlDdta9BA==" avm="0" ts="ADgnDRkC5gc=" feats="AREAAABsYXN0X21vZGlmaWNhdGlvbgITAAAAMjAyMC0wMS0wMSAxMjowMDowMAEHAAAAZXhwRGF0ZQIEAAAATlVMTAEKAAAAbWF4VmVyc2lvbgIBAAAAMf8=" exp="GwLmBw==" exdata="慭档湩㩥䕔協何‬獵牥䌺祯潈ⱴ䤠㩐㤱⸲㘱⸸⸱㘲戀扶湧橨楫썯㊧椵甶祪卑杨噴奆晈硤癣晋剧根歪噬浃㙰㝭坬楯塪䍨朸晇ㅈ5"/></Response>
, edited

We tried all possibilities and tested with windows 21h1 and 21h2 … still the same….
it works fine with mac and linux, fail only with windows…
 

There's a lot of magic happening in those QStrings. Just use basic std::strings without switching back and forth between interpreted encodings, etc.

Also, the response has “extra data” which you say you're not using in the request.

So, something is going wrong in your request or response. Or the many funky transformations from string format A to string format B.

The only place it can go wrong is when we read the activation file:

auto requestContent = QString::fromUtf8(tmpf.readAll());

But this is pretty much straight forward (the xml file IS UTF-8). After that we know the encoding is botched because the reply we get from the server with the license file contains chinese characters for the extra-data part.  Switching to std::string is not going to change anything. It's not the UTF-8 to Unicode and back conversion that bring in the problem, there is no magic involved.

Also, the response has “extra data” which you say you're not using in the request.

I posted code after we removed all extra-data, although that didn't change anything.

Answer

I posted code after we removed all extra-data, although that didn't change anything.

Then you're using an old activation response.

Just run the process all in one go. And don't submit files using the web API: do it manually. Once you get things working manually you can debug what in your system is going wrong, but it's not TurboActivate. Something is mutilating the files.

If doing it manually is not working then take another step back and do it using the TurboActivate Wizard.

, edited

No, we're not using an old response and using the file from TA_ActivationRequestToFile manualy with your online form give us the same result !
can't activate… 
 

Using the TurboActivate Wizard?

 with https://wyday.com/limelm/activate/   it accept the xml generated and give us the same xml with chinese chars, and we can't activate with it … 

, edited
Answer

Use the TurboActivate Wizard to generate the files.

Once you get that to work, fix your code to generate activation requests correctly.

Just one precision :
when we use TA_Activate : it work, 
Ta_Deactivate : it work,
deactivate with xml request file for offline deactivation : It work too ! (and this one generate also an xml)
that's only TA_ActivationRequestToFile/TA_ActivateFromFile that is not working fine ! 
(and we don't give anything to TA_ActivationRequestToFile so how can we improve the request generation ? there is no room for that…)
so the only solution is to use the Exe wizard instead and drop our UI ?

Nope, it’s to prove the API is working correctly and that you should fix your code.

hummm… ok …  we give up .

Circling back on this: when we take the output of TA_ActivationRequestToFile and put it manually in the form on wyday, it works. When we manually call the web REST API (e.g: using Postman or using JS), passing to “act_req_xml” the output of TA_ActivationRequestToFile, passed into encodeURI() (as we do for all other parameters for all other requests), we always get “The activation block failed to decode”. 

Have you ever tried passing a manual activation file through the API ? I suspect something is wrong on the endpoint of the server, or there's a special handling for the “act_req_xml” that we should do, which is not documented.