Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepare for F-Droid #14

Merged
merged 4 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
prepare for F-Droid
  • Loading branch information
linsui committed Sep 11, 2024
commit 7368fcf7ab2a9c2bedb1a5d8f0a52ca74f9d9b06
16 changes: 11 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apply plugin: 'com.android.application'

android {
namespace 'fr.dzx.audiosource'
signingConfigs {
release {
def keystorePropertiesFile = rootProject.file("keystore.properties")
Expand All @@ -14,18 +15,22 @@ android {
}
}

compileSdkVersion 29
buildToolsVersion "29.0.3"
compileSdkVersion 34
buildToolsVersion "34.0.0"

defaultConfig {
applicationId "fr.dzx.audiosource"
minSdkVersion 14
targetSdkVersion 29
targetSdkVersion 34
versionCode 3
versionName '1.1'

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
signingConfig signingConfigs.release

vectorDrawables {
useSupportLibrary true
}
}

buildTypes {
Expand All @@ -36,13 +41,14 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.vectordrawable:vectordrawable:1.0.0'
}

if (project.hasProperty("SNDCPY_STORE_FILE")) {
Expand Down
8 changes: 5 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="fr.dzx.audiosource">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />

<application
Expand All @@ -13,6 +13,7 @@
android:theme="@android:style/Theme.Translucent.NoTitleBar">
<activity
android:name="fr.dzx.audiosource.MainActivity"
android:exported="true"
android:showWhenLocked="true"
android:turnScreenOn="true">
<intent-filter>
Expand All @@ -24,6 +25,7 @@
<service
android:name="fr.dzx.audiosource.RecordService"
android:enabled="true"
android:foregroundServiceType="microphone"
android:exported="false" />
</application>

Expand Down
7 changes: 5 additions & 2 deletions app/src/main/java/fr/dzx/audiosource/RecordService.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ public void onCreate() {
getNotificationManager().createNotificationChannel(channel);
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
startForeground(NOTIFICATION_ID, notification,
ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
startForeground(NOTIFICATION_ID, notification,
ServiceInfo.FOREGROUND_SERVICE_TYPE_NONE);
} else {
Expand Down Expand Up @@ -158,7 +161,7 @@ private Intent createStopIntent() {
private NotificationCompat.Action createStopAction() {
Intent stopIntent = createStopIntent();
PendingIntent stopPendingIntent = PendingIntent.getService(this, 0, stopIntent,
PendingIntent.FLAG_ONE_SHOT);
PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE);
String stopString = getString(R.string.action_stop);
NotificationCompat.Action.Builder actionBuilder = new NotificationCompat.Action.Builder(0
, stopString, stopPendingIntent);
Expand Down
7 changes: 3 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@

buildscript {
repositories {
mavenCentral()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath 'com.android.tools.build:gradle:8.5.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
mavenCentral()
google()
jcenter()

}
}

Expand Down
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/full_description.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Audio Source forwards Android microphone audio input to the PulseAudio daemon through ADB, so you can use your Android device as a USB microphone.
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/images/icon.png
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/short_description.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use an Android device as a USB microphone
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Dec 12 00:00:18 CET 2020
#Thu Sep 23 01:27:10 PDT 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip