Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .maestro/flows/app-navigation.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
appId: com.ogh.app
appId: org.aossie.ogh
name: App navigation and settings
tags: [smoke]
---
Expand Down
2 changes: 1 addition & 1 deletion .maestro/flows/destination-crud.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
appId: com.ogh.app
appId: org.aossie.ogh
name: Manual destination CRUD
tags: [smoke]
---
Expand Down
2 changes: 1 addition & 1 deletion .maestro/flows/twitch-authorization-page.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
appId: com.ogh.app
appId: org.aossie.ogh
name: Twitch authorization page loads
tags: [oauth, network]
---
Expand Down
2 changes: 1 addition & 1 deletion .maestro/flows/youtube-authorization-page.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
appId: com.ogh.app
appId: org.aossie.ogh
name: YouTube authorization page loads
tags: [oauth, network]
---
Expand Down
2 changes: 1 addition & 1 deletion DECISIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ requiring Google Play Services.

Track the public YouTube and Twitch client IDs in Android string resources.
YouTube uses AppAuth Authorization Code with PKCE in the system browser and
`com.ogh.app:/oauth2callback`, requesting only the `youtube` scope. Twitch uses
`org.aossie.ogh:/oauth2callback`, requesting only the `youtube` scope. Twitch uses
its public-client Device Authorization Grant and `channel:read:stream_key`.
Never embed a client secret.

Expand Down
4 changes: 2 additions & 2 deletions OAUTH_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ slow-down, denial and expiration.
3. Configure the OAuth consent screen, support contact, and exactly one scope:
`https://www.googleapis.com/auth/youtube`.
4. Complete Google's OAuth app verification before distributing a build that requests YouTube management scopes.
5. Create the native/Android OAuth client for package `com.ogh.app` and the
5. Create the native/Android OAuth client for package `org.aossie.ogh` and the
signing certificate used for the distributed build. Obtain a signing SHA-1
with:

Expand All @@ -76,7 +76,7 @@ slow-down, denial and expiration.

### Redirect requirement

Ogh returns from the browser through `com.ogh.app:/oauth2callback`. The
Ogh returns from the browser through `org.aossie.ogh:/oauth2callback`. The
redirect scheme in `OAuthConfig.kt`, the manifest intent filter, and the Google
Android client's custom-scheme setting must all agree. Validate the complete
flow on both standard and de-Googled Android using the final signed review APK.
Expand Down
4 changes: 2 additions & 2 deletions SPECIFICATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ of that implementation. If it drifts, verify the code and tests and update this
file; do not change working behavior merely to make it match stale prose.

The current deliverable is the Android application. Its application ID,
namespace, OAuth redirect identity, and Maestro app ID are `com.ogh.app`.
namespace, OAuth redirect identity, and Maestro app ID are `org.aossie.ogh`.
Android 7.0/API 24 is the minimum version; compile and target SDK are 36.

The name Ogh comes from Sanskrit *ogha* (ओघ), meaning a stream, current,
Expand Down Expand Up @@ -435,7 +435,7 @@ tab. It does not use Google Sign-In or require Google Play Services.
|---|---|
| Authorization endpoint | `https://accounts.google.com/o/oauth2/v2/auth` |
| Token endpoint | `https://oauth2.googleapis.com/token` |
| Redirect | `com.ogh.app:/oauth2callback` |
| Redirect | `org.aossie.ogh:/oauth2callback` |
| Scope | `https://www.googleapis.com/auth/youtube` |
| Extra authorization parameter | `access_type=offline` |
| API base | `https://www.googleapis.com/youtube/v3` |
Expand Down
4 changes: 2 additions & 2 deletions androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ check(releaseSigningValues.all { it.isNullOrBlank() } || hasReleaseSigning) {
}

