Skip to content

Commit

Permalink
actions: lite version for playstore (fixes open-learning-exchange#2852)…
Browse files Browse the repository at this point in the history
… (open-learning-exchange#2863)

Co-authored-by: dogi <[email protected]>
  • Loading branch information
Okuro3499 and dogi authored Dec 20, 2023
1 parent 6700fb0 commit 1a9f194
Show file tree
Hide file tree
Showing 10 changed files with 1,124 additions and 105 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/android-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,40 @@ on:
push:
branches:
- 'master'
- '2852-make-special-less-feature-and-free-version-for-google-play'
workflow_dispatch:

jobs:
release:
name: myPlanet release
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
build: [default, lite]
env:
ANDROID_NDK_VERSION: "21.3.6528147"
BUILD_TOOLS_VERSION: "30.0.2"

steps:
- name: checkout repository code
uses: actions/checkout@v4
- name: diff the code to get lite
run: |
if [[ "${{ matrix.build }}" == "lite" ]]; then
echo "lite"
ls -al \
app/build.gradle \
app/src/main/AndroidManifest.xml \
app/src/main/java/org/ole/planet/myplanet/base/BaseContainerFragment.kt \
app/src/main/java/org/ole/planet/myplanet/base/PermissionActivity.java \
app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DashboardActivity.java
sed -i 's/\(versionName "[0-9.]\+\)"/\1-lite"/' app/build.gradle
cp app/src/main/AndroidManifest.xml.lite app/src/main/AndroidManifest.xml
cp app/src/main/java/org/ole/planet/myplanet/base/BaseContainerFragment.kt.lite app/src/main/java/org/ole/planet/myplanet/base/BaseContainerFragment.kt
cp app/src/main/java/org/ole/planet/myplanet/base/PermissionActivity.java.lite app/src/main/java/org/ole/planet/myplanet/base/PermissionActivity.java
cp app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DashboardActivity.java.lite app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DashboardActivity.java
fi
- name: set more env
run: echo "BRANCHNAME="${GITHUB_REF##*/} >> $GITHUB_ENV
Expand Down Expand Up @@ -67,7 +87,7 @@ jobs:
ls -alR output
- name: publish AAB to playstore
if: github.ref == 'refs/heads/master'
if: (github.ref == 'refs/heads/master') && (matrix.build == 'lite')
uses: r0adkll/[email protected]
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "org.ole.planet.myplanet"
minSdkVersion 21
targetSdkVersion 34
versionCode 1199
versionName "0.11.99"
versionCode 1200
versionName "0.12.00"
ndkVersion '21.3.6528147'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
Expand Down
20 changes: 8 additions & 12 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-feature
android:name="android.hardware.camera"
android:required="false" />
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
<uses-permission
android:name="android.permission.BLUETOOTH"
android:required="false" />
Expand All @@ -30,7 +27,10 @@
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
<!-- <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>-->

<uses-feature
android:name="android.hardware.camera"
android:required="false" />

<application
android:name=".MainApplication"
Expand Down Expand Up @@ -87,9 +87,7 @@
android:label="@string/title_activity_dashboard"
android:theme="@style/FullscreenTheme" />
<activity android:name=".ui.viewer.PDFReaderActivity" />

<service android:name=".datamanager.MyDownloadService" />

<activity android:name=".ui.viewer.WebViewActivity" />
<activity android:name=".ui.viewer.VideoPlayerActivity" />
<activity android:name=".ui.viewer.ImageViewerActivity" />
<activity android:name=".ui.viewer.TextFileViewerActivity" />
Expand All @@ -110,8 +108,6 @@
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>

<activity android:name=".ui.viewer.WebViewActivity" />
<service android:name=".datamanager.MyDownloadService" />
</application>

</manifest>
113 changes: 113 additions & 0 deletions app/src/main/AndroidManifest.xml.lite
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<!--<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>-->
<uses-permission
android:name="android.permission.BLUETOOTH"
android:required="false" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.SEND_DOWNLOAD_COMPLETED_INTENTS" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.REQUEST_WRITE_PERMISSION" />
<uses-permission
android:name="android.permission.PACKAGE_USAGE_STATS"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />

<uses-feature
android:name="android.hardware.camera"
android:required="false" />

<application
android:name=".MainApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_project_name"
android:largeHeap="true"
android:roundIcon="@mipmap/ic_launcher_round"
android:theme="@style/MyMaterialTheme"
android:usesCleartextTraffic="true"
tools:replace="android:label">
<activity
android:name=".ui.sync.LoginActivity"
android:exported="false" />
<activity android:name=".ui.chat.ChatActivity" />
<activity
android:name=".ui.userprofile.BecomeMemberActivity"
android:theme="@style/AppTheme" />
<activity
android:name=".ui.course.CourseProgressActivity"
android:theme="@style/AppTheme" />
<activity
android:name=".ui.news.NewsDetailActivity"
android:label="@string/title_activity_news_detail"
android:theme="@style/MyMaterialTheme.NoActionBar" />
<activity
android:name=".ui.myhealth.AddMyHealthActivity"
android:theme="@style/AppTheme" />
<activity
android:name=".ui.myhealth.AddExaminationActivity"
android:theme="@style/AppTheme" />
<activity android:name=".ui.map.OfflineMapActivity" />
<activity
android:name=".ui.news.ReplyActivity"
android:theme="@style/AppTheme" />
<activity
android:name=".ui.library.AddResourceActivity"
android:theme="@style/AppTheme" />
<activity
android:name=".ui.SplashActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ui.viewer.AudioPlayerActivity" />
<activity
android:name=".ui.feedback.FeedbackDetailActivity"
android:theme="@style/AppTheme" />
<activity
android:name=".ui.dashboard.DashboardActivity"
android:configChanges="orientation|screenSize|keyboardHidden"
android:label="@string/title_activity_dashboard"
android:theme="@style/FullscreenTheme" />
<activity android:name=".ui.viewer.PDFReaderActivity" />
<activity android:name=".ui.viewer.WebViewActivity" />
<activity android:name=".ui.viewer.VideoPlayerActivity" />
<activity android:name=".ui.viewer.ImageViewerActivity" />
<activity android:name=".ui.viewer.TextFileViewerActivity" />
<activity android:name=".ui.viewer.MarkdownViewerActivity" />
<activity android:name=".ui.viewer.CSVViewerActivity" />
<activity
android:name=".ui.dictionary.DictionaryActivity"
android:theme="@style/AppTheme" />
<activity
android:name=".ui.SettingActivity"
android:theme="@style/AppTheme" />
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="org.ole.planet.myplanet.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
<service android:name=".datamanager.MyDownloadService" />
</application>
</manifest>
Loading

0 comments on commit 1a9f194

Please sign in to comment.