Skip to content

Commit

Permalink
Merge pull request #12 from novid20org/feature/release-101
Browse files Browse the repository at this point in the history
SDK Release 1.0.1
  • Loading branch information
christxph authored Apr 11, 2020
2 parents 6532f6f + 8ff2e68 commit 33fa67c
Show file tree
Hide file tree
Showing 28 changed files with 580 additions and 136 deletions.
130 changes: 130 additions & 0 deletions .idea/codeStyles/Project.xml

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

6 changes: 6 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

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

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This is the source code of the SDK powering the NOVID20 Android apps. Note: This
More info: [NOVID20.org](https://novid20.org)

## Authors
* [Christoph Kührer](https://christoph.tech/)
* [Christoph Kührer](https://christoph.tech/)
* [Dipl. Ing. Florian Knoll, Bsc.](http://www.mss-knoll.at/)

## License
Expand Down
159 changes: 159 additions & 0 deletions bitrise.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
---
format_version: '8'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: android
trigger_map:
- push_branch: master
workflow: deploy-master
- push_branch: "*"
workflow: primary
- pull_request_source_branch: "*"
workflow: primary
workflows:
primary:
steps:
- [email protected]:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- [email protected]: {}
- [email protected]: {}
- [email protected]:
inputs:
- gradlew_path: "$PROJECT_LOCATION/gradlew"
- [email protected]:
inputs:
- new_version_name: 1.0.$BITRISE_BUILD_NUMBER
- build_gradle_path: "$PROJECT_LOCATION/$MODULE/build.gradle"
- gradle-runner@1:
title: gradlew assemble
inputs:
- gradle_file: "./app/build.gradle"
- gradlew_path: "./gradlew"
- [email protected]:
inputs:
- android_app: "./app/build/outputs/apk/georgiaDev/release/app-georgia-dev-release-unsigned.apk|./app/build/outputs/apk/georgiaLive/release/app-georgia-live-release-unsigned.apk|./app/build/outputs/apk/novidDev/release/app-novid-dev-release-unsigned.apk|./app/build/outputs/apk/novidLive/release/app-novid-live-release-unsigned.apk"
- script@1:
title: Move APKs to Bitrise Deploy Dir
inputs:
- content: |
#!/usr/bin/env bash
# fail if any commands fails
set -e
# debug log
set -x
echo "Moving APKs to Bitrise Deploy dir: $BITRISE_DEPLOY_DIR"
mv ./app/build/outputs/apk/*/*/*.apk $BITRISE_DEPLOY_DIR
- [email protected]: {}
- [email protected]: {}
envs:
- opts:
is_expand: false
VARIANT: novidDevDebug
deploy-master:
description: |
## How to get a signed APK
This workflow contains the **Sign APK** step. To sign your APK all you have to do is to:
1. Click on **Code Signing** tab
1. Find the **ANDROID KEYSTORE FILE** section
1. Click or drop your file on the upload file field
1. Fill the displayed 3 input fields:
1. **Keystore password**
1. **Keystore alias**
1. **Private key password**
1. Click on **[Save metadata]** button
That's it! From now on, **Sign APK** step will receive your uploaded files.
## To run this workflow
If you want to run this workflow manually:
1. Open the app's build list page
2. Click on **[Start/Schedule a Build]** button
3. Select **deploy** in **Workflow** dropdown input
4. Click **[Start Build]** button
Or if you need this workflow to be started by a GIT event:
1. Click on **Triggers** tab
2. Setup your desired event (push/tag/pull) and select **deploy** workflow
3. Click on **[Done]** and then **[Save]** buttons
The next change in your repository that matches any of your trigger map event will start **deploy** workflow.
steps:
- [email protected]:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- [email protected]: {}
- [email protected]: {}
- [email protected]:
inputs:
- gradlew_path: "$PROJECT_LOCATION/gradlew"
- [email protected]:
inputs:
- new_version_name: 1.0.$BITRISE_BUILD_NUMBER
- build_gradle_path: "$PROJECT_LOCATION/$MODULE/build.gradle"
- [email protected]:
inputs:
- project_location: "$PROJECT_LOCATION"
- module: "$MODULE"
- variant: "$VARIANT"
- [email protected]:
inputs:
- project_location: "$PROJECT_LOCATION"
- module: "$MODULE"
- variant: "$VARIANT"
- [email protected]:
inputs:
- project_location: "$PROJECT_LOCATION"
- module: "$MODULE"
- variant: "$VARIANT"
title: Android Build Novid20
- [email protected]:
run_if: '{{getenv "BITRISEIO_ANDROID_KEYSTORE_URL" | ne ""}}'
title: Android Sign Novid20
- [email protected]:
inputs:
- app: "$FIREBASE_APP_ID_NOVID"
- groups: dolphin-members, novid20, novid20-link
- firebase_token: "$FIREBASE_TOKEN"
title: Firebase Distribute Novid20
- [email protected]:
inputs:
- project_location: "$PROJECT_LOCATION"
- module: "$MODULE"
- variant: georgiaLiveRelease
title: Android Build Goergia
- [email protected]:
run_if: '{{getenv "BITRISEIO_ANDROID_KEYSTORE_URL" | ne ""}}'
title: Android Sign Georgia
- [email protected]:
inputs:
- app: "$FIREBASE_APP_ID_GEORGIA"
- groups: dolphin-members, novid20, novid20-link
- firebase_token: "$FIREBASE_TOKEN"
title: Firebase Distribute Georgia
- [email protected]: {}
- [email protected]: {}
envs:
- opts:
is_expand: false
VARIANT: novidLiveRelease
- opts:
is_expand: false
FIREBASE_APP_ID_NOVID: 1:441057994010:android:491b10ff9700c12c4578a3
- opts:
is_expand: false
FIREBASE_APP_ID_GEORGIA: 1:441057994010:android:69844fabc4ed569a4578a3
app:
envs:
- opts:
is_expand: false
PROJECT_LOCATION: "."
- opts:
is_expand: false
MODULE: app
- opts:
is_expand: false
VARIANT: novidDevDebug
8 changes: 4 additions & 4 deletions novid-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ android {
defaultConfig {
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
versionCode 101
versionName "1.0.1"
consumerProguardFiles 'consumer-rules.pro'

buildConfigField 'String', 'API_ENDPOINT', '"https://novid.org/your/api/"'
}

buildTypes {
Expand Down Expand Up @@ -46,8 +48,6 @@ dependencies {
implementation "com.google.android.gms:play-services-location:17.0.0"
implementation 'com.google.android.gms:play-services-nearby:17.0.0'

implementation 'com.google.firebase:firebase-analytics:17.3.0'

implementation "com.squareup.okhttp3:okhttp:4.4.0"
implementation "com.squareup.okhttp3:logging-interceptor:4.4.0"
implementation 'com.google.code.gson:gson:2.8.6'
Expand Down
Empty file added novid-sdk/consumer-rules.pro
Empty file.
21 changes: 21 additions & 0 deletions novid-sdk/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
2 changes: 2 additions & 0 deletions novid-sdk/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />

<uses-feature android:name="android.hardware.bluetooth_le" />

<!-- Notification -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import androidx.core.app.NotificationCompat
import androidx.core.content.ContextCompat

private const val TAG = "NotificationService"

internal const val NOTIFICATION_ID = 13
internal const val NOTIFICATION_CHANNEL = "NOVID_CHANNEL"
const val NOTIFICATION_MESSAGE_ID = 14
Expand Down
8 changes: 7 additions & 1 deletion novid-sdk/src/main/java/org/novid20/sdk/NovidBootReceiver.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@ import android.content.Intent

private const val TAG = "NotificationService"

/**
* This class is triggered whenever the device boots.
* By launching this service, the Application class is also initialized
* and the Application class should have the NovidSdk initialization
* code in it and will also start the application.
*/
class NovidBootReceiver : BroadcastReceiver() {

@SuppressLint("UnsafeProtectedBroadcastReceiver")
override fun onReceive(context: Context?, intent: Intent?) {
Logger.debug(TAG, "onReceive")
Logger.debug(TAG, "NovidBootReceiver triggered and Application class initialized.")
}

}
Loading

0 comments on commit 33fa67c

Please sign in to comment.