tag:infinitekind.tenderapp.com,2009-01-14:/discussions/moneydance-development/7042-building-extensions-without-entering-the-security-key-pass-codeInfinite Kind: Discussion 2023-06-23T23:00:20Ztag:infinitekind.tenderapp.com,2009-01-14:Comment/502155822022-02-18T14:22:10Z2022-02-18T14:22:10ZBuilding extensions without entering the security key pass code<div><p>Mike,<br>
Another user here:<br>
I tried many times a few years ago and never could find a way. I even asked the developer and he said he had no way to suggest (at that time). Been a few years.<br>
I was using Eclipse at the time but I now use IntelliJ. Haven't found a way.</p>
<p>Hopefully, someone can tell us how!</p></div>Dan Ptag:infinitekind.tenderapp.com,2009-01-14:Comment/502155822022-02-18T14:23:01Z2022-02-18T14:23:01ZBuilding extensions without entering the security key pass code<div><p>Which pass code? Do you mean to sign the mxt or do u mean to logon to a MD dataset?</p></div>Stuart Beesley (Mr Toolbox)tag:infinitekind.tenderapp.com,2009-01-14:Comment/502155822022-02-18T15:32:00Z2022-02-18T15:32:00ZBuilding extensions without entering the security key pass code<div><p>Stuart, the passcode you enter when adding the sign to the mxt. It is the code you create when creating the keys.</p></div>Mike Bray (Quote Loader Author)tag:infinitekind.tenderapp.com,2009-01-14:Comment/502155822022-02-18T15:43:10Z2022-02-18T15:43:10ZBuilding extensions without entering the security key pass code<div><p>This may not help but I use a shell script to build my mxt files and I feed the code in via a redirect from a text file.</p>
<p>I did try automating in Ant via IntelliJ but I just ended up with a locked screen that was awaiting input from nowhere.</p></div>Stuart Beesley (Mr Toolbox)tag:infinitekind.tenderapp.com,2009-01-14:Comment/502155822022-02-18T16:57:16Z2022-02-18T16:57:16ZBuilding extensions without entering the security key pass code<div><p>The MoneyPie extension seems to have built-in a class to do this:<br>
<a href="https://github.com/TheInfiniteKind/moneydance_open/blob/main/src/com/moneydance/modules/features/moneyPie/SignMxt.java">https://github.com/TheInfiniteKind/moneydance_open/blob/main/src/co...</a></p>
<p>I've not tried it myself, but it might help. In general we really do need a way to automate this built-in to the signing tool.</p>
<p>-- Sean Reilly<br>
Director/Developer, The Infinite Kind<br>
infinitekind.com</p></div>Sean Reillytag:infinitekind.tenderapp.com,2009-01-14:Comment/502155822022-02-19T11:26:40Z2022-02-19T11:26:40ZBuilding extensions without entering the security key pass code<div><p>Thanks Sean</p>
<p>This fix redirects Standard input stream to a file containing the<br>
passcode. On the surface it should work. I don't know if it is possible<br>
to add another parameter to KeyAdmin that takes the passcode and passes<br>
through to the code that asks for the passcode.</p>
<p>I will experiment with the fix.<br>
Mike</p></div>Mike Bray (Quote Loader Author)tag:infinitekind.tenderapp.com,2009-01-14:Comment/502155822022-02-19T13:31:49Z2022-02-19T13:52:29ZBuilding extensions without entering the security key pass code<div><p>Based on the fix from Moneypie I have got this working. The fix as written does not work, it relies on redirecting standard in to a file. KeyAdmin uses a Console so this does not work, however, if you read the passcode and set the System property "moneydance_key_pass" to the pass code KeyAdmin reads this instead of from Standard In.</p>
<p>Here is the amended code for the fix:<br></p>
<pre>
<code>import com.moneydance.admin.KeyAdmin;
import java.io.FileInputStream;
import java.io.File;
import java.io.FileNotFoundException;
public class SignMxt {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try
{
FileInputStream fis = new FileInputStream(new File("sign_pw.txt"));
String code="";
int content;
while ((content=fis.read())!=-1) {
code +=(char)content;
}
System.setProperty("moneydance_key_pass",code);
System.setIn(fis);
KeyAdmin.main(args);
}
catch (FileNotFoundException fnfe)
{
System.out.println(fnfe.getMessage());
}
catch (Exception ex)
{
System.out.println(ex.getMessage());
}
}
}</code>
</pre>
Enclosed is a jar, copy the jar to your lib directory and change your build.xml to include:<br>
<pre>
<code> <pathelement path="${lib}/signmxt.jar"/></code>
</pre>
change your build file to use SignMxt instead of KeyAdmin<br>
<pre>
<code> <java newenvironment="true" classpathref="classpath" classname="SignMxt">
<arg value="signextjar" />
<arg value="${privkeyfile}" />
<arg value="${privkeyid}" />
<arg value="reportwriter2" />
<arg line="${dist}/reportwriter2.mxt" />
</java></code>
</pre>
Create a file called "sign_pw.txt" containing your passcode in your src directory.</div>Mike Bray (Quote Loader Author)tag:infinitekind.tenderapp.com,2009-01-14:Comment/502155822022-02-19T14:59:41Z2022-02-19T14:59:41ZBuilding extensions without entering the security key pass code<div><p>Thanks Mike! It works perfectly.<br>
I would note this. I originally put the passcode in a text file with a carriage return. That caused a padding error in the build. Removing the carriage return works fine.</p></div>Dan Ptag:infinitekind.tenderapp.com,2009-01-14:Comment/502155822022-02-20T16:07:07Z2022-02-20T16:07:07ZBuilding extensions without entering the security key pass code<div><p>FWIW, I modified your code slightly to accommodate people like me who enter a carriage return after the passcode.</p>
<pre>
<code> while ((content=fis.read())!=-1) {
if (content > 31) {
code += (char) content;
}
}</code>
</pre>
<p>Thoughts?</p></div>Dan Ptag:infinitekind.tenderapp.com,2009-01-14:Comment/502155822022-02-21T06:04:56Z2022-02-21T06:04:56ZBuilding extensions without entering the security key pass code<div><p>Looks good, also I can remove the redirection of System.setIn</p></div>Mike Bray (Quote Loader Author)tag:infinitekind.tenderapp.com,2009-01-14:Comment/502155822022-02-23T13:43:22Z2022-02-23T13:43:22ZBuilding extensions without entering the security key pass code<div><p>I have updated the jar based on Dan's suggestion. This now accepts cr at the end of the line</p></div>Mike Bray (Quote Loader Author)tag:infinitekind.tenderapp.com,2009-01-14:Comment/502155822022-03-04T05:00:54Z2022-03-04T05:01:00ZBuilding extensions without entering the security key pass code<div><p>How can I build extensions without entering the security pass code?</p>
<p>Extensions are software programs designed to extend the functionality of other applications. They allow users to add features that may not otherwise be possible (or at least easy) to achieve through traditional means. In order to build custom software using extensions, they first need to be installed on your device. Extensions can then be created from any standard web browser. Once installed, the extensions can be added to any application simply by tapping the extension icon. To remove an extension, tap the app name once again, this time holding down the home button until a pop-up menu appears. Select ‘Remove’ and it should uninstall. Once you've removed them, the icons should disappear from your Home screen. You'll still have to enter the security passcode each time you want access to those apps, though.</p></div>patriciajoglesbytag:infinitekind.tenderapp.com,2009-01-14:Comment/502155822022-03-04T14:31:17Z2022-03-04T14:31:17ZBuilding extensions without entering the security key pass code<div><p>I think you might be confusing browser extensions with Moneydance extensions. Two different processes.</p></div>Dan Ptag:infinitekind.tenderapp.com,2009-01-14:Comment/502155822023-03-24T18:50:37Z2023-03-24T18:50:37ZBuilding extensions without entering the security key pass code<div><p>OK, just looked into this... Sorry to ask a daft question, but why not just set:<br>
keypass=<br>
into the file ./src/user.properties ?<br>
I just tried it, and the standard build.xml works using this.<br>
Thoughts?</p></div>Stuart Beesley (Mr Toolbox)tag:infinitekind.tenderapp.com,2009-01-14:Comment/502155822023-03-24T20:17:25Z2023-03-24T20:17:25ZBuilding extensions without entering the security key pass code<div><p>I don't follow. Where is user.properties used? In the build file?</p></div>Dan Ptag:infinitekind.tenderapp.com,2009-01-14:Comment/502155822023-03-24T20:40:05Z2023-03-24T20:40:05ZBuilding extensions without entering the security key pass code<div><p>The std build.xml file loads user.properties (and its variables). It then puts keypass into a system property which is read by the std signing jar/process. In fact, Mike’s jar basically does the same and sets the very same system property to achieve the same result. So as far as I can see, it’s already possible and works for me.</p></div>Stuart Beesley (Mr Toolbox)tag:infinitekind.tenderapp.com,2009-01-14:Comment/502155822023-03-24T22:09:16Z2023-03-24T22:09:16ZBuilding extensions without entering the security key pass code<div><p>I guess I'm the daft one. It doesn't work for me. Could I have user.preferences in the wrong place? It's in the directory where the build file is.</p></div>Dan Ptag:infinitekind.tenderapp.com,2009-01-14:Comment/502155822023-03-24T22:18:04Z2023-03-24T22:18:04ZBuilding extensions without entering the security key pass code<div><p>Are you using a build file based on this one?</p>
<p><a href="https://github.com/TheInfiniteKind/moneydance_open/blob/main/src/build.xml">https://github.com/TheInfiniteKind/moneydance_open/blob/main/src/bu...</a></p>
<p>Take a look and you will see user.properties and also keypass= sections.</p>
<p>??</p></div>Stuart Beesley (Mr Toolbox)tag:infinitekind.tenderapp.com,2009-01-14:Comment/502155822023-03-24T22:57:12Z2023-03-24T22:57:12ZBuilding extensions without entering the security key pass code<div><p>I'm still using variations of the original build file from the developers package.<br>
I added the user.properties file and the keypass entries and it works for me too.<br>
Your solution is a lot easier but I've already put Mike's solution in the build files I use.<br>
I'll need to start the process of reviewing all the build files.<br>
Thanks!</p></div>Dan P