Skip to content

Commit

Permalink
feat(version): show version number at test page
Browse files Browse the repository at this point in the history
  • Loading branch information
pengkobe committed Dec 11, 2018
1 parent fb3d29a commit bcddb4e
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ matrix:
- wget -c https://raw.githubusercontent.com/Pgyer/TravisFile/master/pgyer_upload.sh
-O pgyer_upload.sh
- chmod +x pgyer_upload.sh
- openssl aes-256-cbc -K $encrypted_8e49fe484714_key -iv $encrypted_8e49fe484714_iv -in ./sh/release/certificates.tar.enc -out ./sh/release/certificates.tar -d
- openssl aes-256-cbc -K $encrypted_28b1957c839b_key -iv $encrypted_28b1957c839b_iv -in ./sh/release/certificates.tar.enc -out ./sh/release/certificates.tar -d
- tar xvf ./sh/release/certificates.tar -C ./sh/release/certificates
before_script:
- chmod 755 ./sh/*.sh
Expand Down
1 change: 1 addition & 0 deletions config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,5 @@
<plugin name="cordova-android-support-gradle-release" spec="^2.0.1" />
<plugin name="cordova-hot-code-push-plugin" spec="^1.5.3" />
<engine name="android" spec="7.1.4" />
<plugin name="cordova-plugin-app-version" spec="^0.1.9" />
</widget>
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ionic4-boilerplate",
"version": "0.0.3",
"version": "0.0.4",
"author": "pengkobe",
"homepage": "http://github.com/pengkobe/ionic4-boilerplate",
"scripts": {
Expand Down Expand Up @@ -64,6 +64,7 @@
"cordova-android": "7.1.4",
"cordova-android-support-gradle-release": "^2.0.1",
"cordova-hot-code-push-plugin": "^1.5.3",
"cordova-plugin-app-version": "^0.1.9",
"cordova-plugin-appcenter-analytics": "^0.2.0",
"cordova-plugin-appcenter-crashes": "^0.2.0",
"cordova-plugin-appcenter-shared": "^0.2.0",
Expand Down Expand Up @@ -162,7 +163,8 @@
"cordova-plugin-appcenter-crashes": {},
"cordova-plugin-qrscanner": {},
"cordova-android-support-gradle-release": {},
"cordova-hot-code-push-plugin": {}
"cordova-hot-code-push-plugin": {},
"cordova-plugin-app-version": {}
},
"platforms": [
"android"
Expand Down
Binary file modified sh/release/certificates.tar.enc
Binary file not shown.
2 changes: 1 addition & 1 deletion sh/release/decrypt-key.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ if [[ ! -e "./sh/release/certificates.tar.enc" ]]; then
echo "Error: Missing encrypted certificates."
exit 1
fi
openssl aes-256-cbc -K $encrypted_8e49fe484714_key -iv $encrypted_8e49fe484714_iv -in ./sh/release/certificates.tar.enc -out ./sh/release/certificates.tar -d
openssl aes-256-cbc -K $encrypted_28b1957c839b_key -iv $encrypted_28b1957c839b_iv -in ./sh/release/certificates.tar.enc -out ./sh/release/certificates.tar -d
tar xvf ./sh/release/certificates.tar -C ./sh/release/certificates
2 changes: 2 additions & 0 deletions src/app/pages/test/test.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,6 @@
</ion-col>
</ion-row>
</ion-grid>

{{ versionNumber }}
</ion-content>
9 changes: 8 additions & 1 deletion src/app/pages/test/test.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import { GlobalService } from '@services/global.service';
import { EmitService } from '@services/emit.service';
import { AppCenterAnalytics } from '@ionic-native/app-center-analytics/ngx';
import { QRScannerModal } from '@modals/qr-scanner/qr-scanner';
declare var window;

@Component({
selector: 'page-test',
templateUrl: 'test.page.html',
})
export class TestPage {
isAlwaysLight = false;

versionNumber;
languageType: string;

options: EChartOption = {
Expand Down Expand Up @@ -72,6 +73,12 @@ export class TestPage {
this.languageType = this.globalservice.languageType
? this.globalservice.languageType
: 'zh';

if (window.cordova) {
window.cordova.getAppVersion.getVersionNumber().then(version => {
this.versionNumber = version;
});
}
}

async open(format: boolean = false) {
Expand Down

0 comments on commit bcddb4e

Please sign in to comment.