From 9f3ed2456946870aa23c1f996cd5d59d59c381f1 Mon Sep 17 00:00:00 2001 From: Lukas Pieper <30661176+lukaspieper@users.noreply.github.com> Date: Fri, 1 Oct 2021 15:56:40 +0200 Subject: [PATCH 1/3] Add support for photo preview button Inspired by the solution from Calyx: https://gitlab.com/CalyxOS/platform_external_calyx_GCamPhotosPreview --- .github/workflows/continuous.yml | 16 +++++++--- app/build.gradle | 14 ++++++--- app/src/main/AndroidManifest.xml | 31 ++++++++++++++++++- .../gcam/{services => }/GServicesProvider.kt | 2 +- .../gcam/PreviewRedirectActivity.kt | 24 ++++++++++++++ 5 files changed, 75 insertions(+), 12 deletions(-) rename app/src/main/java/de/lukaspieper/gcam/{services => }/GServicesProvider.kt (97%) create mode 100644 app/src/main/java/de/lukaspieper/gcam/PreviewRedirectActivity.kt diff --git a/.github/workflows/continuous.yml b/.github/workflows/continuous.yml index f7a293e..5f8f99a 100644 --- a/.github/workflows/continuous.yml +++ b/.github/workflows/continuous.yml @@ -7,14 +7,20 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: set up JDK 11 uses: actions/setup-java@v1 with: java-version: '11' - - name: Build Debug APK with Gradle - run: ./gradlew assembleDebug - - name: Upload APK + + - name: Build basic APK with Gradle + run: ./gradlew assembleBasicDebug + + - name: Build photos APK with Gradle + run: ./gradlew assemblePhotosDebug + + - name: Upload APKs uses: actions/upload-artifact@v2 with: - name: App - path: ${{ github.workspace }}/app/build/outputs/apk/debug/app-debug.apk + name: APKs + path: ${{ github.workspace }}/app/build/outputs/apk/**/debug/*.apk diff --git a/app/build.gradle b/app/build.gradle index 3757dcf..b483c3c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,13 +11,17 @@ android { versionName "1.2" } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + flavorDimensions 'default' + productFlavors { + basic { + dimension 'default' + applicationId 'de.lukaspieper.gcam.services' + } + photos { + dimension 'default' + applicationId 'com.google.android.apps.photos' } } - } dependencies { diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 50e236f..04c5a28 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -9,13 +9,42 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" + android:theme="@android:style/Theme.NoDisplay" tools:targetApi="30"> + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/java/de/lukaspieper/gcam/services/GServicesProvider.kt b/app/src/main/java/de/lukaspieper/gcam/GServicesProvider.kt similarity index 97% rename from app/src/main/java/de/lukaspieper/gcam/services/GServicesProvider.kt rename to app/src/main/java/de/lukaspieper/gcam/GServicesProvider.kt index 604c3eb..01841d2 100644 --- a/app/src/main/java/de/lukaspieper/gcam/services/GServicesProvider.kt +++ b/app/src/main/java/de/lukaspieper/gcam/GServicesProvider.kt @@ -1,4 +1,4 @@ -package com.google.android.gms +package de.lukaspieper.gcam import android.content.ContentProvider import android.content.ContentValues diff --git a/app/src/main/java/de/lukaspieper/gcam/PreviewRedirectActivity.kt b/app/src/main/java/de/lukaspieper/gcam/PreviewRedirectActivity.kt new file mode 100644 index 0000000..ad57bb5 --- /dev/null +++ b/app/src/main/java/de/lukaspieper/gcam/PreviewRedirectActivity.kt @@ -0,0 +1,24 @@ +package de.lukaspieper.gcam + +import android.app.Activity +import android.os.Bundle +import android.util.Log +import android.content.Intent + +class PreviewRedirectActivity : Activity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + Log.d(javaClass.simpleName, intent.toString()) + + if (intent.`package` == packageName) { + intent.data?.let { uri -> + val intent = Intent(Intent.ACTION_VIEW, uri) + startActivity(intent) + } + } + + finish() + } +} From 51a86e413c80bf525c1a25538ee1e1f96cdd1993 Mon Sep 17 00:00:00 2001 From: Lukas Pieper <30661176+lukaspieper@users.noreply.github.com> Date: Fri, 1 Oct 2021 19:18:09 +0200 Subject: [PATCH 2/3] Update README.md --- README.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 20e2c7a..eeecbff 100644 --- a/README.md +++ b/README.md @@ -3,20 +3,29 @@ [![continuous](https://github.com/lukaspieper/Gcam-Services-Provider/workflows/continuous/badge.svg)](https://github.com/lukaspieper/Gcam-Services-Provider/actions) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/lukaspieper/Gcam-Services-Provider/blob/master/LICENSE) -This app "simulates" the Google Play Services that the Google Camera app (Gcam) requires, allowing the camera app to be used on devices without Google Play Services. Note that this app comes without Ui and therefore has no icon in the app drawer. But of course it is listed in the Android settings (e.g. for uninstallation). +This app "simulates" the Google Play Services that the Google Camera app (Gcam) requires, allowing the camera app to be used on devices without Google Play Services. Note that this app comes without UI and therefore has no icon in the app drawer. But of course it is listed in the Android settings (e.g. for uninstallation). ### What is the difference between this app and [microG](https://github.com/microg)? -microG is a open source re-implementation of the Google Play Services. Among other things, [signature spoofing](https://github.com/microg/android_packages_apps_GmsCore/wiki/Signature-Spoofing) is used to achieve this goal. In comparison, this app has only one goal: to get Gcam running without Play Services. Therefore this app does not need any security compromising hacks or permissions (no Internet access, no storage access and of course no root access needed). +microG is a open source re-implementation of the Google Play Services (client side). Among other things, [signature spoofing](https://github.com/microg/android_packages_apps_GmsCore/wiki/Signature-Spoofing) is used to achieve this goal. In comparison, this app only aims to get Gcam running without Play Services. Therefore this app does not need any security compromising hacks or permissions (no Internet access, no storage access and of course no root access needed). ### How to install this app If you can, the recommended way is to build the app from source. After all, software is usually a matter of trust. Alternatively you can find an apk for sideloading under [releases](https://github.com/lukaspieper/Gcam-Services-Provider/releases). +Currently there are two versions of this app named "basic" and "photos". "Basic" includes everything you need to get Gcam running but the button showing the last photo in full size will not work. The "photos" version has all features from "basic" and adds support for this button but you cannot have the Google Photos app installed for technical reasons. + +In short: if you have Google Photos installed go with "basic" else install the "photos" version. + ### Compatibility |Google camera version|Requirements |Relevant issues | |---------------------|------------------------------------|---------------------------------------------------------------------------------------------| -|7.4 | | | -|7.5 |`--force-queryable` |[#6](https://github.com/lukaspieper/Gcam-Services-Provider/issues/6) | +|7.4 & 7.5 | | | |>=7.6 |Compatible Android OS or modded Gcam|[#22](https://github.com/lukaspieper/Gcam-Services-Provider/issues/22#issuecomment-814239882)| + +### Known from/recommended by + +- [XDA Developers](https://www.xda-developers.com/google-camera-port-hub/) +- [GCam Hub (celsoazevedo)](https://www.celsoazevedo.com/files/android/google-camera/troubleshooting/) +- [Kuketz-Blog (German IT security and privacy blog)](https://www.kuketz-blog.de/?s=gcam+services+provider) \ No newline at end of file From 75bbc647ea8bb26fedcc8b4343b0a5abdcd2a4df Mon Sep 17 00:00:00 2001 From: Lukas Pieper <30661176+lukaspieper@users.noreply.github.com> Date: Fri, 1 Oct 2021 19:26:31 +0200 Subject: [PATCH 3/3] Increase version to 1.3 --- app/build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b483c3c..70cdac7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,8 +7,8 @@ android { defaultConfig { minSdkVersion 19 targetSdkVersion 30 - versionCode 3 - versionName "1.2" + versionCode 4 + versionName "1.3" } flavorDimensions 'default' @@ -26,5 +26,5 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" }