Moodle Mobile Automatic Building System: Difference between revisions
- Moodle Mobile Customization
- Setting up your development environment for Moodle Mobile 2
- Moodle Mobile development using Chrome or Chromium
- Mobile support for plugins
- Moodle Mobile Themes
- Moodle Mobile debugging WS requests
- Open the Moodle app from another app
- Moodle Mobile FAQ
- See all Moodle App pages
- See pages for Moodle App Ionic 5 (current)
- See pages for Moodle App Ionic 3 (legacy)
- See pages Moodle App Ionic 1 (legacy)
- See pages for Moodle App Phonegap (legacy)
For user documentation see Moodle Mobile
Juan Leyva (talk | contribs) |
No edit summary |
||
(6 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{Template:WillNotMigrate}} | |||
{{Moodle App (Ionic 3)}} | |||
{{obsolete}} | |||
== Introduction == | == Introduction == | ||
An automatic building system helps a | An automatic building system helps developers a lot, they can focus on writing good code and forget all about building/compiling and all the boring stuff. | ||
Phonegap Build is an example of a powerful build system, but it has a big limitation for Moodle Mobile | Phonegap Build is an example of a powerful build system, but it has a big limitation for Moodle Mobile; it doesn't support some Phonegap plugins we use for the Android app. | ||
Implementing an automatic building system for Android is quite simple using | Implementing an automatic building system for Android is quite simple using 3rd party applications as described bellow: | ||
== Automatic Build System for Android == | == Automatic Build System for Android == | ||
Line 11: | Line 15: | ||
=== Requirements === | === Requirements === | ||
* The MoodleMobile .apk file or your custom app .apk file. You need to perform an initial build on Android. See [[Moodle Mobile Building the app for Android]] for more info. | * The MoodleMobile .apk file or your custom app .apk file. You need to perform an initial build on Android. See [[Moodle Mobile Building the app for Android]] for more info or obtain the current .apk file from Google Play using software like real apk leecher | ||
* android-apktool - http://code.google.com/p/android-apktool/ | * android-apktool - http://code.google.com/p/android-apktool/ | ||
Line 61: | Line 65: | ||
jarsigner -verbose -verify -keystore certificates/keystore mynewapk.apk ** Optional | jarsigner -verbose -verify -keystore certificates/keystore mynewapk.apk ** Optional | ||
zipalign -v 4 mynewapk.apk mynewapkReadyForPlayStore.apk | zipalign -v 4 mynewapk.apk mynewapkReadyForPlayStore.apk | ||
== See also == | |||
https://github.com/jleyva/moodlemobile-scripts For sample code |
Latest revision as of 07:14, 29 April 2022
Warning: This page is no longer in use. The information contained on the page should NOT be seen as relevant or reliable. |
Moodle App (Ionic 3 - legacy)
Warning: This page is no longer in use. The information contained on the page should NOT be seen as relevant or reliable. |
Introduction
An automatic building system helps developers a lot, they can focus on writing good code and forget all about building/compiling and all the boring stuff.
Phonegap Build is an example of a powerful build system, but it has a big limitation for Moodle Mobile; it doesn't support some Phonegap plugins we use for the Android app.
Implementing an automatic building system for Android is quite simple using 3rd party applications as described bellow:
Automatic Build System for Android
Requirements
- The MoodleMobile .apk file or your custom app .apk file. You need to perform an initial build on Android. See Moodle Mobile Building the app for Android for more info or obtain the current .apk file from Google Play using software like real apk leecher
- android-apktool - http://code.google.com/p/android-apktool/
- jarsigner - Part of the Java JDK
Steps
1 Extract your .apk file template in a directory (apktool d path/to/yourApp.apk path/to/output-folder)
2 Download from moodlehq/moodlemobile repository the last files to -> path/to/output-folder/assets/www directory (where all the html, css, js files are stored)
3 Re-build the .apk file (apktool b path/to/output-folder path/to/yourAppV2.apk )
4 Re-sign the .apk file (jarsigner -verbose -keystore ~/.android/debug.keystore path/to/yourAppV2.apk androiddebugkey)
That's all, as you can see once you haven an original .apk file, extract, add your modifications and re-package is very simple
Automatic script
Say you have:
1 /opt/moodlemobile/repository/... 2 /opt/moodlemobile/apk-templates/myapp.apk 3 /opt/moodlemobile/tmpdir 4 /opt/moodlemobile/certificates
1 A cloned git repository of your code
2 Your original .apk file built with Android SDK
3 An empty dir
4 Certificate key store dir. The keystore is created using keytool, see http://docs.oracle.com/javase/1.3/docs/tooldocs/win32/keytool.html Also see: http://developer.android.com/tools/building/building-cmdline.html and http://developer.android.com/tools/publishing/app-signing.html
The script
cd /opt/moodlemobile rm -rf tmpdir/* cd repository git pull cd ../ apktool d apk-templates/myapp.apk tmpdir/ cp -r repository/* tmpdir/assets/www/
vi tmpdir/AndroidManifest.xml (debug must be false, bump version code and change version name)
apktool b tmpdir mynewapp.apk jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore certificates/keystore mynewapk.apk mycertificatealiasinsidekeystore jarsigner -verbose -verify -keystore certificates/keystore mynewapk.apk ** Optional zipalign -v 4 mynewapk.apk mynewapkReadyForPlayStore.apk
See also
https://github.com/jleyva/moodlemobile-scripts For sample code