Merge branch 'feature/calyx-image-preview'

This commit is contained in:
Lukas Pieper 2021-10-01 19:29:43 +02:00
commit 3e143a8f71
6 changed files with 91 additions and 19 deletions

View file

@ -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

View file

@ -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)

View file

@ -7,20 +7,24 @@ android {
defaultConfig {
minSdkVersion 19
targetSdkVersion 30
versionCode 3
versionName "1.2"
versionCode 4
versionName "1.3"
}
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 {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}

View file

@ -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">
<provider
android:name="com.google.android.gms.GServicesProvider"
android:name="de.lukaspieper.gcam.GServicesProvider"
android:authorities="com.google.android.gsf.gservices"
android:exported="true"
tools:ignore="ExportedContentProvider" />
<activity
android:name="de.lukaspieper.gcam.PreviewRedirectActivity"
android:exported="true">
<!-- Credits to Calyx developers: -->
<!-- https://gitlab.com/CalyxOS/platform_external_calyx_GCamPhotosPreview -->
<intent-filter>
<action android:name="com.android.camera.action.REVIEW" />
<action android:name="android.provider.action.REVIEW" />
<action android:name="android.provider.action.REVIEW_SECURE" />
<action android:name="com.google.android.apps.photos.mars.api.ACTION_REVIEW" />
<action android:name="com.google.android.apps.photos.mars.api.ACTION_REVIEW_SECURE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="content" />
<data android:mimeType="image/*" />
<data android:mimeType="application/vnd.google.panorama360+jpg" />
</intent-filter>
<!-- Needed only so GCam can query for and find us -->
<intent-filter>
<action android:name="android.intent.action.SEND" />
<data android:mimeType="image/*" />
</intent-filter>
</activity>
</application>
</manifest>

View file

@ -1,4 +1,4 @@
package com.google.android.gms
package de.lukaspieper.gcam
import android.content.ContentProvider
import android.content.ContentValues

View file

@ -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()
}
}