Skip to content

Commit

Permalink
Merge branch 'dev' into main
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/ci.yml
  • Loading branch information
MaxBQb committed Jun 1, 2021
2 parents c01fa08 + 5c50b64 commit 94e6a3a
Show file tree
Hide file tree
Showing 216 changed files with 9,293 additions and 255 deletions.
63 changes: 57 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,76 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Java CI with Gradle
name: Java Android CI with Gradle

on:
push:
branches: [ main, future ]
tags:
- v*

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'

- name: Grant execute permission for decrypt
run: chmod +x ./app/decrypt.sh

- name: Decrypt secret
env:
SECRET_PASSPHRASE: ${{ secrets.SECRET_FB_PASSPHRASE }}
run: ./app/decrypt.sh

- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build

- name: Test application
run: ./gradlew test

- name: Build APK
run: ./gradlew assembleRelease

- name: Sign app APK
uses: r0adkll/sign-android-release@v1
id: sign_app
with:
releaseDirectory: app/build/outputs/apk/release/
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: "29.0.3"

- name: Upload APK
uses: actions/upload-artifact@v2
with:
name: Signed app bundle
path: ${{steps.sign_app.outputs.signedReleaseFile}}

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.sign_app.outputs.signedReleaseFile }}
asset_name: Stager.apk
asset_content_type: application/apk
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ gradle-app.setting
*.keystore

# Google Services (e.g. APIs or Firebase)
# google-services.json
google-services.json

# Android Patch

Expand Down Expand Up @@ -400,4 +400,5 @@ obj/

!/gradle/wrapper/gradle-wrapper.jar

# End of https://www.toptal.com/developers/gitignore/api/windows,linux,android,androidstudio,gradle,java,firebase,jetbrains
# End of https://www.toptal.com/developers/gitignore/api/windows,linux,android,androidstudio,gradle,java,firebase,jetbrains
/app/src/main/java/main/stager/SECRETS.java
2 changes: 1 addition & 1 deletion .idea/compiler.xml

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

1 change: 1 addition & 0 deletions .idea/gradle.xml

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

10 changes: 10 additions & 0 deletions .idea/jarRepositories.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/vcs.xml

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

13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
<p align="center">
<a href="../../releases/latest">
<img src="./app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png" height="60">
</a>
</p>

# project-three_musketeers
project-three_musketeers created by GitHub Classroom

# Тема проекта - мобильное приложение.
Создание мобильного приложения, минимум - для отслеживания состояния человека (в дороге, дома, на работе), максимум - возможность отслеживания произвольных поэтапных процессов (минимум - один из шаблонов).

# Как запустить приложение:
# Как запустить приложение (самый простой способ):
1. [`>>> СКАЧАТЬ <<<`](../../releases/latest) Stager.apk на телефон (Android 4.1+)
2. Запустить установку Stager.apk (Требуется разрешить установку из неизвестных источников)
3. Если у Вас уже установлен Stager, а новая версия не ставится - попробуйте предварительно удалить старую :)

# Как запустить приложение (сложный способ):
( В данном варианте нет подключения к БД разработчиков, вам нужно будет самим создать свою БД и добавить файл google-services.json в проект )
#### 1 вариант:
1. Установить:
Expand Down
40 changes: 33 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
}

android {
Expand All @@ -10,15 +11,18 @@ android {
applicationId "main.stager"
minSdkVersion 16
targetSdkVersion 30
multiDexEnabled true
versionCode 1
versionName "1.0"
ndkVersion '21.2.6472646'

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}

buildTypes {
release {
minifyEnabled false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
Expand All @@ -29,10 +33,32 @@ android {
}

dependencies {
implementation "com.android.volley:volley:1.2.0"
implementation "androidx.multidex:multidex:2.0.1"
implementation "com.github.YarikSOffice:lingver:1.3.0"
implementation "androidx.appcompat:appcompat:1.3.0"
implementation "androidx.constraintlayout:constraintlayout:2.0.4"
implementation "com.google.firebase:firebase-database:20.0.0"
implementation "com.google.firebase:firebase-auth:21.0.1"
implementation "androidx.preference:preference:1.1.1"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation "androidx.recyclerview:recyclerview:1.2.0"
implementation "com.google.android.material:material:1.3.0"
implementation "androidx.navigation:navigation-fragment:2.3.5"
implementation "androidx.navigation:navigation-ui:2.3.5"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.1"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1"
implementation "androidx.navigation:navigation-runtime:2.3.5"
implementation "com.google.firebase:firebase-messaging:22.0.0"
testImplementation "junit:junit:4.13.2"
androidTestImplementation "androidx.test.ext:junit:1.1.2"
androidTestImplementation "androidx.test.espresso:espresso-core:3.3.0"

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
compileOnly "org.projectlombok:lombok:1.18.18"
annotationProcessor "org.projectlombok:lombok:1.18.18"

testCompileOnly "org.projectlombok:lombok:1.18.18"
testAnnotationProcessor "org.projectlombok:lombok:1.18.18"

implementation "com.rockerhieu:rv-adapter-states:1.2"
}
7 changes: 7 additions & 0 deletions app/decrypt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
cd app
gpg --quiet --batch --yes --decrypt --passphrase="$SECRET_PASSPHRASE" \
--output "google-services.json" "google-services.json.gpg"
cd src/main/java/main/stager
gpg --quiet --batch --yes --decrypt --passphrase="$SECRET_PASSPHRASE" \
--output "SECRETS.java" "SECRETS.java.gpg"
Binary file added app/google-services.json.gpg
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package main.stager;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
32 changes: 29 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,46 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="main.stager">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

<application
android:name=".StagerApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:label="@string/Application_title"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Stager">
<activity android:name=".MainActivity">

<service android:name=".MyFirebaseMessagingService"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
<action android:name="com.google.firebase.MESSAGING_EVENT" />
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>

<activity android:name=".MainActivity"
android:launchMode="singleTop"
android:configChanges="orientation|screenSize"/>

<activity
android:name=".Authorization"
android:configChanges="orientation|screenSize"
android:noHistory="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Registration"
android:label="@string/AuthorizationActivity_Button_Register"
android:configChanges="orientation|screenSize"
android:noHistory="true" />
</application>

</manifest>
Binary file added app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 94e6a3a

Please sign in to comment.