android {
namespace = "com.ogh.app"
namespace = "org.aossie.ogh"
compileSdk = (findProperty("android.compileSdk") as String).toInt()

defaultConfig {
applicationId = "com.ogh.app"
applicationId = "org.aossie.ogh"
Comment on lines +29 to +33
minSdk = (findProperty("android.minSdk") as String).toInt()
targetSdk = (findProperty("android.targetSdk") as String).toInt()
versionCode = appVersionCode
Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="com.ogh.app" />
<data android:scheme="org.aossie.ogh" />
</intent-filter>
</activity>

Expand Down
22 changes: 11 additions & 11 deletions androidApp/src/main/kotlin/com/ogh/app/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ogh.app
package org.aossie.ogh

import android.Manifest
import android.content.ComponentName
Expand Down Expand Up @@ -33,16 +33,16 @@ import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.repeatOnLifecycle
import androidx.lifecycle.ViewModelProvider
import com.ogh.app.oauth.OAuthConfig
import com.ogh.app.oauth.OAuthManager
import com.ogh.app.oauth.TokenManager
import com.ogh.app.oauth.TwitchDeviceAuthClient
import com.ogh.app.oauth.YouTubeApiClient
import com.ogh.app.oauth.GoogleTokenRevoker
import com.ogh.app.data.SecureDestinationStorage
import com.ogh.app.data.SettingsRepository
import com.ogh.app.viewmodel.StreamViewModel
import com.ogh.app.ui.StreamPreview
import org.aossie.ogh.oauth.OAuthConfig
import org.aossie.ogh.oauth.OAuthManager
import org.aossie.ogh.oauth.TokenManager
import org.aossie.ogh.oauth.TwitchDeviceAuthClient
import org.aossie.ogh.oauth.YouTubeApiClient
import org.aossie.ogh.oauth.GoogleTokenRevoker
import org.aossie.ogh.data.SecureDestinationStorage
import org.aossie.ogh.data.SettingsRepository
import org.aossie.ogh.viewmodel.StreamViewModel
import org.aossie.ogh.ui.StreamPreview
import com.ogh.shared.ui.AboutScreen
import com.ogh.shared.ui.AboutUiState
import com.ogh.shared.ui.AccountsScreen
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ogh.app
package org.aossie.ogh

import android.content.Context
import android.graphics.Bitmap
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ogh.app
package org.aossie.ogh

import android.content.Context
import android.hardware.SensorManager
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ogh.app
package org.aossie.ogh

import android.content.Context
import android.graphics.SurfaceTexture
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ogh.app
package org.aossie.ogh

import android.app.NotificationChannel
import android.app.NotificationManager
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.ogh.app.data
package org.aossie.ogh.data

import android.content.Context
import android.util.Log
import com.ogh.app.oauth.AndroidKeystoreTokenStorage
import org.aossie.ogh.oauth.AndroidKeystoreTokenStorage
import com.ogh.shared.domain.Destination
import com.ogh.shared.domain.DestinationType
import org.json.JSONArray
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ogh.app.data
package org.aossie.ogh.data

import android.content.Context
import androidx.datastore.preferences.core.Preferences
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ogh.app.oauth
package org.aossie.ogh.oauth

import android.content.Context
import android.security.keystore.KeyGenParameterSpec
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ogh.app.oauth
package org.aossie.ogh.oauth

import okhttp3.FormBody
import okhttp3.OkHttpClient
Expand Down
6 changes: 3 additions & 3 deletions androidApp/src/main/kotlin/com/ogh/app/oauth/OAuthConfig.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.ogh.app.oauth
package org.aossie.ogh.oauth

import android.content.Context
import androidx.core.net.toUri
import com.ogh.app.R
import org.aossie.ogh.R
import com.ogh.shared.domain.StreamingProvider
import net.openid.appauth.AuthorizationServiceConfiguration

Expand All @@ -16,7 +16,7 @@ import net.openid.appauth.AuthorizationServiceConfiguration
object OAuthConfig {

/** Redirect URI scheme — must match AndroidManifest.xml intent filter. */
const val REDIRECT_URI = "com.ogh.app:/oauth2callback"
const val REDIRECT_URI = "org.aossie.ogh:/oauth2callback"

fun getServiceConfig(provider: StreamingProvider): AuthorizationServiceConfiguration {
return when (provider) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ogh.app.oauth
package org.aossie.ogh.oauth

import android.content.Context
import android.content.Intent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ogh.app.oauth
package org.aossie.ogh.oauth

import android.content.Context
import android.util.Log
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ogh.app.oauth
package org.aossie.ogh.oauth

import com.ogh.shared.domain.ProviderAccount
import com.ogh.shared.domain.StreamingProvider
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ogh.app.oauth
package org.aossie.ogh.oauth

import com.ogh.shared.domain.LatencyMode
import com.ogh.shared.domain.PrivacyStatus
Expand Down
4 changes: 2 additions & 2 deletions androidApp/src/main/kotlin/com/ogh/app/ui/StreamPreview.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ogh.app.ui
package org.aossie.ogh.ui

import android.Manifest
import android.content.pm.PackageManager
Expand Down Expand Up @@ -26,7 +26,7 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.unit.dp
import androidx.compose.ui.viewinterop.AndroidView
import androidx.core.content.ContextCompat
import com.ogh.app.ScreenCaptureService
import org.aossie.ogh.ScreenCaptureService
import com.ogh.shared.domain.StreamState
import com.ogh.shared.domain.VideoSettings
import com.ogh.shared.ui.theme.OghColors
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.ogh.app.viewmodel
package org.aossie.ogh.viewmodel

import android.content.Intent
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.pedro.common.ConnectChecker
import com.ogh.app.ScreenCaptureService
import com.ogh.app.data.AppSettingsStore
import org.aossie.ogh.ScreenCaptureService
import org.aossie.ogh.data.AppSettingsStore
import com.ogh.shared.data.DestinationRepository
import com.ogh.shared.domain.AppSettings
import com.ogh.shared.domain.AudioSettings
Expand Down
2 changes: 1 addition & 1 deletion androidApp/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
them registered to this project. Never add client secrets, access tokens,
refresh tokens, or stream keys here.
-->
<string name="youtube_client_id" translatable="false">12650804497-pklvchb6l6prgmlnlpnejc3g8ovr25o9.apps.googleusercontent.com</string>
<string name="youtube_client_id" translatable="false">12650804497-7d7an3ldp5hapfngnct3lofbaddd52af.apps.googleusercontent.com</string>
<string name="twitch_client_id" translatable="false">0ierwbtq6sams93ds7kpsrr5mkd6vv</string>
</resources>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ogh.app
package org.aossie.ogh

import android.content.pm.ActivityInfo
import android.hardware.camera2.CameraCharacteristics
Expand Down
6 changes: 3 additions & 3 deletions androidApp/src/test/kotlin/com/ogh/app/StreamViewModelTest.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ogh.app
package org.aossie.ogh

import com.ogh.app.data.AppSettingsStore
import com.ogh.app.viewmodel.StreamViewModel
import org.aossie.ogh.data.AppSettingsStore
import org.aossie.ogh.viewmodel.StreamViewModel
import com.ogh.shared.domain.AppSettings
import com.ogh.shared.domain.AudioSettings
import com.ogh.shared.domain.LatencyMode
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ogh.app.data
package org.aossie.ogh.data

import com.ogh.shared.domain.Destination
import org.junit.Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ogh.app.data
package org.aossie.ogh.data

import com.ogh.shared.domain.AppSettings
import com.ogh.shared.domain.AudioSettings
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ogh.app.oauth
package org.aossie.ogh.oauth

import okhttp3.mockwebserver.MockResponse
import okhttp3.mockwebserver.MockWebServer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ogh.app.oauth
package org.aossie.ogh.oauth

import com.ogh.shared.domain.StreamingProvider
import org.junit.Test
Expand All @@ -16,6 +16,6 @@ class OAuthConfigTest {

@Test
fun youtube_redirectMatchesDocumentedAndroidCustomSchemeForm() {
assertEquals("com.ogh.app:/oauth2callback", OAuthConfig.REDIRECT_URI)
assertEquals("org.aossie.ogh:/oauth2callback", OAuthConfig.REDIRECT_URI)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ogh.app.oauth
package org.aossie.ogh.oauth

import com.ogh.shared.domain.ProviderAccount
import com.ogh.shared.domain.StreamingProvider
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ogh.app.oauth
package org.aossie.ogh.oauth

import com.ogh.shared.domain.StreamMetadata
import okhttp3.mockwebserver.MockResponse
Expand Down