Closed seza443 closed 7 years ago
How to have a self-signed certificate and use it to sign an app: http://www.androiddevelopment.org/tag/apk/
Now with my self-signed certificate, I can build a signed apk using:
ionic run android --prod --release -- --keystore=../path-to-keystore.keystore --alias=alias
Next error I encountered is related to Fabric:
This app relies on Crashlytics. Please sign up for access at https://fabric.io/sign_up,
I resolved it by removing than re-adding the plugin Also, I resolved it by removing my app from Fabrix dashboard
Next error I encountered is:
Failed to validate the certificate chain, error: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
So either we add our self-signed flynn certificate to the app #134 Or we generate a real, trusted certificate using Let's encrypt -> expires every 90 days
ref #134 <-- once this is done, the app, built in release mode, will be able to communicate with the backend <-- we will be able to deploy it on the Play Store 😉
⚠️ For delete http call, we still use Angular/Http since Ionic/HTTP does not support it yet ( https://github.com/wymsee/cordova-HTTP/issues/111 and the pull request is https://github.com/wymsee/cordova-HTTP/pull/105/files?diff=split&short_path=04c6e90 )
First, let's add a certificate to Flynn: https://blog.ryl.io/post/letsencrypt-with-flynn/
certbot certonly --manual --preferred-challenges dns
Certificate expires 18-08-2017
Stored in : /etc/letsencrypt/live/doctors.happi-doctor.be/fullchain.pem
Let's update the routes
First show the routes ID with flynn -a geohealth-happifrontend-master route
Then update the route to use the certificate:
HAppi frontend for doctor:
flynn -a geohealth-happifrontend-master route update http/094dd97c-3151-4fef-b000-327fe0953c7d --tls-cert /etc/letsencrypt/live/doctors.happi-doctor.be/fullchain.pem --tls-key /etc/letsencrypt/live/doctors.happi-doctor.be/privkey.pem
flynn -a geohealth-happifrontend-master route update http/086b1add-3570-481d-b39c-fbf333751d2d --tls-cert /etc/letsencrypt/live/doctors.happi-doctor.be/fullchain.pem --tls-key /etc/letsencrypt/live/doctors.happi-doctor.be/privkey.pem
API HAppi prod
flynn -a geohealth-happibackend-prod route update http/b699f90c-ae52-49a3-aea9-74cddfe6cbb5 --tls-cert /etc/letsencrypt/live/doctors.happi-doctor.be/fullchain.pem --tls-key /etc/letsencrypt/live/doctors.happi-doctor.be/privkey.pem
Okay l'app fonctionne avec le certificat.
Small guide: http://ionicframework.com/docs/v1/guide/publishing.html
https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#signing-an-app