Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
peterluo3131 committed May 19, 2023
0 parents commit 8394019
Show file tree
Hide file tree
Showing 114 changed files with 3,908 additions and 0 deletions.
110 changes: 110 additions & 0 deletions .github/workflows/android-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Android Release
env:
main_project_module: app
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
permissions: write-all
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
# Set Current Date As Env Variable
- name: Set current date as env variable
run: echo "date_today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV

# Set Repository Name As Env Variable
- name: Set repository name as env variable
run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV

- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: gradle

- name: Create file
run: cat /home/runner/work/RisingPhone/RisingPhone/app/google-services.json | base64

- name: Putting data
env:
DATA: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $DATA > /home/runner/work/RisingPhone/RisingPhone/app/google-services.json

- name: Grant execute permission for gradlew
run: chmod +x gradlew

# Run Tests Build
- name: Run gradle tests
run: ./gradlew test

- name: Build with Gradle
run: ./gradlew build

- name: Archive lint results
if: always()
uses: actions/upload-artifact@v3
with:
name: lint-report
path: app/build/reports/lint-results-debug.html

# Create APK Debug
- name: Build apk debug project (APK) - ${{ env.main_project_module }} module
run: ./gradlew assembleDebug

# Create APK Release
- name: Build apk release project (APK) - ${{ env.main_project_module }} module
run: ./gradlew assemble

# Create Bundle AAB Release
# Noted for main module build [main_project_module]:bundleRelease
- name: Build app bundle release (AAB) - ${{ env.main_project_module }} module
run: ./gradlew ${{ env.main_project_module }}:bundleRelease

# Upload Artifact Build
# Noted For Output [main_project_module]/build/outputs/apk/debug/
- name: Upload APK Debug - ${{ env.repository_name }}
uses: actions/upload-artifact@v2
with:
name: ${{ env.date_today }} - ${{ env.playstore_name }} - ${{ env.repository_name }} - APK(s) debug generated
path: ${{ env.main_project_module }}/build/outputs/apk/debug/

# Noted For Output [main_project_module]/build/outputs/apk/release/
- name: Upload APK Release - ${{ env.repository_name }}
uses: actions/upload-artifact@v2
with:
name: ${{ env.date_today }} - ${{ env.playstore_name }} - ${{ env.repository_name }} - APK(s) release generated
path: ${{ env.main_project_module }}/build/outputs/apk/release/

# Noted For Output [main_project_module]/build/outputs/bundle/release/
- name: Upload AAB (App Bundle) Release - ${{ env.repository_name }}
uses: actions/upload-artifact@v2
with:
name: ${{ env.date_today }} - ${{ env.playstore_name }} - ${{ env.repository_name }} - App bundle(s) AAB release generated
path: ${{ env.main_project_module }}/build/outputs/bundle/release/

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

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.RISINGANDROID_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.main_project_module }}/build/outputs/apk/debug/app-debug.apk # Update this with the correct APK path
asset_name: app-release-unsigned.apk
asset_content_type: application/vnd.android.package-archive
45 changes: 45 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Android CI

on:
push:
branches: [ "main", "develop" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: gradle

- name: Create file
run: cat /home/runner/work/RisingPhone/RisingPhone/app/google-services.json | base64

- name: Putting data
env:
DATA: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $DATA > /home/runner/work/RisingPhone/RisingPhone/app/google-services.json

- name: Grant execute permission for gradlew
run: chmod +x gradlew
# Run Tests Build
- name: Run gradle tests
run: ./gradlew test

- name: Build with Gradle
run: ./gradlew build

- name: Archive lint results
if: always()
uses: actions/upload-artifact@v3
with:
name: lint-report
path: app/build/reports/lint-results-debug.html
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
*.iml
.gradle
/local.properties
/.idea
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
/app/google-services.json
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# RisingAndroid

The goal of this project is to develop a phone operating system that replaces the traditional UI of an Android-based smartphone with ChatGPT. The AI will manage control of all apps via plugins, which can be prompted by the user.


## Demo

<p align='center'>
<img align='center' src='assets/img/output.gif' width='250px' height='500px'/>
</p>


## Documentation

### Architecture

<p align='center'>
<img align='center' src='assets/img/arch.jpg'/>
</p>

### Features

| Title | Description |
| ------------ | ------------ |
| General Chat | Users can chat with AI plugins. |
| Open Browser Automatically | If a user is going to open browser, the app opens browser and search what a user wants automatically |
| Image Search System | A user can search image on Android local storage |
| Send SMS | If a user says that send SMS, mobile open SMS editor and a user can send SMS using the editor. |

### Run locally
- Copy google-services.json into app folder of project

### CI/CD
- set google-services.json to github secrets

## Test
- Unit Test
- Instrumented Test
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
90 changes: 90 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'com.google.gms.google-services'
}

android {
namespace 'com.matthaigh27.chatgptwrapper'
compileSdk 33

defaultConfig {
applicationId "com.matthaigh27.chatgptwrapper"
minSdk 28
targetSdk 33
versionCode 1
versionName "1.4"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

buildFeatures {
viewBinding true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11
}

dataBinding {
enabled true
}
}

dependencies {
// App dependencies
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.6.0'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

implementation platform('com.google.firebase:firebase-bom:31.4.0')
implementation 'com.google.android.gms:play-services-gcm:17.0.0'

implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-firestore-ktx:24.4.5'
implementation 'com.google.firebase:firebase-firestore:15.0.0'

implementation 'com.google.firebase:firebase-messaging-ktx'
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.firebaseui:firebase-ui-storage:7.2.0'

implementation 'com.squareup.okhttp3:okhttp:3.0.1'
implementation 'com.github.soulqw:CoCo:1.1.2'
implementation 'com.github.dhaval2404:imagepicker:2.1'
implementation 'com.google.firebase:firebase-storage-ktx:20.1.0'
testImplementation 'org.testng:testng:6.9.6'

// Testing-only dependencies
androidTestImplementation 'androidx.test:core:' + rootProject.coreVersion;
androidTestImplementation 'androidx.test.ext:junit:' + rootProject.extJUnitVersion;
androidTestImplementation 'androidx.test:runner:' + rootProject.runnerVersion;

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

// UiAutomator Testing
androidTestImplementation 'androidx.test.uiautomator:uiautomator:' + rootProject.uiAutomatorVersion;
androidTestImplementation 'org.hamcrest:hamcrest-integration:1.3'

implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.2"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.2"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.2.0-alpha05"

implementation 'com.github.bumptech.glide:glide:4.12.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
}
21 changes: 21 additions & 0 deletions app/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
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.matthaigh27.chatgptwrapper

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class

ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.matthaigh27.chatgptwrapper", appContext.packageName)
}
}
Loading

0 comments on commit 8394019

Please sign in to comment.