Skip to content

Commit

Permalink
Update lcrypto version and steps to build the project
Browse files Browse the repository at this point in the history
  • Loading branch information
kwart committed Dec 12, 2018
1 parent 663475a commit 791768d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 94 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ target/
.project
.classpath
.settings/

lcrypto-j2me*
41 changes: 22 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,45 +17,48 @@ You can simply build the software yourself.

You should have [git](http://git-scm.com/) installed

$ git clone git://github.com/kwart/totp-me.git
```bash
git clone git://github.com/kwart/totp-me.git
```

or you can download [current sources as a zip file](https://github.com/kwart/totp-me/archive/master.zip)

### How to build it

Download `lcrypto-j2me-xxx.zip` ("xxx" - current version of lcrypto, for example "lcrypto-j2me-156.zip")
from the [Bouncy Castle website](https://www.bouncycastle.org/latest_releases.html)
and extract it to new `lcrypto-j2me` folder.

Copy folder `totp-me/for-lcrypto-j2me/` contents to `lcrypto-j2me` folder.

Correct the lcrypto-j2me version number in `pom.xml` files
* `lcrypto-j2me/pom.xml`: find `<version>1.56</version>`
* `totp-me/pom.xml`: find `<artifactId>lcrypto-j2me</artifactId>` .. `<version>1.56</version>`

Install [Maven](https://maven.apache.org).

Build and install lcrypto-j2me
Download `lcrypto-j2me-xxx` archive ("xxx" - current version of lcrypto, for example "lcrypto-j2me-160.tar.gz")
from the [Bouncy Castle website](https://www.bouncycastle.org/latest_releases.html),
extract it and install the classes as a JAR file to your local repository:

$ cd lcrypto-j2me
$ mvn clean install
```bash
wget https://www.bouncycastle.org/download/lcrypto-j2me-160.tar.gz
tar xf ./lcrypto-j2me-160.tar.gz
mvn install:install-file -Dfile=lcrypto-j2me-160/zips/cldc_bccore_classes.zip -DgroupId=org.bouncycastle -DartifactId=lcrypto-j2me -Dversion=1.60 -Dpackaging=jar
```

Build totp-me
Build the `totp-me` and feed it with `lcrypto` version from the previous step:

$ cd ../totp-me
$ mvn clean package
```bash
mvn clean package -Dlcrypto.version=1.60
```

This default build uses Microemulator API implementation to simplify the build process, but it's only MIDP-2.0
implementation. To be sure the source code is __MIDP-1.0 compatible__, you should install Oracle WTK and provide
path to it to Maven as `wtk.home` system property

$ mvn clean package -Dwtk.home=/opt/WTK2.5.2
```bash
mvn clean package -Dwtk.home=/opt/WTK2.5.2
```

### How to run it in the Microemulator

Just use `exec:java` goal after you've successfully built the project
(provide lcrypto version if needed).

$ mvn exec:java
```bash
mvn exec:java -Dlcrypto.version=1.60
```

## License

Expand Down
74 changes: 0 additions & 74 deletions for-lcrypto-j2me/pom.xml

This file was deleted.

3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<microemulator.version>2.0.4</microemulator.version>
<lcrypto.version>1.60</lcrypto.version>

<midlet.vendor>${project.organization.name}</midlet.vendor>
<midlet.name>${project.name}</midlet.name>
Expand All @@ -44,7 +45,7 @@
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>lcrypto-j2me</artifactId>
<version>1.56</version>
<version>${lcrypto.version}</version>
</dependency>

<dependency>
Expand Down

0 comments on commit 791768d

Please sign in to comment.