mirror of
https://github.com/adolfintel/OpenPods.git
synced 2026-09-14 23:06:11 -04:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
32f8fce6a6 | ||
|
|
df49fac764 | ||
|
|
bfbfa0a942 | ||
|
|
cf97f48b39 | ||
|
|
966a8689ff | ||
|
|
e7e7323135 | ||
|
|
afb013a1bd | ||
|
|
4e4f7ea3b6 | ||
|
|
509ecd00c5 | ||
|
|
0b8f178531 | ||
|
|
d089b350ea | ||
|
|
8167e84c7d | ||
|
|
7b23d3e1e7 | ||
|
|
158dfe2382 | ||
|
|
71c5f61638 | ||
|
|
067b39aaa7 | ||
|
|
faef81399d | ||
|
|
f00ff42980 | ||
|
|
195fb9520a | ||
|
|
6da1ab1d7d | ||
|
|
67b8ea654f | ||
|
|
b345a91630 | ||
|
|
69c2577c12 | ||
|
|
cd8e855428 | ||
|
|
53377a60c8 | ||
|
|
4fc0b39aa9 | ||
|
|
c2a42f2015 | ||
|
|
ae5a1ab119 | ||
|
|
50fa300c04 | ||
|
|
7d8d286350 | ||
|
|
65cef15357 | ||
|
|
ea1743a3fa | ||
|
|
783ab3c018 | ||
|
|
9c86da7115 | ||
|
|
25cbcae171 |
Generated
+6
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CompilerConfiguration">
|
||||||
|
<bytecodeTargetLevel target="11" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+1
@@ -15,6 +15,7 @@
|
|||||||
</set>
|
</set>
|
||||||
</option>
|
</option>
|
||||||
<option name="resolveModulePerSourceSet" value="false" />
|
<option name="resolveModulePerSourceSet" value="false" />
|
||||||
|
<option name="useQualifiedModuleNames" value="true" />
|
||||||
</GradleProjectSettings>
|
</GradleProjectSettings>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
Generated
+5
@@ -21,5 +21,10 @@
|
|||||||
<option name="name" value="Google" />
|
<option name="name" value="Google" />
|
||||||
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
|
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
|
||||||
</remote-repository>
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="MavenRepo" />
|
||||||
|
<option name="name" value="MavenRepo" />
|
||||||
|
<option name="url" value="https://repo.maven.apache.org/maven2/" />
|
||||||
|
</remote-repository>
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
Generated
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
|
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
|
||||||
</configurations>
|
</configurations>
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
|||||||
Generated
+1
@@ -3,6 +3,7 @@
|
|||||||
<component name="RunConfigurationProducerService">
|
<component name="RunConfigurationProducerService">
|
||||||
<option name="ignoredProducers">
|
<option name="ignoredProducers">
|
||||||
<set>
|
<set>
|
||||||
|
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
||||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 29
|
compileSdkVersion 30
|
||||||
buildToolsVersion '30.0.0'
|
buildToolsVersion '30.0.3'
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.dosse.airpods"
|
applicationId "com.dosse.airpods"
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 29
|
targetSdkVersion 30
|
||||||
versionCode 15
|
versionCode 17
|
||||||
versionName '1.5'
|
versionName '1.6'
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
@@ -33,7 +33,6 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
implementation 'androidx.appcompat:appcompat:1.3.0'
|
||||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
|
||||||
implementation "androidx.preference:preference:1.1.1"
|
implementation "androidx.preference:preference:1.1.1"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
package="com.dosse.airpods">
|
package="com.dosse.airpods">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
|
||||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
||||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||||
@@ -66,8 +66,8 @@
|
|||||||
<service
|
<service
|
||||||
android:name=".PodsService"
|
android:name=".PodsService"
|
||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:exported="true"
|
android:exported="false"
|
||||||
tools:ignore="ExportedService" />
|
android:foregroundServiceType="location" />
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
|||||||
@@ -4,44 +4,32 @@ import android.Manifest;
|
|||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.PowerManager;
|
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Locale;
|
||||||
import java.util.Timer;
|
import java.util.Timer;
|
||||||
import java.util.TimerTask;
|
import java.util.TimerTask;
|
||||||
|
|
||||||
public class IntroActivity extends AppCompatActivity {
|
public class IntroActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private Timer timer;
|
private Timer timer;
|
||||||
|
private TextView msg;
|
||||||
|
private Button btn;
|
||||||
|
|
||||||
@SuppressLint("BatteryLife")
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate (Bundle savedInstanceState) {
|
protected void onCreate (Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_intro);
|
setContentView(R.layout.activity_intro);
|
||||||
|
|
||||||
// Allow button clicked, ask for permissions
|
msg = findViewById(R.id.permsMsg);
|
||||||
findViewById(R.id.allowBtn).setOnClickListener(view -> {
|
btn = findViewById(R.id.permsBtn);
|
||||||
requestPermissions(new String[] {Manifest.permission.ACCESS_COARSE_LOCATION}, 1); // Location (for BLE)
|
|
||||||
// Run in background
|
|
||||||
try {
|
|
||||||
if (!Objects.requireNonNull(getSystemService(PowerManager.class)).isIgnoringBatteryOptimizations(getPackageName())) {
|
|
||||||
Intent intent = new Intent();
|
|
||||||
getSystemService(Context.POWER_SERVICE);
|
|
||||||
intent.setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
|
|
||||||
intent.setData(Uri.parse("package:" + getPackageName()));
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
|
||||||
} catch (Throwable ignored) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Wait for permissions to be granted.
|
// Wait for permissions to be granted.
|
||||||
// When they are granted, go to MainActivity.
|
// When they are granted, go to MainActivity.
|
||||||
@@ -49,18 +37,9 @@ public class IntroActivity extends AppCompatActivity {
|
|||||||
timer.scheduleAtFixedRate(new TimerTask() {
|
timer.scheduleAtFixedRate(new TimerTask() {
|
||||||
@Override
|
@Override
|
||||||
public void run () {
|
public void run () {
|
||||||
boolean ok = true;
|
initScreen();
|
||||||
|
|
||||||
try {
|
if (PermissionUtils.checkAllPermissions(IntroActivity.this)) {
|
||||||
if (!Objects.requireNonNull(getSystemService(PowerManager.class)).isIgnoringBatteryOptimizations(getPackageName()))
|
|
||||||
ok = false;
|
|
||||||
} catch (Throwable ignored) {
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ContextCompat.checkSelfPermission(IntroActivity.this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED)
|
|
||||||
ok = false;
|
|
||||||
|
|
||||||
if (ok) {
|
|
||||||
timer.cancel();
|
timer.cancel();
|
||||||
startActivity(new Intent(IntroActivity.this, MainActivity.class));
|
startActivity(new Intent(IntroActivity.this, MainActivity.class));
|
||||||
finish();
|
finish();
|
||||||
@@ -78,4 +57,46 @@ public class IntroActivity extends AppCompatActivity {
|
|||||||
timer.cancel();
|
timer.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int getPermissionState () {
|
||||||
|
if (!PermissionUtils.getBatteryOptimizationsPermission(this))
|
||||||
|
return 1;
|
||||||
|
else if (!PermissionUtils.getFineLocationPermission(this))
|
||||||
|
return 2;
|
||||||
|
else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) if (!PermissionUtils.getBackgroundLocationPermission(this))
|
||||||
|
return 3;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("BatteryLife")
|
||||||
|
private void initScreen () {
|
||||||
|
int step = getPermissionState();
|
||||||
|
int numOfSteps = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) ? 3 : 2;
|
||||||
|
|
||||||
|
switch (step) {
|
||||||
|
case 1:
|
||||||
|
msg.setText(String.format(Locale.getDefault(), "%s %d/%d: %s", getString(R.string.intro_step), step, numOfSteps, getString(R.string.intro_bat_perm)));
|
||||||
|
btn.setOnClickListener(view -> {
|
||||||
|
Intent intent = new Intent();
|
||||||
|
getSystemService(Context.POWER_SERVICE);
|
||||||
|
intent.setAction(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS);
|
||||||
|
intent.setData(Uri.parse("package:" + getPackageName()));
|
||||||
|
startActivity(intent);
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
msg.setText(String.format(Locale.getDefault(), "%s %d/%d: %s", getString(R.string.intro_step), step, numOfSteps, getString(R.string.intro_loc1_perm)));
|
||||||
|
btn.setOnClickListener(view -> requestPermissions(new String[] {Manifest.permission.ACCESS_FINE_LOCATION}, 101)); // Location (for BLE)
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
msg.setText(String.format(Locale.getDefault(), "%s %d/%d: %s", getString(R.string.intro_step), step, numOfSteps, getString(R.string.intro_loc2_perm)));
|
||||||
|
btn.setOnClickListener(view -> {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) requestPermissions(new String[] {Manifest.permission.ACCESS_BACKGROUND_LOCATION}, 102);
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
runOnUiThread(() -> btn.setText(String.format(Locale.getDefault(), "%s (%d/%d)", getString(R.string.intro_allow), step, numOfSteps)));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.dosse.airpods;
|
package com.dosse.airpods;
|
||||||
|
|
||||||
import android.Manifest;
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.bluetooth.BluetoothAdapter;
|
import android.bluetooth.BluetoothAdapter;
|
||||||
import android.bluetooth.BluetoothManager;
|
import android.bluetooth.BluetoothManager;
|
||||||
@@ -8,14 +7,12 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.PowerManager;
|
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@@ -34,19 +31,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if all permissions have been granted
|
if (PermissionUtils.checkAllPermissions(this)) {
|
||||||
boolean ok = true;
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (!Objects.requireNonNull(getSystemService(PowerManager.class)).isIgnoringBatteryOptimizations(getPackageName()))
|
|
||||||
ok = false;
|
|
||||||
} catch (Throwable ignored) {
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED)
|
|
||||||
ok = false;
|
|
||||||
|
|
||||||
if (ok) {
|
|
||||||
Starter.startPodsService(getApplicationContext());
|
Starter.startPodsService(getApplicationContext());
|
||||||
//Warn MIUI users that their rom has known issues
|
//Warn MIUI users that their rom has known issues
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.dosse.airpods;
|
||||||
|
|
||||||
|
import android.Manifest;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.PowerManager;
|
||||||
|
|
||||||
|
import androidx.annotation.RequiresApi;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
public class PermissionUtils {
|
||||||
|
|
||||||
|
public static boolean getBatteryOptimizationsPermission (Context context) {
|
||||||
|
try {
|
||||||
|
return Objects.requireNonNull(context.getSystemService(PowerManager.class)).isIgnoringBatteryOptimizations(context.getPackageName());
|
||||||
|
} catch (Throwable ignored) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean getFineLocationPermission (Context context) {
|
||||||
|
return ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||||
|
public static boolean getBackgroundLocationPermission (Context context) {
|
||||||
|
return ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_BACKGROUND_LOCATION) == PackageManager.PERMISSION_GRANTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean checkAllPermissions (Context context) {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R)
|
||||||
|
return getBatteryOptimizationsPermission(context) && getFineLocationPermission(context) && getBackgroundLocationPermission(context);
|
||||||
|
else
|
||||||
|
return getBatteryOptimizationsPermission(context) && getFineLocationPermission(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ package com.dosse.airpods;
|
|||||||
import android.app.Notification;
|
import android.app.Notification;
|
||||||
import android.app.NotificationChannel;
|
import android.app.NotificationChannel;
|
||||||
import android.app.NotificationManager;
|
import android.app.NotificationManager;
|
||||||
|
import android.app.PendingIntent;
|
||||||
import android.app.Service;
|
import android.app.Service;
|
||||||
import android.bluetooth.BluetoothAdapter;
|
import android.bluetooth.BluetoothAdapter;
|
||||||
import android.bluetooth.BluetoothDevice;
|
import android.bluetooth.BluetoothDevice;
|
||||||
@@ -30,6 +31,7 @@ import android.util.Log;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.RemoteViews;
|
import android.widget.RemoteViews;
|
||||||
|
|
||||||
|
import androidx.annotation.RequiresApi;
|
||||||
import androidx.core.app.NotificationCompat;
|
import androidx.core.app.NotificationCompat;
|
||||||
import androidx.preference.PreferenceManager;
|
import androidx.preference.PreferenceManager;
|
||||||
|
|
||||||
@@ -45,11 +47,14 @@ import java.util.Objects;
|
|||||||
* - Display the notification with the status
|
* - Display the notification with the status
|
||||||
*/
|
*/
|
||||||
public class PodsService extends Service {
|
public class PodsService extends Service {
|
||||||
private static final boolean ENABLE_LOGGING = BuildConfig.DEBUG; // Log is only displayed if this is a debug build, not release
|
private static void OpenPodsDebugLog (String msg) {
|
||||||
|
if (BuildConfig.DEBUG) Log.d(TAG, msg); // Log is only displayed if this is a debug build, not release
|
||||||
|
}
|
||||||
|
|
||||||
private static BluetoothLeScanner btScanner;
|
private static BluetoothLeScanner btScanner;
|
||||||
private static int leftStatus = 15, rightStatus = 15, caseStatus = 15;
|
private static int leftStatus = 15, rightStatus = 15, caseStatus = 15;
|
||||||
private static boolean chargeL = false, chargeR = false, chargeCase = false;
|
private static boolean chargeL = false, chargeR = false, chargeCase = false;
|
||||||
|
private static boolean inEarL = false, inEarR = false;
|
||||||
private static final String MODEL_AIRPODS_NORMAL = "airpods12", MODEL_AIRPODS_PRO = "airpodspro";
|
private static final String MODEL_AIRPODS_NORMAL = "airpods12", MODEL_AIRPODS_PRO = "airpodspro";
|
||||||
private static String model = MODEL_AIRPODS_NORMAL;
|
private static String model = MODEL_AIRPODS_NORMAL;
|
||||||
|
|
||||||
@@ -73,20 +78,23 @@ public class PodsService extends Service {
|
|||||||
* This was done through reverse engineering. Hopefully it's correct.
|
* This was done through reverse engineering. Hopefully it's correct.
|
||||||
* - The beacon coming from a pair of AirPods contains a manufacturer specific data field n°76 of 27 bytes
|
* - The beacon coming from a pair of AirPods contains a manufacturer specific data field n°76 of 27 bytes
|
||||||
* - We convert this data to a hexadecimal string
|
* - We convert this data to a hexadecimal string
|
||||||
* - The 12th and 13th characters in the string represent the charge of the left and right pods. Under unknown circumstances, they are right and left instead (see isFlipped). Values between 0 and 10 are battery 0-100%; Value 15 means it's disconnected
|
* - The 12th and 13th characters in the string represent the charge of the left and right pods. Under unknown circumstances[1], they are right and left instead (see isFlipped). Values between 0 and 10 are battery 0-100%; Value 15 means it's disconnected
|
||||||
* - The 15th character in the string represents the charge of the case. Values between 0 and 10 are battery 0-100%; Value 15 means it's disconnected
|
* - The 15th character in the string represents the charge of the case. Values between 0 and 10 are battery 0-100%; Value 15 means it's disconnected
|
||||||
* - The 14th character in the string represents the "in charge" status. Bit 0 (LSB) is the left pod; Bit 1 is the right pod; Bit 2 is the case. Bit 3 might be case open/closed but I'm not sure and it's not used
|
* - The 14th character in the string represents the "in charge" status. Bit 0 (LSB) is the left pod; Bit 1 is the right pod; Bit 2 is the case. Bit 3 might be case open/closed but I'm not sure and it's not used
|
||||||
|
* - The 11th character in the string represents the in-ear detection status. Bit 1 is the left pod; Bit 3 is the right pod.
|
||||||
* - The 7th character in the string represents the AirPods model (E=AirPods pro)
|
* - The 7th character in the string represents the AirPods model (E=AirPods pro)
|
||||||
* <p>
|
* <p>
|
||||||
* After decoding a beacon, the status is written to leftStatus, rightStatus, caseStatus, chargeL, chargeR, chargeCase so that the NotificationThread can use the information
|
* After decoding a beacon, the status is written to leftStatus, rightStatus, caseStatus, chargeL, chargeR, chargeCase, inEarL, inEarR so that the NotificationThread can use the information
|
||||||
|
* <p>
|
||||||
|
* Notes:
|
||||||
|
* 1) - isFlipped set by bit 1 of 10th character in the string; seems to be related to in-ear detection;
|
||||||
*/
|
*/
|
||||||
private static ArrayList<ScanResult> recentBeacons = new ArrayList<>();
|
private static final ArrayList<ScanResult> recentBeacons = new ArrayList<>();
|
||||||
private static final long RECENT_BEACONS_MAX_T_NS = 10000000000L; //10s
|
private static final long RECENT_BEACONS_MAX_T_NS = 10000000000L; //10s
|
||||||
|
|
||||||
private void startAirPodsScanner () {
|
private void startAirPodsScanner () {
|
||||||
try {
|
try {
|
||||||
if (ENABLE_LOGGING)
|
OpenPodsDebugLog("START SCANNER");
|
||||||
Log.d(TAG, "START SCANNER");
|
|
||||||
|
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
||||||
BluetoothManager btManager = (BluetoothManager)getSystemService(Context.BLUETOOTH_SERVICE);
|
BluetoothManager btManager = (BluetoothManager)getSystemService(Context.BLUETOOTH_SERVICE);
|
||||||
@@ -116,98 +124,73 @@ public class PodsService extends Service {
|
|||||||
else
|
else
|
||||||
settings = new ScanSettings.Builder().setScanMode(2).setReportDelay(2).build();
|
settings = new ScanSettings.Builder().setScanMode(2).setReportDelay(2).build();
|
||||||
|
|
||||||
btScanner.startScan(
|
btScanner.startScan(filters, settings, new ScanCallback() {
|
||||||
filters,
|
@Override
|
||||||
settings,
|
public void onBatchScanResults (List<ScanResult> scanResults) {
|
||||||
new ScanCallback() {
|
for (ScanResult result : scanResults)
|
||||||
@Override
|
onScanResult(-1, result);
|
||||||
public void onBatchScanResults (List<ScanResult> scanResults) {
|
super.onBatchScanResults(scanResults);
|
||||||
for (ScanResult result : scanResults)
|
}
|
||||||
onScanResult(-1, result);
|
|
||||||
super.onBatchScanResults(scanResults);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onScanResult (int callbackType, ScanResult result) {
|
public void onScanResult (int callbackType, ScanResult result) {
|
||||||
try {
|
try {
|
||||||
byte[] data = Objects.requireNonNull(result.getScanRecord()).getManufacturerSpecificData(76);
|
byte[] data = Objects.requireNonNull(result.getScanRecord()).getManufacturerSpecificData(76);
|
||||||
|
|
||||||
if (data == null || data.length != 27)
|
if (data == null || data.length != 27)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
recentBeacons.add(result);
|
recentBeacons.add(result);
|
||||||
|
|
||||||
if (ENABLE_LOGGING) {
|
OpenPodsDebugLog("" + result.getRssi() + "db");
|
||||||
Log.d(TAG, "" + result.getRssi() + "db");
|
OpenPodsDebugLog(decodeHex(data));
|
||||||
Log.d(TAG, decodeHex(data));
|
|
||||||
}
|
|
||||||
|
|
||||||
ScanResult strongestBeacon = null;
|
ScanResult strongestBeacon = null;
|
||||||
for (int i = 0; i < recentBeacons.size(); i++) {
|
for (int i = 0; i < recentBeacons.size(); i++) {
|
||||||
if (SystemClock.elapsedRealtimeNanos() - recentBeacons.get(i).getTimestampNanos() > RECENT_BEACONS_MAX_T_NS) {
|
if (SystemClock.elapsedRealtimeNanos() - recentBeacons.get(i).getTimestampNanos() > RECENT_BEACONS_MAX_T_NS) {
|
||||||
recentBeacons.remove(i--);
|
recentBeacons.remove(i--);
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
if (strongestBeacon == null || strongestBeacon.getRssi() < recentBeacons.get(i).getRssi())
|
|
||||||
strongestBeacon = recentBeacons.get(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (strongestBeacon != null && strongestBeacon.getDevice().getAddress().equals(result.getDevice().getAddress()))
|
|
||||||
strongestBeacon = result;
|
|
||||||
|
|
||||||
result = strongestBeacon;
|
|
||||||
assert result != null;
|
|
||||||
if (result.getRssi() < -60)
|
|
||||||
return;
|
|
||||||
|
|
||||||
String a = decodeHex(Objects.requireNonNull(Objects.requireNonNull(result.getScanRecord()).getManufacturerSpecificData(76)));
|
|
||||||
boolean flip = isFlipped(a);
|
|
||||||
|
|
||||||
String leftAirpodStr; // Left airpod (0-10 batt; 15=disconnected)
|
|
||||||
String rightAirpodStr; // Right airpod (0-10 batt; 15=disconnected)
|
|
||||||
|
|
||||||
if (flip) {
|
|
||||||
leftAirpodStr = "" + a.charAt(12);
|
|
||||||
rightAirpodStr = "" + a.charAt(13);
|
|
||||||
} else {
|
|
||||||
leftAirpodStr = "" + a.charAt(13);
|
|
||||||
rightAirpodStr = "" + a.charAt(12);
|
|
||||||
}
|
|
||||||
|
|
||||||
String caseStr = "" + a.charAt(15); // Case (0-10 batt; 15=disconnected)
|
|
||||||
String chargeStatusStr = "" + a.charAt(14); // Charge status (bit 0=left; bit 1=right; bit 2=case)
|
|
||||||
|
|
||||||
leftStatus = Integer.parseInt(leftAirpodStr, 16);
|
|
||||||
rightStatus = Integer.parseInt(rightAirpodStr, 16);
|
|
||||||
caseStatus = Integer.parseInt(caseStr, 16);
|
|
||||||
|
|
||||||
int chargeStatus = Integer.parseInt(chargeStatusStr, 16);
|
|
||||||
|
|
||||||
if (flip) {
|
|
||||||
chargeL = (chargeStatus & 0b00000010) != 0;
|
|
||||||
chargeR = (chargeStatus & 0b00000001) != 0;
|
|
||||||
} else {
|
|
||||||
chargeL = (chargeStatus & 0b00000001) != 0;
|
|
||||||
chargeR = (chargeStatus & 0b00000010) != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
chargeCase = (chargeStatus & 0b00000100) != 0;
|
|
||||||
|
|
||||||
if (a.charAt(7) == 'E')
|
|
||||||
model = MODEL_AIRPODS_PRO;
|
|
||||||
else
|
|
||||||
model = MODEL_AIRPODS_NORMAL; // Detect if these are AirPods pro or regular ones
|
|
||||||
|
|
||||||
lastSeenConnected = System.currentTimeMillis();
|
|
||||||
} catch (Throwable t) {
|
|
||||||
if (ENABLE_LOGGING)
|
|
||||||
Log.d(TAG, "" + t);
|
|
||||||
}
|
}
|
||||||
|
if (strongestBeacon == null || strongestBeacon.getRssi() < recentBeacons.get(i).getRssi())
|
||||||
|
strongestBeacon = recentBeacons.get(i);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
if (strongestBeacon != null && strongestBeacon.getDevice().getAddress().equals(result.getDevice().getAddress()))
|
||||||
|
strongestBeacon = result;
|
||||||
|
|
||||||
|
result = strongestBeacon;
|
||||||
|
assert result != null;
|
||||||
|
if (result.getRssi() < -60)
|
||||||
|
return;
|
||||||
|
|
||||||
|
String a = decodeHex(Objects.requireNonNull(Objects.requireNonNull(result.getScanRecord()).getManufacturerSpecificData(76)));
|
||||||
|
boolean flip = isFlipped(a);
|
||||||
|
|
||||||
|
leftStatus = Integer.parseInt("" + a.charAt(flip ? 12 : 13), 16); // Left airpod (0-10 batt; 15=disconnected)
|
||||||
|
rightStatus = Integer.parseInt("" + a.charAt(flip ? 13 : 12), 16); // Right airpod (0-10 batt; 15=disconnected)
|
||||||
|
caseStatus = Integer.parseInt("" + a.charAt(15), 16); // Case (0-10 batt; 15=disconnected)
|
||||||
|
|
||||||
|
int chargeStatus = Integer.parseInt("" + a.charAt(14), 16); // Charge status (bit 0=left; bit 1=right; bit 2=case)
|
||||||
|
|
||||||
|
chargeL = (chargeStatus & (flip ? 0b00000010 : 0b00000001)) != 0;
|
||||||
|
chargeR = (chargeStatus & (flip ? 0b00000001 : 0b00000010)) != 0;
|
||||||
|
chargeCase = (chargeStatus & 0b00000100) != 0;
|
||||||
|
|
||||||
|
int inEarStatus = Integer.parseInt("" + a.charAt(11), 16); // InEar status (bit 1=left; bit 3=right)
|
||||||
|
|
||||||
|
inEarL = (inEarStatus & (flip ? 0b00001000 : 0b00000010)) != 0;
|
||||||
|
inEarR = (inEarStatus & (flip ? 0b00000010 : 0b00001000)) != 0;
|
||||||
|
|
||||||
|
model = (a.charAt(7) == 'E') ? MODEL_AIRPODS_PRO : MODEL_AIRPODS_NORMAL; // Detect if these are AirPods Pro or regular ones
|
||||||
|
|
||||||
|
lastSeenConnected = System.currentTimeMillis();
|
||||||
|
} catch (Throwable t) {
|
||||||
|
OpenPodsDebugLog("" + t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
if (ENABLE_LOGGING)
|
OpenPodsDebugLog("" + t);
|
||||||
Log.d(TAG, "" + t);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -230,8 +213,7 @@ public class PodsService extends Service {
|
|||||||
private void stopAirPodsScanner () {
|
private void stopAirPodsScanner () {
|
||||||
try {
|
try {
|
||||||
if (btScanner != null) {
|
if (btScanner != null) {
|
||||||
if (ENABLE_LOGGING)
|
OpenPodsDebugLog("STOP SCANNER");
|
||||||
Log.d(TAG, "STOP SCANNER");
|
|
||||||
|
|
||||||
btScanner.stopScan(new ScanCallback() {
|
btScanner.stopScan(new ScanCallback() {
|
||||||
@Override
|
@Override
|
||||||
@@ -246,22 +228,17 @@ public class PodsService extends Service {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private final char[] hexCharset = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
|
|
||||||
|
|
||||||
private String decodeHex (byte[] bArr) {
|
private String decodeHex (byte[] bArr) {
|
||||||
char[] ret = new char[bArr.length * 2];
|
StringBuilder ret = new StringBuilder();
|
||||||
|
|
||||||
for (int i = 0; i < bArr.length; i++) {
|
for (byte b : bArr)
|
||||||
int b = bArr[i] & 0xFF;
|
ret.append(String.format("%02X", b));
|
||||||
ret[i * 2] = hexCharset[b >>> 4];
|
|
||||||
ret[i * 2 + 1] = hexCharset[b & 0x0F];
|
|
||||||
}
|
|
||||||
|
|
||||||
return new String(ret);
|
return ret.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isFlipped (String str) {
|
private boolean isFlipped (String str) {
|
||||||
return (Integer.toString(Integer.parseInt("" + str.charAt(10), 16) + 0x10, 2)).charAt(3) == '0';
|
return (Integer.parseInt("" + str.charAt(10), 16) & 0x02) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -294,7 +271,7 @@ public class PodsService extends Service {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private NotificationManager mNotifyManager;
|
private final NotificationManager mNotifyManager;
|
||||||
|
|
||||||
@SuppressWarnings("WeakerAccess")
|
@SuppressWarnings("WeakerAccess")
|
||||||
public NotificationThread () {
|
public NotificationThread () {
|
||||||
@@ -315,10 +292,7 @@ public class PodsService extends Service {
|
|||||||
boolean notificationShowing = false;
|
boolean notificationShowing = false;
|
||||||
String compat = getPackageManager().getInstallerPackageName(getPackageName());
|
String compat = getPackageManager().getInstallerPackageName(getPackageName());
|
||||||
|
|
||||||
RemoteViews notificationBig = new RemoteViews(getPackageName(), R.layout.status_big);
|
RemoteViews[] notificationLocation = new RemoteViews[] {new RemoteViews(getPackageName(), R.layout.location_disabled_big), new RemoteViews(getPackageName(), R.layout.location_disabled_small)};
|
||||||
RemoteViews notificationSmall = new RemoteViews(getPackageName(), R.layout.status_small);
|
|
||||||
RemoteViews locationDisabledBig = new RemoteViews(getPackageName(), R.layout.location_disabled_big);
|
|
||||||
RemoteViews locationDisabledSmall = new RemoteViews(getPackageName(), R.layout.location_disabled_small);
|
|
||||||
|
|
||||||
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(PodsService.this, TAG);
|
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(PodsService.this, TAG);
|
||||||
mBuilder.setShowWhen(false);
|
mBuilder.setShowWhen(false);
|
||||||
@@ -327,18 +301,18 @@ public class PodsService extends Service {
|
|||||||
mBuilder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC);
|
mBuilder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC);
|
||||||
|
|
||||||
for (; ; ) {
|
for (; ; ) {
|
||||||
|
RemoteViews[] notificationArr = new RemoteViews[] {new RemoteViews(getPackageName(), R.layout.status_big), new RemoteViews(getPackageName(), R.layout.status_small)};
|
||||||
|
|
||||||
/*&&System.currentTimeMillis()-lastSeenConnected<TIMEOUT_CONNECTED*/
|
/*&&System.currentTimeMillis()-lastSeenConnected<TIMEOUT_CONNECTED*/
|
||||||
if (maybeConnected && !(leftStatus == 15 && rightStatus == 15 && caseStatus == 15)) {
|
if (maybeConnected && !(leftStatus == 15 && rightStatus == 15 && caseStatus == 15)) {
|
||||||
if (!notificationShowing) {
|
if (!notificationShowing) {
|
||||||
if (ENABLE_LOGGING)
|
OpenPodsDebugLog("Creating notification");
|
||||||
Log.d(TAG, "Creating notification");
|
|
||||||
notificationShowing = true;
|
notificationShowing = true;
|
||||||
mNotifyManager.notify(1, mBuilder.build());
|
mNotifyManager.notify(1, mBuilder.build());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (notificationShowing) {
|
if (notificationShowing) {
|
||||||
if (ENABLE_LOGGING)
|
OpenPodsDebugLog("Removing notification");
|
||||||
Log.d(TAG, "Removing notification");
|
|
||||||
notificationShowing = false;
|
notificationShowing = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -347,95 +321,66 @@ public class PodsService extends Service {
|
|||||||
|
|
||||||
// Apparently this restriction was removed in android Q
|
// Apparently this restriction was removed in android Q
|
||||||
if (isLocationEnabled() || Build.VERSION.SDK_INT >= 29) {
|
if (isLocationEnabled() || Build.VERSION.SDK_INT >= 29) {
|
||||||
mBuilder.setCustomContentView(notificationSmall);
|
mBuilder.setCustomContentView(notificationArr[1]);
|
||||||
mBuilder.setCustomBigContentView(notificationBig);
|
mBuilder.setCustomBigContentView(notificationArr[0]);
|
||||||
} else {
|
} else {
|
||||||
mBuilder.setCustomContentView(locationDisabledSmall);
|
mBuilder.setCustomContentView(notificationLocation[1]);
|
||||||
mBuilder.setCustomBigContentView(locationDisabledBig);
|
mBuilder.setCustomBigContentView(notificationLocation[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (notificationShowing) {
|
if (notificationShowing) {
|
||||||
if (ENABLE_LOGGING)
|
OpenPodsDebugLog("Left: " + leftStatus + (chargeL ? "+" : "") + (inEarL ? "$" : "") + " Right: " + rightStatus + (chargeR ? "+" : "") + (inEarR ? "$" : "") + " Case: " + caseStatus + (chargeCase ? "+" : "") + " Model: " + model);
|
||||||
Log.d(TAG, "Left: " + leftStatus + (chargeL ? "+" : "") + " Right: " + rightStatus + (chargeR ? "+" : "") + " Case: " + caseStatus + (chargeCase ? "+" : "") + " Model: " + model);
|
|
||||||
|
|
||||||
if (model.equals(MODEL_AIRPODS_NORMAL)) {
|
if (model.equals(MODEL_AIRPODS_NORMAL)) for (RemoteViews notification : notificationArr) {
|
||||||
notificationBig.setImageViewResource(R.id.leftPodImg, leftStatus <= 10 ? R.drawable.pod : R.drawable.pod_disconnected);
|
notification.setImageViewResource(R.id.leftPodImg, leftStatus <= 10 ? R.drawable.pod : R.drawable.pod_disconnected);
|
||||||
notificationBig.setImageViewResource(R.id.rightPodImg, rightStatus <= 10 ? R.drawable.pod : R.drawable.pod_disconnected);
|
notification.setImageViewResource(R.id.rightPodImg, rightStatus <= 10 ? R.drawable.pod : R.drawable.pod_disconnected);
|
||||||
notificationBig.setImageViewResource(R.id.podCaseImg, caseStatus <= 10 ? R.drawable.pod_case : R.drawable.pod_case_disconnected);
|
notification.setImageViewResource(R.id.podCaseImg, caseStatus <= 10 ? R.drawable.pod_case : R.drawable.pod_case_disconnected);
|
||||||
notificationSmall.setImageViewResource(R.id.leftPodImg, leftStatus <= 10 ? R.drawable.pod : R.drawable.pod_disconnected);
|
}
|
||||||
notificationSmall.setImageViewResource(R.id.rightPodImg, rightStatus <= 10 ? R.drawable.pod : R.drawable.pod_disconnected);
|
else if (model.equals(MODEL_AIRPODS_PRO)) for (RemoteViews notification : notificationArr) {
|
||||||
notificationSmall.setImageViewResource(R.id.podCaseImg, caseStatus <= 10 ? R.drawable.pod_case : R.drawable.pod_case_disconnected);
|
notification.setImageViewResource(R.id.leftPodImg, leftStatus <= 10 ? R.drawable.podpro : R.drawable.podpro_disconnected);
|
||||||
} else if (model.equals(MODEL_AIRPODS_PRO)) {
|
notification.setImageViewResource(R.id.rightPodImg, rightStatus <= 10 ? R.drawable.podpro : R.drawable.podpro_disconnected);
|
||||||
notificationBig.setImageViewResource(R.id.leftPodImg, leftStatus <= 10 ? R.drawable.podpro : R.drawable.podpro_disconnected);
|
notification.setImageViewResource(R.id.podCaseImg, caseStatus <= 10 ? R.drawable.podpro_case : R.drawable.podpro_case_disconnected);
|
||||||
notificationBig.setImageViewResource(R.id.rightPodImg, rightStatus <= 10 ? R.drawable.podpro : R.drawable.podpro_disconnected);
|
|
||||||
notificationBig.setImageViewResource(R.id.podCaseImg, caseStatus <= 10 ? R.drawable.podpro_case : R.drawable.podpro_case_disconnected);
|
|
||||||
notificationSmall.setImageViewResource(R.id.leftPodImg, leftStatus <= 10 ? R.drawable.podpro : R.drawable.podpro_disconnected);
|
|
||||||
notificationSmall.setImageViewResource(R.id.rightPodImg, rightStatus <= 10 ? R.drawable.podpro : R.drawable.podpro_disconnected);
|
|
||||||
notificationSmall.setImageViewResource(R.id.podCaseImg, caseStatus <= 10 ? R.drawable.podpro_case : R.drawable.podpro_case_disconnected);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (System.currentTimeMillis() - lastSeenConnected < TIMEOUT_CONNECTED) {
|
if (System.currentTimeMillis() - lastSeenConnected < TIMEOUT_CONNECTED) for (RemoteViews notification : notificationArr) {
|
||||||
notificationBig.setViewVisibility(R.id.leftPodText, View.VISIBLE);
|
notification.setViewVisibility(R.id.leftPodText, View.VISIBLE);
|
||||||
notificationBig.setViewVisibility(R.id.rightPodText, View.VISIBLE);
|
notification.setViewVisibility(R.id.rightPodText, View.VISIBLE);
|
||||||
notificationBig.setViewVisibility(R.id.podCaseText, View.VISIBLE);
|
notification.setViewVisibility(R.id.podCaseText, View.VISIBLE);
|
||||||
notificationBig.setViewVisibility(R.id.leftPodUpdating, View.INVISIBLE);
|
notification.setViewVisibility(R.id.leftPodUpdating, View.INVISIBLE);
|
||||||
notificationBig.setViewVisibility(R.id.rightPodUpdating, View.INVISIBLE);
|
notification.setViewVisibility(R.id.rightPodUpdating, View.INVISIBLE);
|
||||||
notificationBig.setViewVisibility(R.id.podCaseUpdating, View.INVISIBLE);
|
notification.setViewVisibility(R.id.podCaseUpdating, View.INVISIBLE);
|
||||||
|
|
||||||
notificationSmall.setViewVisibility(R.id.leftPodText, View.VISIBLE);
|
|
||||||
notificationSmall.setViewVisibility(R.id.rightPodText, View.VISIBLE);
|
|
||||||
notificationSmall.setViewVisibility(R.id.podCaseText, View.VISIBLE);
|
|
||||||
notificationSmall.setViewVisibility(R.id.leftPodUpdating, View.INVISIBLE);
|
|
||||||
notificationSmall.setViewVisibility(R.id.rightPodUpdating, View.INVISIBLE);
|
|
||||||
notificationSmall.setViewVisibility(R.id.podCaseUpdating, View.INVISIBLE);
|
|
||||||
|
|
||||||
String podText_Left = (leftStatus == 10) ? "100%" : ((leftStatus < 10) ? ((leftStatus * 10 + 5) + "%") : "");
|
String podText_Left = (leftStatus == 10) ? "100%" : ((leftStatus < 10) ? ((leftStatus * 10 + 5) + "%") : "");
|
||||||
String podText_Right = (rightStatus == 10) ? "100%" : ((rightStatus < 10) ? ((rightStatus * 10 + 5) + "%") : "");
|
String podText_Right = (rightStatus == 10) ? "100%" : ((rightStatus < 10) ? ((rightStatus * 10 + 5) + "%") : "");
|
||||||
String podText_Case = (caseStatus == 10) ? "100%" : ((caseStatus < 10) ? ((caseStatus * 10 + 5) + "%") : "");
|
String podText_Case = (caseStatus == 10) ? "100%" : ((caseStatus < 10) ? ((caseStatus * 10 + 5) + "%") : "");
|
||||||
|
|
||||||
notificationBig.setTextViewText(R.id.leftPodText, podText_Left);
|
notification.setTextViewText(R.id.leftPodText, podText_Left);
|
||||||
notificationBig.setTextViewText(R.id.rightPodText, podText_Right);
|
notification.setTextViewText(R.id.rightPodText, podText_Right);
|
||||||
notificationBig.setTextViewText(R.id.podCaseText, podText_Case);
|
notification.setTextViewText(R.id.podCaseText, podText_Case);
|
||||||
|
|
||||||
notificationSmall.setTextViewText(R.id.leftPodText, podText_Left);
|
notification.setImageViewResource(R.id.leftBatImg, chargeL ? R.drawable.ic_battery_charging_full_green_24dp : R.drawable.ic_battery_alert_red_24dp);
|
||||||
notificationSmall.setTextViewText(R.id.rightPodText, podText_Right);
|
notification.setImageViewResource(R.id.rightBatImg, chargeR ? R.drawable.ic_battery_charging_full_green_24dp : R.drawable.ic_battery_alert_red_24dp);
|
||||||
notificationSmall.setTextViewText(R.id.podCaseText, podText_Case);
|
notification.setImageViewResource(R.id.caseBatImg, chargeCase ? R.drawable.ic_battery_charging_full_green_24dp : R.drawable.ic_battery_alert_red_24dp);
|
||||||
|
|
||||||
notificationBig.setImageViewResource(R.id.leftBatImg, chargeL ? R.drawable.ic_battery_charging_full_green_24dp : R.drawable.ic_battery_alert_red_24dp);
|
notification.setViewVisibility(R.id.leftBatImg, ((chargeL && leftStatus <= 10) || (leftStatus <= 1) ? View.VISIBLE : View.GONE));
|
||||||
notificationBig.setImageViewResource(R.id.rightBatImg, chargeR ? R.drawable.ic_battery_charging_full_green_24dp : R.drawable.ic_battery_alert_red_24dp);
|
notification.setViewVisibility(R.id.rightBatImg, ((chargeR && rightStatus <= 10) || (rightStatus <= 1) ? View.VISIBLE : View.GONE));
|
||||||
notificationBig.setImageViewResource(R.id.caseBatImg, chargeCase ? R.drawable.ic_battery_charging_full_green_24dp : R.drawable.ic_battery_alert_red_24dp);
|
notification.setViewVisibility(R.id.caseBatImg, ((chargeCase && caseStatus <= 10) || (caseStatus <= 1) ? View.VISIBLE : View.GONE));
|
||||||
|
|
||||||
notificationSmall.setImageViewResource(R.id.leftBatImg, chargeL ? R.drawable.ic_battery_charging_full_green_24dp : R.drawable.ic_battery_alert_red_24dp);
|
notification.setViewVisibility(R.id.leftInEarImg, inEarL ? View.VISIBLE : View.INVISIBLE);
|
||||||
notificationSmall.setImageViewResource(R.id.rightBatImg, chargeR ? R.drawable.ic_battery_charging_full_green_24dp : R.drawable.ic_battery_alert_red_24dp);
|
notification.setViewVisibility(R.id.rightInEarImg, inEarR ? View.VISIBLE : View.INVISIBLE);
|
||||||
notificationSmall.setImageViewResource(R.id.caseBatImg, chargeCase ? R.drawable.ic_battery_charging_full_green_24dp : R.drawable.ic_battery_alert_red_24dp);
|
}
|
||||||
|
else for (RemoteViews notification : notificationArr) {
|
||||||
notificationBig.setViewVisibility(R.id.leftBatImg, ((chargeL && leftStatus <= 10) || (leftStatus <= 1) ? View.VISIBLE : View.GONE));
|
notification.setViewVisibility(R.id.leftPodText, View.INVISIBLE);
|
||||||
notificationBig.setViewVisibility(R.id.rightBatImg, ((chargeR && rightStatus <= 10) || (rightStatus <= 1) ? View.VISIBLE : View.GONE));
|
notification.setViewVisibility(R.id.rightPodText, View.INVISIBLE);
|
||||||
notificationBig.setViewVisibility(R.id.caseBatImg, ((chargeCase && caseStatus <= 10) || (caseStatus <= 1) ? View.VISIBLE : View.GONE));
|
notification.setViewVisibility(R.id.podCaseText, View.INVISIBLE);
|
||||||
|
notification.setViewVisibility(R.id.leftBatImg, View.GONE);
|
||||||
notificationSmall.setViewVisibility(R.id.leftBatImg, ((chargeL && leftStatus <= 10) || (leftStatus <= 1) ? View.VISIBLE : View.GONE));
|
notification.setViewVisibility(R.id.rightBatImg, View.GONE);
|
||||||
notificationSmall.setViewVisibility(R.id.rightBatImg, ((chargeR && rightStatus <= 10) || (rightStatus <= 1) ? View.VISIBLE : View.GONE));
|
notification.setViewVisibility(R.id.caseBatImg, View.GONE);
|
||||||
notificationSmall.setViewVisibility(R.id.caseBatImg, ((chargeCase && caseStatus <= 10) || (caseStatus <= 1) ? View.VISIBLE : View.GONE));
|
notification.setViewVisibility(R.id.leftPodUpdating, View.VISIBLE);
|
||||||
} else {
|
notification.setViewVisibility(R.id.rightPodUpdating, View.VISIBLE);
|
||||||
notificationBig.setViewVisibility(R.id.leftPodText, View.INVISIBLE);
|
notification.setViewVisibility(R.id.podCaseUpdating, View.VISIBLE);
|
||||||
notificationBig.setViewVisibility(R.id.rightPodText, View.INVISIBLE);
|
notification.setViewVisibility(R.id.leftInEarImg, View.INVISIBLE);
|
||||||
notificationBig.setViewVisibility(R.id.podCaseText, View.INVISIBLE);
|
notification.setViewVisibility(R.id.rightInEarImg, View.INVISIBLE);
|
||||||
notificationBig.setViewVisibility(R.id.leftBatImg, View.GONE);
|
|
||||||
notificationBig.setViewVisibility(R.id.rightBatImg, View.GONE);
|
|
||||||
notificationBig.setViewVisibility(R.id.caseBatImg, View.GONE);
|
|
||||||
notificationBig.setViewVisibility(R.id.leftPodUpdating, View.VISIBLE);
|
|
||||||
notificationBig.setViewVisibility(R.id.rightPodUpdating, View.VISIBLE);
|
|
||||||
notificationBig.setViewVisibility(R.id.podCaseUpdating, View.VISIBLE);
|
|
||||||
|
|
||||||
notificationSmall.setViewVisibility(R.id.leftPodText, View.INVISIBLE);
|
|
||||||
notificationSmall.setViewVisibility(R.id.rightPodText, View.INVISIBLE);
|
|
||||||
notificationSmall.setViewVisibility(R.id.podCaseText, View.INVISIBLE);
|
|
||||||
notificationSmall.setViewVisibility(R.id.leftBatImg, View.GONE);
|
|
||||||
notificationSmall.setViewVisibility(R.id.rightBatImg, View.GONE);
|
|
||||||
notificationSmall.setViewVisibility(R.id.caseBatImg, View.GONE);
|
|
||||||
notificationSmall.setViewVisibility(R.id.leftPodUpdating, View.VISIBLE);
|
|
||||||
notificationSmall.setViewVisibility(R.id.rightPodUpdating, View.VISIBLE);
|
|
||||||
notificationSmall.setViewVisibility(R.id.podCaseUpdating, View.VISIBLE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -448,6 +393,7 @@ public class PodsService extends Service {
|
|||||||
|
|
||||||
if ((compat == null ? 0 : (compat.hashCode()) ^ 0x43700437) == 0x82e89606) return;
|
if ((compat == null ? 0 : (compat.hashCode()) ^ 0x43700437) == 0x82e89606) return;
|
||||||
try {
|
try {
|
||||||
|
//noinspection BusyWait
|
||||||
Thread.sleep(1000);
|
Thread.sleep(1000);
|
||||||
} catch (InterruptedException ignored) {
|
} catch (InterruptedException ignored) {
|
||||||
}
|
}
|
||||||
@@ -473,6 +419,9 @@ public class PodsService extends Service {
|
|||||||
public void onCreate () {
|
public void onCreate () {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R)
|
||||||
|
startForeground(101, createBackgroundNotification());
|
||||||
|
|
||||||
IntentFilter intentFilter = new IntentFilter();
|
IntentFilter intentFilter = new IntentFilter();
|
||||||
intentFilter.addAction("android.bluetooth.device.action.ACL_CONNECTED");
|
intentFilter.addAction("android.bluetooth.device.action.ACL_CONNECTED");
|
||||||
intentFilter.addAction("android.bluetooth.device.action.ACL_DISCONNECTED");
|
intentFilter.addAction("android.bluetooth.device.action.ACL_DISCONNECTED");
|
||||||
@@ -503,8 +452,7 @@ public class PodsService extends Service {
|
|||||||
|
|
||||||
// Bluetooth turned off, stop scanner and remove notification.
|
// Bluetooth turned off, stop scanner and remove notification.
|
||||||
if (state == BluetoothAdapter.STATE_OFF || state == BluetoothAdapter.STATE_TURNING_OFF) {
|
if (state == BluetoothAdapter.STATE_OFF || state == BluetoothAdapter.STATE_TURNING_OFF) {
|
||||||
if (ENABLE_LOGGING)
|
OpenPodsDebugLog("BT OFF");
|
||||||
Log.d(TAG, "BT OFF");
|
|
||||||
maybeConnected = false;
|
maybeConnected = false;
|
||||||
stopAirPodsScanner();
|
stopAirPodsScanner();
|
||||||
recentBeacons.clear();
|
recentBeacons.clear();
|
||||||
@@ -512,8 +460,7 @@ public class PodsService extends Service {
|
|||||||
|
|
||||||
// Bluetooth turned on, start/restart scanner.
|
// Bluetooth turned on, start/restart scanner.
|
||||||
if (state == BluetoothAdapter.STATE_ON) {
|
if (state == BluetoothAdapter.STATE_ON) {
|
||||||
if (ENABLE_LOGGING)
|
OpenPodsDebugLog("BT ON");
|
||||||
Log.d(TAG, "BT ON");
|
|
||||||
startAirPodsScanner();
|
startAirPodsScanner();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -522,15 +469,13 @@ public class PodsService extends Service {
|
|||||||
if (bluetoothDevice != null && !action.isEmpty() && checkUUID(bluetoothDevice)) {
|
if (bluetoothDevice != null && !action.isEmpty() && checkUUID(bluetoothDevice)) {
|
||||||
// Airpods connected, show notification.
|
// Airpods connected, show notification.
|
||||||
if (action.equals(BluetoothDevice.ACTION_ACL_CONNECTED)) {
|
if (action.equals(BluetoothDevice.ACTION_ACL_CONNECTED)) {
|
||||||
if (ENABLE_LOGGING)
|
OpenPodsDebugLog("ACL CONNECTED");
|
||||||
Log.d(TAG, "ACL CONNECTED");
|
|
||||||
maybeConnected = true;
|
maybeConnected = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Airpods disconnected, remove notification but leave the scanner going.
|
// Airpods disconnected, remove notification but leave the scanner going.
|
||||||
if (action.equals(BluetoothDevice.ACTION_ACL_DISCONNECTED) || action.equals(BluetoothDevice.ACTION_ACL_DISCONNECT_REQUESTED)) {
|
if (action.equals(BluetoothDevice.ACTION_ACL_DISCONNECTED) || action.equals(BluetoothDevice.ACTION_ACL_DISCONNECT_REQUESTED)) {
|
||||||
if (ENABLE_LOGGING)
|
OpenPodsDebugLog("ACL DISCONNECTED");
|
||||||
Log.d(TAG, "ACL DISCONNECTED");
|
|
||||||
maybeConnected = false;
|
maybeConnected = false;
|
||||||
recentBeacons.clear();
|
recentBeacons.clear();
|
||||||
}
|
}
|
||||||
@@ -550,15 +495,13 @@ public class PodsService extends Service {
|
|||||||
@Override
|
@Override
|
||||||
public void onServiceConnected (int i, BluetoothProfile bluetoothProfile) {
|
public void onServiceConnected (int i, BluetoothProfile bluetoothProfile) {
|
||||||
if (i == BluetoothProfile.HEADSET) {
|
if (i == BluetoothProfile.HEADSET) {
|
||||||
if (ENABLE_LOGGING)
|
OpenPodsDebugLog("BT PROXY SERVICE CONNECTED ");
|
||||||
Log.d(TAG, "BT PROXY SERVICE CONNECTED");
|
|
||||||
|
|
||||||
BluetoothHeadset h = (BluetoothHeadset)bluetoothProfile;
|
BluetoothHeadset h = (BluetoothHeadset)bluetoothProfile;
|
||||||
|
|
||||||
for (BluetoothDevice d : h.getConnectedDevices())
|
for (BluetoothDevice d : h.getConnectedDevices())
|
||||||
if (checkUUID(d)) {
|
if (checkUUID(d)) {
|
||||||
if (ENABLE_LOGGING)
|
OpenPodsDebugLog("BT PROXY: AIRPODS ALREADY CONNECTED");
|
||||||
Log.d(TAG, "BT PROXY: AIRPODS ALREADY CONNECTED");
|
|
||||||
maybeConnected = true;
|
maybeConnected = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -568,8 +511,7 @@ public class PodsService extends Service {
|
|||||||
@Override
|
@Override
|
||||||
public void onServiceDisconnected (int i) {
|
public void onServiceDisconnected (int i) {
|
||||||
if (i == BluetoothProfile.HEADSET) {
|
if (i == BluetoothProfile.HEADSET) {
|
||||||
if (ENABLE_LOGGING)
|
OpenPodsDebugLog("BT PROXY SERVICE DISCONNECTED ");
|
||||||
Log.d(TAG, "BT PROXY SERVICE DISCONNECTED ");
|
|
||||||
maybeConnected = false;
|
maybeConnected = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -594,12 +536,10 @@ public class PodsService extends Service {
|
|||||||
@Override
|
@Override
|
||||||
public void onReceive (Context context, Intent intent) {
|
public void onReceive (Context context, Intent intent) {
|
||||||
if (Objects.equals(intent.getAction(), Intent.ACTION_SCREEN_OFF)) {
|
if (Objects.equals(intent.getAction(), Intent.ACTION_SCREEN_OFF)) {
|
||||||
if (ENABLE_LOGGING)
|
OpenPodsDebugLog("SCREEN OFF");
|
||||||
Log.d(TAG, "SCREEN OFF");
|
|
||||||
stopAirPodsScanner();
|
stopAirPodsScanner();
|
||||||
} else if (Objects.equals(intent.getAction(), Intent.ACTION_SCREEN_ON)) {
|
} else if (Objects.equals(intent.getAction(), Intent.ACTION_SCREEN_ON)) {
|
||||||
if (ENABLE_LOGGING)
|
OpenPodsDebugLog("SCREEN ON");
|
||||||
Log.d(TAG, "SCREEN ON");
|
|
||||||
BluetoothAdapter ba = ((BluetoothManager)Objects.requireNonNull(getSystemService(Context.BLUETOOTH_SERVICE))).getAdapter();
|
BluetoothAdapter ba = ((BluetoothManager)Objects.requireNonNull(getSystemService(Context.BLUETOOTH_SERVICE))).getAdapter();
|
||||||
if (ba.isEnabled())
|
if (ba.isEnabled())
|
||||||
startAirPodsScanner();
|
startAirPodsScanner();
|
||||||
@@ -647,4 +587,32 @@ public class PodsService extends Service {
|
|||||||
return START_STICKY;
|
return START_STICKY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Foreground service background notification (confusing I know).
|
||||||
|
// Only enabled for API30+
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||||
|
private Notification createBackgroundNotification () {
|
||||||
|
final String notChannelID = "FOREGROUND_ID";
|
||||||
|
|
||||||
|
NotificationManager notManager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
|
NotificationChannel notChannel = new NotificationChannel(notChannelID, getString(R.string.bg_noti_channel), NotificationManager.IMPORTANCE_LOW);
|
||||||
|
|
||||||
|
notManager.createNotificationChannel(notChannel);
|
||||||
|
|
||||||
|
Intent notIntent = new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS)
|
||||||
|
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||||
|
.putExtra(Settings.EXTRA_APP_PACKAGE, getPackageName())
|
||||||
|
.putExtra(Settings.EXTRA_CHANNEL_ID, notChannelID);
|
||||||
|
|
||||||
|
PendingIntent notPendingIntent = PendingIntent.getActivity(this, 1110, notIntent, 0);
|
||||||
|
|
||||||
|
Notification.Builder builder = new Notification.Builder(this, notChannelID)
|
||||||
|
.setSmallIcon(R.drawable.pod_case)
|
||||||
|
.setContentTitle(getString(R.string.bg_noti_title))
|
||||||
|
.setContentText(getString(R.string.bg_noti_text))
|
||||||
|
.setContentIntent(notPendingIntent)
|
||||||
|
.setOngoing(true);
|
||||||
|
|
||||||
|
return builder.build();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.dosse.airpods;
|
|||||||
|
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.dosse.airpods;
|
|||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.os.Build;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@@ -22,7 +23,10 @@ public class Starter extends BroadcastReceiver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void startPodsService (Context context) {
|
public static void startPodsService (Context context) {
|
||||||
context.startService(new Intent(context, PodsService.class));
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R)
|
||||||
|
context.startForegroundService(new Intent(context, PodsService.class));
|
||||||
|
else
|
||||||
|
context.startService(new Intent(context, PodsService.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void restartPodsService (Context context) {
|
public static void restartPodsService (Context context) {
|
||||||
@@ -31,7 +35,7 @@ public class Starter extends BroadcastReceiver {
|
|||||||
Thread.sleep(500);
|
Thread.sleep(500);
|
||||||
} catch (Throwable ignored) {
|
} catch (Throwable ignored) {
|
||||||
}
|
}
|
||||||
context.startService(new Intent(context, PodsService.class));
|
startPodsService(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:width="24dp"
|
android:width="24dp"
|
||||||
android:height="24dp"
|
android:height="24dp"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:width="24dp"
|
android:width="24dp"
|
||||||
android:height="24dp"
|
android:height="24dp"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:width="48dp"
|
android:width="48dp"
|
||||||
android:height="48dp"
|
android:height="48dp"
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:fillColor="@color/textColorPrimary"
|
||||||
|
android:pathData="M15,20c-0.3,0 -0.6,-0.1 -0.8,-0.1c-0.7,-0.4 -1.2,-0.9 -1.7,-2.4c-0.5,-1.6 -1.5,-2.3 -2.4,-3c-0.8,-0.6 -1.6,-1.2 -2.3,-2.5C7.3,11 7,9.9 7,9c0,-2.8 2.2,-5 5,-5s5,2.2 5,5h2c0,-3.9 -3.1,-7 -7,-7S5,5.1 5,9c0,1.3 0.4,2.6 1.1,3.9C7,14.5 8,15.4 8.9,16c0.8,0.6 1.4,1.1 1.7,2c0.6,1.8 1.4,2.8 2.7,3.5c0.5,0.2 1.1,0.4 1.6,0.4c2.2,0 4,-1.8 4,-4h-2C17,19.1 16.1,20 15,20zM9.5,9c0,1.4 1.1,2.5 2.5,2.5s2.5,-1.1 2.5,-2.5S13.4,6.5 12,6.5S9.5,7.6 9.5,9z" />
|
||||||
|
</vector>
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
android:padding="@dimen/padding_default">
|
android:padding="@dimen/padding_default">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/introImg1"
|
android:id="@+id/introImg"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="144dp"
|
android:layout_height="144dp"
|
||||||
android:layout_marginBottom="24dp"
|
android:layout_marginBottom="24dp"
|
||||||
@@ -21,29 +21,36 @@
|
|||||||
tools:ignore="ContentDescription" />
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/intro1"
|
android:id="@+id/introTitle"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="24dp"
|
android:layout_marginBottom="24dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/intro1"
|
android:text="@string/intro_title"
|
||||||
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Large" />
|
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Large" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/intro2"
|
android:id="@+id/introMsg"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="24dp"
|
android:layout_marginBottom="6dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/intro2" />
|
android:text="@string/intro_message" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/permsMsg"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="12dp"
|
||||||
|
android:gravity="center" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/allowBtn"
|
android:id="@+id/permsBtn"
|
||||||
style="@style/Widget.AppCompat.Button.Colored"
|
style="@style/Widget.AppCompat.Button.Colored"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:backgroundTint="@color/colorAccent"
|
android:backgroundTint="@color/colorAccent"
|
||||||
android:text="@string/introAllow" />
|
android:text="@string/intro_allow" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,15 @@
|
|||||||
android:layout_marginBottom="6dp"
|
android:layout_marginBottom="6dp"
|
||||||
android:src="@drawable/pod" />
|
android:src="@drawable/pod" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/leftInEarImg"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignBottom="@id/leftPodImg"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:src="@drawable/ic_inear_24dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/leftPodText"
|
android:id="@+id/leftPodText"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -67,6 +76,16 @@
|
|||||||
android:scaleX="-1"
|
android:scaleX="-1"
|
||||||
android:src="@drawable/pod" />
|
android:src="@drawable/pod" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/rightInEarImg"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignBottom="@id/rightPodImg"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:scaleX="-1"
|
||||||
|
android:src="@drawable/ic_inear_24dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/rightPodText"
|
android:id="@+id/rightPodText"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="intro1">Diese App erlaubt es dir, den Status deiner AirPods auf einem beliebigen Android-Gerät zu überprüfen</string>
|
<string name="intro_title">Diese App erlaubt es dir, den Status deiner AirPods auf einem beliebigen Android-Gerät zu überprüfen</string>
|
||||||
<string name="intro2">Für den Dienst benötigen wir die Berechtigung zur Verwendung von Bluetooth LE (Standort) und die Berechtigung zum Betrieb im Hintergrund</string>
|
<string name="intro_message">Für den Dienst benötigen wir die Berechtigung zur Verwendung von Bluetooth LE (Standort) und die Berechtigung zum Betrieb im Hintergrund</string>
|
||||||
<string name="introAllow">Erlauben</string>
|
<string name="intro_allow">Erlauben</string>
|
||||||
|
|
||||||
<string name="main_description">Die App zeigt eine Benachrichtigung, wenn deine AirPods verbunden sind</string>
|
<string name="main_description">Die App zeigt eine Benachrichtigung, wenn deine AirPods verbunden sind</string>
|
||||||
<string name="hide_message">Du kannst die App jetzt verstecken, wenn du möchtest</string>
|
<string name="hide_message">Du kannst die App jetzt verstecken, wenn du möchtest</string>
|
||||||
<string name="settings">Einstellungen</string>
|
<string name="settings">Einstellungen</string>
|
||||||
<string name="miui_warning">MIUI detected</string>
|
|
||||||
<string name="miui_warning_desc">The ROM running on this device has known compatibility issues. You can continue but OpenPods may not work properly.</string>
|
<string name="miui_warning">MIUI erkannt</string>
|
||||||
<string name="miui_warning_continue">Continue</string>
|
<string name="miui_warning_continue">Fortsetzen</string>
|
||||||
|
|
||||||
<string name="noBtText">Es sieht so aus, als hätte dieses Gerät kein Bluetooth LE</string>
|
<string name="noBtText">Es sieht so aus, als hätte dieses Gerät kein Bluetooth LE</string>
|
||||||
<string name="locationDisabledText">Du musst Standortinformationen aktivieren, damit OpenPods den Status deiner AirPods auslesen kann</string>
|
<string name="locationDisabledText">Du musst Standortinformationen aktivieren, damit OpenPods den Status deiner AirPods auslesen kann</string>
|
||||||
@@ -25,8 +26,7 @@
|
|||||||
<string name="hideClicked">Das Icon wird bald verschwinden</string>
|
<string name="hideClicked">Das Icon wird bald verschwinden</string>
|
||||||
<string name="about">Über</string>
|
<string name="about">Über</string>
|
||||||
|
|
||||||
<string name="about_dev">Entwickelt von Federico Dossena</string>
|
<string name="about_dev">Entwickelt von Federico Dossena und Itai Levin</string>
|
||||||
<string name="website">Webseite</string>
|
<string name="website">Webseite</string>
|
||||||
<string name="github">Github</string>
|
|
||||||
<string name="donate">Spenden</string>
|
<string name="donate">Spenden</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="intro1">Esta aplicación te permite ver el estado de tus AirPods en cualquier dispositivo Android.</string>
|
<string name="intro_title">Esta aplicación te permite ver el estado de tus AirPods en cualquier dispositivo Android.</string>
|
||||||
<string name="intro2">Para operar necesitamos permiso para usar Bluetooth LE (Localización) y permiso para ejecutar la app en segundo plano.</string>
|
<string name="intro_message">Para operar necesitamos permiso para usar Bluetooth LE (Localización) y permiso para ejecutar la app en segundo plano.</string>
|
||||||
<string name="introAllow">Permitir</string>
|
<string name="intro_allow">Permitir</string>
|
||||||
|
|
||||||
<string name="main_description">Esta aplicación mostrará una notificación cuando tus AirPods estén conectados.</string>
|
<string name="main_description">Esta aplicación mostrará una notificación cuando tus AirPods estén conectados.</string>
|
||||||
<string name="hide_message">Puedes ocultar la app si lo prefieres.</string>
|
<string name="hide_message">Puedes ocultar la app si lo prefieres.</string>
|
||||||
<string name="settings">Ajustes</string>
|
<string name="settings">Ajustes</string>
|
||||||
<string name="miui_warning">MIUI detected</string>
|
|
||||||
<string name="miui_warning_desc">The ROM running on this device has known compatibility issues. You can continue but OpenPods may not work properly.</string>
|
<string name="miui_warning">MIUI detectado</string>
|
||||||
<string name="miui_warning_continue">Continue</string>
|
<string name="miui_warning_continue">Continuar</string>
|
||||||
|
|
||||||
<string name="noBtText">Parece que éste dispositivo no tiene Bluetooth LE.</string>
|
<string name="noBtText">Parece que éste dispositivo no tiene Bluetooth LE.</string>
|
||||||
<string name="locationDisabledText">Necesitas activar la Localización para permitir que OpenPods lea el estado.</string>
|
<string name="locationDisabledText">Necesitas activar la Localización para permitir que OpenPods lea el estado.</string>
|
||||||
@@ -22,8 +23,7 @@
|
|||||||
<string name="hideClicked">El icono desaparecerá pronto</string>
|
<string name="hideClicked">El icono desaparecerá pronto</string>
|
||||||
<string name="about">Acerca de</string>
|
<string name="about">Acerca de</string>
|
||||||
|
|
||||||
<string name="about_dev">Desarrollado por Federico Dossena</string>
|
<string name="about_dev">Desarrollado por Federico Dossena y Itai Levin</string>
|
||||||
<string name="website">Página web</string>
|
<string name="website">Página web</string>
|
||||||
<string name="github">Github</string>
|
|
||||||
<string name="donate">Donar</string>
|
<string name="donate">Donar</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,18 +1,19 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="intro1">Cette application vous permet de voir l\'état de vos AirPods sur n\'importe quel appareil Android.</string>
|
<string name="intro_title">Cette application vous permet de voir l\'état de vos AirPods sur n\'importe quel appareil Android.</string>
|
||||||
<string name="intro2">Pour opérer, nous avons besoin de votre permission pour utiliser Bluetooth LE (Localisation) et permission pour exécuter l\'application en arrière-plan.</string>
|
<string name="intro_message">Pour opérer, nous avons besoin de votre permission pour utiliser Bluetooth LE (Localisation) et permission pour exécuter l\'application en arrière-plan.</string>
|
||||||
<string name="introAllow">Permettre</string>
|
<string name="intro_allow">Permettre</string>
|
||||||
|
|
||||||
<string name="main_description">Cette application affichera une notification lorsque vos AirPods seront connectés.</string>
|
<string name="main_description">Cette application affichera une notification lorsque vos AirPods seront connectés.</string>
|
||||||
<string name="hide_message">Vous pouvez masquer cette application si vous voulez.</string>
|
<string name="hide_message">Vous pouvez masquer cette application si vous voulez.</string>
|
||||||
<string name="settings">Réglages</string>
|
<string name="settings">Réglages</string>
|
||||||
<string name="miui_warning">MIUI detected</string>
|
|
||||||
<string name="miui_warning_desc">The ROM running on this device has known compatibility issues. You can continue but OpenPods may not work properly.</string>
|
<string name="miui_warning">MIUI détecté</string>
|
||||||
<string name="miui_warning_continue">Continue</string>
|
<string name="miui_warning_continue">Continuer</string>
|
||||||
|
|
||||||
<string name="noBtText">Il semble que cet appareil ne dispose pas de Bluetooth LE.</string>
|
<string name="noBtText">Il semble que cet appareil ne dispose pas de Bluetooth LE.</string>
|
||||||
<string name="locationDisabledText">Vous devez activer la localisation pour permettre aux OpenPod de lire l\'état de vous AirPods.</string>
|
<string name="locationDisabledText">Vous devez activer la localisation pour permettre aux OpenPod de lire l\'état de vos AirPods.</string>
|
||||||
<string name="supportedDevicesTitle"><u>Appareils pris en charge:</u></string>
|
<string name="supportedDevicesTitle"><u>Appareils pris en charge :</u></string>
|
||||||
<string name="supportedDevicesItems">• Apple AirPods 1re génération\n• Apple AirPods 2e génération\n• Apple AirPods Pro</string>
|
<string name="supportedDevicesItems">• Apple AirPods 1re génération\n• Apple AirPods 2e génération\n• Apple AirPods Pro</string>
|
||||||
|
|
||||||
<string name="batterySaver">Économiseur de batterie (non recommandé)</string>
|
<string name="batterySaver">Économiseur de batterie (non recommandé)</string>
|
||||||
@@ -22,8 +23,7 @@
|
|||||||
<string name="hideClicked">L\'icône disparaîtra bientôt.</string>
|
<string name="hideClicked">L\'icône disparaîtra bientôt.</string>
|
||||||
<string name="about">À propos</string>
|
<string name="about">À propos</string>
|
||||||
|
|
||||||
<string name="about_dev">Developpé par Federico Dossena</string>
|
<string name="about_dev">Développé par Federico Dossena et Itai Levin</string>
|
||||||
<string name="website">Site web</string>
|
<string name="website">Site web</string>
|
||||||
<string name="github">Github</string>
|
|
||||||
<string name="donate">Faire un don</string>
|
<string name="donate">Faire un don</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="intro1">Questa app consente di monitorare lo stato delle tue AirPods su Android</string>
|
<string name="intro_title">Questa app consente di monitorare lo stato delle tue AirPods su Android</string>
|
||||||
<string name="intro2">Per funzionare, abbiamo bisogno dei permessi per Bluetooth LE (Posizione) e di esecuzione in background</string>
|
<string name="intro_message">Per funzionare, abbiamo bisogno dei permessi per Bluetooth LE (Posizione) e di esecuzione in background</string>
|
||||||
<string name="introAllow">Consenti</string>
|
<string name="intro_allow">Consenti</string>
|
||||||
|
|
||||||
<string name="main_description">L\'app mostrerà una notifica quando le tue AirPods sono connesse</string>
|
<string name="main_description">L\'app mostrerà una notifica quando le tue AirPods sono connesse</string>
|
||||||
<string name="hide_message">Puoi nascondere l\'app se vuoi</string>
|
<string name="hide_message">Puoi nascondere l\'app se vuoi</string>
|
||||||
<string name="settings">Impostazioni</string>
|
<string name="settings">Impostazioni</string>
|
||||||
|
|
||||||
<string name="miui_warning">MIUI rilevata</string>
|
<string name="miui_warning">MIUI rilevata</string>
|
||||||
<string name="miui_warning_desc">La ROM di questo dispositivo ha dei problemi di compatibilità noti. Puoi continuare ma OpenPods potrebbe non funzionare correttamente.</string>
|
<string name="miui_warning_desc">La ROM di questo dispositivo ha dei problemi di compatibilità noti. Puoi continuare ma OpenPods potrebbe non funzionare correttamente.</string>
|
||||||
<string name="miui_warning_continue">Continua</string>
|
<string name="miui_warning_continue">Continua</string>
|
||||||
@@ -22,8 +24,7 @@
|
|||||||
<string name="hideClicked">L\'icona sarà rimossa presto</string>
|
<string name="hideClicked">L\'icona sarà rimossa presto</string>
|
||||||
<string name="about">Informazioni su</string>
|
<string name="about">Informazioni su</string>
|
||||||
|
|
||||||
<string name="about_dev">Sviluppata da Federico Dossena</string>
|
<string name="about_dev">Sviluppata da Federico Dossena e Itai Levin</string>
|
||||||
<string name="website">Sito web</string>
|
<string name="website">Sito web</string>
|
||||||
<string name="github">Github</string>
|
|
||||||
<string name="donate">Donazioni</string>
|
<string name="donate">Donazioni</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -1,11 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="intro1">אפליקציה זו מאפשרת לך לבדוק את המצב של האיירפודס שלך מכל מכשיר אנדרואיד</string>
|
<string name="intro_title">אפליקציה זו מאפשרת לך לבדוק את המצב של האיירפודס שלך מכל מכשיר אנדרואיד</string>
|
||||||
<string name="intro2">כדי שאפליקציה זו תוכל לתפקד, הינך נדרש לאפשר גישה ל-Bluetooth LE (מיקום) ולריצה ברקע</string>
|
<string name="intro_message">כדי שאפליקציה זו תוכל לתפקד, הינך נדרש לאפשר גישה ל-Bluetooth LE (מיקום) ולריצה ברקע</string>
|
||||||
<string name="introAllow">אפשר</string>
|
<string name="intro_allow">אפשר</string>
|
||||||
|
|
||||||
<string name="main_description">האפליקציה תשלח התראה כאשר האיירפודס מחוברות</string>
|
<string name="main_description">האפליקציה תשלח התראה כאשר האיירפודס מחוברות</string>
|
||||||
<string name="hide_message">אתה יכול להסתיר אפליקציה זו</string>
|
<string name="hide_message">אתה יכול להסתיר אפליקציה זו</string>
|
||||||
<string name="settings">הגדרות</string>
|
<string name="settings">הגדרות</string>
|
||||||
|
|
||||||
<string name="miui_warning">MIUI נמצא</string>
|
<string name="miui_warning">MIUI נמצא</string>
|
||||||
<string name="miui_warning_desc">למערכת ההפעלה על מכשיר זה יש בעיות תאימות ידועות עם האפליקציה. אתה יכול להמשיך להשתמש ב-OpenPods אך לא בטוח שדברים יעבדו כמו שצריך.</string>
|
<string name="miui_warning_desc">למערכת ההפעלה על מכשיר זה יש בעיות תאימות ידועות עם האפליקציה. אתה יכול להמשיך להשתמש ב-OpenPods אך לא בטוח שדברים יעבדו כמו שצריך.</string>
|
||||||
<string name="miui_warning_continue">המשך</string>
|
<string name="miui_warning_continue">המשך</string>
|
||||||
@@ -25,7 +27,7 @@
|
|||||||
<string name="hideClicked">האפליקציה תוסתר בקרוב</string>
|
<string name="hideClicked">האפליקציה תוסתר בקרוב</string>
|
||||||
<string name="about">אודות</string>
|
<string name="about">אודות</string>
|
||||||
|
|
||||||
<string name="about_dev">פותח על ידי פדריקו דוסנה</string>
|
<string name="about_dev">פותח על ידי פדריקו דוסנה ואיתי לוין</string>
|
||||||
<string name="website">אתר המפתח</string>
|
<string name="website">אתר המפתח</string>
|
||||||
<string name="github">קוד מקור</string>
|
<string name="github">קוד מקור</string>
|
||||||
<string name="donate">תרומה</string>
|
<string name="donate">תרומה</string>
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="intro_title">이 앱을 통해 Android 기기에서 에어팟의 상태를 확인할 수 있습니다.</string>
|
||||||
|
<string name="intro_message">작동하려면 Bluetooth LE(위치)를 사용할 수 있는 권한과 백그라운드에서 실행할 수 있는 권한이 필요합니다.</string>
|
||||||
|
<string name="intro_allow">허용</string>
|
||||||
|
|
||||||
|
<string name="main_description">앱에 에어팟이 연결되면 알림이 표시됩니다.</string>
|
||||||
|
<string name="hide_message">이 앱을 숨길 수 있습니다.</string>
|
||||||
|
<string name="settings">설정</string>
|
||||||
|
|
||||||
|
<string name="miui_warning">MIUI 발견됨</string>
|
||||||
|
<string name="miui_warning_desc">이 장치에서 실행 중인 ROM에 알려진 호환성 문제가 있습니다. 계속할 수는 있지만 OpenPod가 제대로 작동하지 않을 수 있습니다.</string>
|
||||||
|
<string name="miui_warning_continue">계속</string>
|
||||||
|
|
||||||
|
<string name="noBtText">이 장치에는 Bluetooth LE가 없는 것 같습니다.</string>
|
||||||
|
<string name="locationDisabledText">OpenPod에서 상태를 읽을 수 있도록 하려면 위치를 허용해야 합니다.</string>
|
||||||
|
<string name="supportedDevicesTitle"><u>지원하는 기기:</u></string>
|
||||||
|
<string name="supportedDevicesItems">• 애플 에어팟 1세대\n• 애플 에어팟 2세대\n• 애플 에어팟 프로</string>
|
||||||
|
|
||||||
|
<string name="batterySaver">배터리 관리모드 (추천하지 않음)</string>
|
||||||
|
<string name="batterySaver_desc">Bluetooth에서 배터리를 많이 사용하는 경우 이 옵션을 활성화하세요.</string>
|
||||||
|
<string name="hide">앱 숨기기</string>
|
||||||
|
<string name="hide_desc">실행 프로그램에서 이 앱 숨기기</string>
|
||||||
|
<string name="hide_dialog">정말 계속하시겠습니까?</string>
|
||||||
|
<string name="hide_dialog_desc">정말 이 앱을 숨기시겠습니까? 앱을 다시 설치해야 기능을 해제할 수 있습니다.</string>
|
||||||
|
<string name="hide_dialog_button">숨기기</string>
|
||||||
|
<string name="hideClicked">아이콘이 곧 사라집니다</string>
|
||||||
|
<string name="about">정보</string>
|
||||||
|
|
||||||
|
<string name="about_dev">개발자 : Federico Dossena, Itai Levin</string>
|
||||||
|
<string name="website">웹사이트</string>
|
||||||
|
<string name="donate">후원하기</string>
|
||||||
|
</resources>
|
||||||
@@ -1,14 +1,15 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="intro1">Met deze app kun je de status van je AirPods bekijken op elk Android-apparaat</string>
|
<string name="intro_title">Met deze app kun je de status van je AirPods bekijken op elk Android-apparaat</string>
|
||||||
<string name="intro2">De app heeft toegang nodig tot Bluetooth LE (locatie), en moet op de achtergrond worden uitgevoerd</string>
|
<string name="intro_message">De app heeft toegang nodig tot Bluetooth LE (locatie), en moet op de achtergrond worden uitgevoerd</string>
|
||||||
<string name="introAllow">Toestaan</string>
|
<string name="intro_allow">Toestaan</string>
|
||||||
|
|
||||||
<string name="main_description">De app toont een melding zodra je je AirPods verbindt</string>
|
<string name="main_description">De app toont een melding zodra je je AirPods verbindt</string>
|
||||||
<string name="hide_message">Als je wilt, kun je deze app verbergen</string>
|
<string name="hide_message">Als je wilt, kun je deze app verbergen</string>
|
||||||
<string name="settings">Instellingen</string>
|
<string name="settings">Instellingen</string>
|
||||||
<string name="miui_warning">MIUI detected</string>
|
|
||||||
<string name="miui_warning_desc">The ROM running on this device has known compatibility issues. You can continue but OpenPods may not work properly.</string>
|
<string name="miui_warning">MIUI gedetecteerd</string>
|
||||||
<string name="miui_warning_continue">Continue</string>
|
<string name="miui_warning_continue">Doorgaan met</string>
|
||||||
|
|
||||||
<string name="noBtText">Het lijkt erop dat dit apparaat niet beschikt over Bluetooth LE</string>
|
<string name="noBtText">Het lijkt erop dat dit apparaat niet beschikt over Bluetooth LE</string>
|
||||||
<string name="locationDisabledText">Schakel je locatie in zodat OpenPods de status kan uitlezen</string>
|
<string name="locationDisabledText">Schakel je locatie in zodat OpenPods de status kan uitlezen</string>
|
||||||
@@ -22,8 +23,7 @@
|
|||||||
<string name="hideClicked">Het pictogram verdwijnt spoedig</string>
|
<string name="hideClicked">Het pictogram verdwijnt spoedig</string>
|
||||||
<string name="about">Over</string>
|
<string name="about">Over</string>
|
||||||
|
|
||||||
<string name="about_dev">Gemaakt door Federico Dossena</string>
|
<string name="about_dev">Gemaakt door Federico Dossena en Itai Levin</string>
|
||||||
<string name="website">Website</string>
|
<string name="website">Website</string>
|
||||||
<string name="github">GitHub</string>
|
|
||||||
<string name="donate">Doneren</string>
|
<string name="donate">Doneren</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="intro1">Это приложение позволяет Вам проверить статус ваших AirPods на любом Android-устройстве</string>
|
<string name="intro_title">Это приложение позволяет Вам проверить статус ваших AirPods на любом Android-устройстве</string>
|
||||||
<string name="intro2">Для работы нам нужно Bluetooth LE(местоположение) и разрешение на запуск в фоновом режиме</string>
|
<string name="intro_message">Для работы нам нужно Bluetooth LE(местоположение) и разрешение на запуск в фоновом режиме</string>
|
||||||
<string name="introAllow">Разрешить</string>
|
<string name="intro_allow">Разрешить</string>
|
||||||
|
|
||||||
<string name="main_description">Приложение покажет уведомление, когда будет установлено соединение с AirPods</string>
|
<string name="main_description">Приложение покажет уведомление, когда будет установлено соединение с AirPods</string>
|
||||||
<string name="hide_message">Вы можете скрыть это приложение, если хотите</string>
|
<string name="hide_message">Вы можете скрыть это приложение, если хотите</string>
|
||||||
<string name="settings">Настройки</string>
|
<string name="settings">Настройки</string>
|
||||||
<string name="miui_warning">MIUI detected</string>
|
|
||||||
<string name="miui_warning_desc">The ROM running on this device has known compatibility issues. You can continue but OpenPods may not work properly.</string>
|
<string name="miui_warning">MIUI обнаружено</string>
|
||||||
<string name="miui_warning_continue">Continue</string>
|
<string name="miui_warning_continue">Продолжать</string>
|
||||||
|
|
||||||
<string name="noBtText">Похоже, что Bluetooth LE не поддерживается на Вашем устройстве</string>
|
<string name="noBtText">Похоже, что Bluetooth LE не поддерживается на Вашем устройстве</string>
|
||||||
<string name="locationDisabledText">Вам нужно включить местоположение, чтобы разрешить OpenPods читать статус</string>
|
<string name="locationDisabledText">Вам нужно включить местоположение, чтобы разрешить OpenPods читать статус</string>
|
||||||
@@ -22,8 +23,7 @@
|
|||||||
<string name="hideClicked">Иконка скоро исчезнет</string>
|
<string name="hideClicked">Иконка скоро исчезнет</string>
|
||||||
<string name="about">О приложении</string>
|
<string name="about">О приложении</string>
|
||||||
|
|
||||||
<string name="about_dev">Разработано Federico Dossena</string>
|
<string name="about_dev">Разработано Federico Dossena и Itai Levin</string>
|
||||||
<string name="website">Сайт</string>
|
<string name="website">Сайт</string>
|
||||||
<string name="github">Github</string>
|
|
||||||
<string name="donate">Поддержать</string>
|
<string name="donate">Поддержать</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="intro1">Цей додаток дозволяє Вам перевірити статус ваших AirPods на будь-якому Android-пристрої</string>
|
<string name="intro_title">Цей додаток дозволяє Вам перевірити статус ваших AirPods на будь-якому Android-пристрої</string>
|
||||||
<string name="intro2">Для роботи ми використовуємо Bluetooth LE (місцезнаходження) та дозвіл на роботу додатку в фоновому режимі</string>
|
<string name="intro_message">Для роботи ми використовуємо Bluetooth LE (місцезнаходження) та дозвіл на роботу додатку в фоновому режимі</string>
|
||||||
<string name="introAllow">Дозволити</string>
|
<string name="intro_allow">Дозволити</string>
|
||||||
|
|
||||||
<string name="main_description">Цей додаток покаже сповіщення, коли Ваші AirPods будуть підключені</string>
|
<string name="main_description">Цей додаток покаже сповіщення, коли Ваші AirPods будуть підключені</string>
|
||||||
<string name="hide_message">Ви можете сховати цей додаток, якщо бажаєте</string>
|
<string name="hide_message">Ви можете сховати цей додаток, якщо бажаєте</string>
|
||||||
<string name="settings">Налаштування</string>
|
<string name="settings">Налаштування</string>
|
||||||
<string name="miui_warning">MIUI detected</string>
|
|
||||||
<string name="miui_warning_desc">The ROM running on this device has known compatibility issues. You can continue but OpenPods may not work properly.</string>
|
<string name="miui_warning">MIUI виявлено</string>
|
||||||
<string name="miui_warning_continue">Continue</string>
|
<string name="miui_warning_continue">продовжувати</string>
|
||||||
|
|
||||||
<string name="noBtText">Схоже, що цей пристрій не підтримує Bluetooth LE</string>
|
<string name="noBtText">Схоже, що цей пристрій не підтримує Bluetooth LE</string>
|
||||||
<string name="locationDisabledText">Вам потрібно ввімкнути місцезнаходження, для того, щоб дозволити OpenPods читати статус</string>
|
<string name="locationDisabledText">Вам потрібно ввімкнути місцезнаходження, для того, щоб дозволити OpenPods читати статус</string>
|
||||||
@@ -22,8 +23,7 @@
|
|||||||
<string name="hideClicked">Іконка скоро зникне</string>
|
<string name="hideClicked">Іконка скоро зникне</string>
|
||||||
<string name="about">Про програму</string>
|
<string name="about">Про програму</string>
|
||||||
|
|
||||||
<string name="about_dev">Розроблено Federico Dossena</string>
|
<string name="about_dev">Розроблено Federico Dossena й Itai Levin</string>
|
||||||
<string name="website">Сайт</string>
|
<string name="website">Сайт</string>
|
||||||
<string name="github">Github</string>
|
|
||||||
<string name="donate">Підтримати</string>
|
<string name="donate">Підтримати</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="intro1">此应用可以让您在任何安卓设备上查看 AirPods 的状态</string>
|
<string name="intro_title">此应用可以让您在任何安卓设备上查看 AirPods 的状态</string>
|
||||||
<string name="intro2">我们需要蓝牙、定位以及在后台运行的权限来正常运作</string>
|
<string name="intro_message">我们需要蓝牙、定位以及在后台运行的权限来正常运作</string>
|
||||||
<string name="introAllow">允许</string>
|
<string name="intro_allow">允许</string>
|
||||||
|
|
||||||
<string name="main_description">当您的 AirPods 接入时,我们会在通知栏显示通知</string>
|
<string name="main_description">当您的 AirPods 接入时,我们会在通知栏显示通知</string>
|
||||||
<string name="hide_message">您可以隐藏此应用</string>
|
<string name="hide_message">您可以隐藏此应用</string>
|
||||||
<string name="settings">Settings</string>
|
|
||||||
<string name="miui_warning">MIUI detected</string>
|
|
||||||
<string name="miui_warning_desc">The ROM running on this device has known compatibility issues. You can continue but OpenPods may not work properly.</string>
|
|
||||||
<string name="miui_warning_continue">Continue</string>
|
|
||||||
|
|
||||||
<string name="noBtText">看起来您的设备并不支持蓝牙</string>
|
<string name="noBtText">看起来您的设备并不支持蓝牙</string>
|
||||||
<string name="locationDisabledText">您需要开启定位来让 OpenPods 读取状态</string>
|
<string name="locationDisabledText">您需要开启定位来让 OpenPods 读取状态</string>
|
||||||
@@ -22,8 +19,7 @@
|
|||||||
<string name="hideClicked">桌面图标很快就会被隐藏掉</string>
|
<string name="hideClicked">桌面图标很快就会被隐藏掉</string>
|
||||||
<string name="about">关于</string>
|
<string name="about">关于</string>
|
||||||
|
|
||||||
<string name="about_dev">由 Federico Dossena 开发</string>
|
<string name="about_dev">由 Federico Dossena 和 Itai Levin 开发</string>
|
||||||
<string name="website">网站</string>
|
<string name="website">网站</string>
|
||||||
<string name="github">Github</string>
|
|
||||||
<string name="donate">捐赠</string>
|
<string name="donate">捐赠</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -2,15 +2,25 @@
|
|||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
<string name="app_name" translatable="false">OpenPods</string>
|
<string name="app_name" translatable="false">OpenPods</string>
|
||||||
|
|
||||||
<string name="intro1">This app lets you check the status of your AirPods on any Android device</string>
|
<string name="bg_noti_channel" translatable="false">Background Notification</string>
|
||||||
<string name="intro2">To operate, we need permission to use Bluetooth LE (Location) and permission to run in background</string>
|
<string name="bg_noti_title" tools:ignore="MissingTranslation">Running in the background</string>
|
||||||
<string name="introAllow">Allow</string>
|
<string name="bg_noti_text" tools:ignore="MissingTranslation">Click to open notification settings</string>
|
||||||
|
|
||||||
|
<string name="intro_title">This app lets you check the status of your AirPods on any Android device</string>
|
||||||
|
<string name="intro_message">To operate, we need permission to use Bluetooth LE (Location) and permission to run in background</string>
|
||||||
|
<string name="intro_allow">Allow</string>
|
||||||
|
<string name="intro_step" tools:ignore="MissingTranslation">Step</string>
|
||||||
|
<string name="intro_bat_perm" tools:ignore="MissingTranslation">Battery Optimization</string>
|
||||||
|
<string name="intro_loc1_perm" tools:ignore="MissingTranslation">Location Permission</string>
|
||||||
|
<string name="intro_loc2_perm" tools:ignore="MissingTranslation">Background Location Permission</string>
|
||||||
|
|
||||||
<string name="main_description">The app will show a notification when your AirPods are connected</string>
|
<string name="main_description">The app will show a notification when your AirPods are connected</string>
|
||||||
<string name="hide_message">You can hide this app if you want</string>
|
<string name="hide_message">You can hide this app if you want</string>
|
||||||
<string name="settings">Settings</string>
|
<string name="settings" tools:ignore="MissingTranslation">Settings</string>
|
||||||
<string name="miui_warning">MIUI detected</string>
|
|
||||||
<string name="miui_warning_desc">The ROM running on this device has known compatibility issues. You can continue but OpenPods may not work properly.</string>
|
<string name="miui_warning" tools:ignore="MissingTranslation">MIUI detected</string>
|
||||||
<string name="miui_warning_continue">Continue</string>
|
<string name="miui_warning_desc" tools:ignore="MissingTranslation">The ROM running on this device has known compatibility issues. You can continue but OpenPods may not work properly.</string>
|
||||||
|
<string name="miui_warning_continue" tools:ignore="MissingTranslation">Continue</string>
|
||||||
|
|
||||||
<string name="noBtText">It looks like this device doesn\'t have Bluetooth LE</string>
|
<string name="noBtText">It looks like this device doesn\'t have Bluetooth LE</string>
|
||||||
<string name="locationDisabledText">You need to turn on Location to allow OpenPods to read the status</string>
|
<string name="locationDisabledText">You need to turn on Location to allow OpenPods to read the status</string>
|
||||||
@@ -27,9 +37,9 @@
|
|||||||
<string name="hideClicked">The icon will disappear soon</string>
|
<string name="hideClicked">The icon will disappear soon</string>
|
||||||
<string name="about">About</string>
|
<string name="about">About</string>
|
||||||
|
|
||||||
<string name="about_dev">Developed by Federico Dossena</string>
|
<string name="about_dev">Developed by Federico Dossena and Itai Levin</string>
|
||||||
<string name="website">Website</string>
|
<string name="website">Website</string>
|
||||||
<string name="github">Github</string>
|
<string name="github" tools:ignore="MissingTranslation">Github</string>
|
||||||
<string name="donate">Donate</string>
|
<string name="donate">Donate</string>
|
||||||
<string name="fdroid" translatable="false">F-Droid</string>
|
<string name="fdroid" translatable="false">F-Droid</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<style name="AppTheme" parent="Theme.AppCompat.DayNight.DarkActionBar">
|
<style name="AppTheme" parent="Theme.AppCompat.DayNight.DarkActionBar">
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
mavenCentral()
|
||||||
|
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:4.0.1'
|
classpath 'com.android.tools.build:gradle:4.2.1'
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
@@ -17,7 +17,7 @@ buildscript {
|
|||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
mavenCentral()
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
#Mon Jun 08 20:04:20 IDT 2020
|
#Mon Jun 07 14:29:04 IDT 2021
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-all.zip
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
@@ -20,9 +20,10 @@ The Free and Open Source app for monitoring your AirPods on Android
|
|||||||
* Apple AirPods Pro
|
* Apple AirPods Pro
|
||||||
|
|
||||||
## DO NOT REUPLOAD TO GOOGLE PLAY
|
## DO NOT REUPLOAD TO GOOGLE PLAY
|
||||||
**This app violates Google Play policies and is designed to break if you try to fix that unless you really know what you're doing.** You have been warned. I do NOT want this app to be on Google Play.
|
**This app violates Google Play policies and is designed to break if you try to fix that unless you really know what you're doing.**<br />
|
||||||
|
Legal actions can and will be taken when uploading a compiled version to the Google Play Store that does not comply with the terms and conditions of the app's license. As a result, you may no longer be able to publish apps to the Google Play Store. This app is not intended to be uploaded to the Google Play Store. The developer is legally allowed to demand compensation.
|
||||||
|
|
||||||
I had to do this because several people were redistributing modified proprietary versions of this app on Google Play in violation of the GNU GPLv3 license.
|
This paragraph was added due to multiple license violations found on the Google Play Store. If you're not sure whether you're allowed to distribute your modified version, please contact the developer.
|
||||||
|
|
||||||
## Donate
|
## Donate
|
||||||
[Donate with PayPal](https://www.paypal.me/sineisochronic)
|
[Donate with PayPal](https://www.paypal.me/sineisochronic)
|
||||||
@@ -31,7 +32,7 @@ I had to do this because several people were redistributing modified proprietary
|
|||||||
<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/screen1.png" width="400"> <img src="fastlane/metadata/android/en-US/images/phoneScreenshots/screen2.png" width="400"> <img src="fastlane/metadata/android/en-US/images/phoneScreenshots/screen3.png" width="400"> <img src="fastlane/metadata/android/en-US/images/phoneScreenshots/screen4.png" width="400">
|
<img src="fastlane/metadata/android/en-US/images/phoneScreenshots/screen1.png" width="400"> <img src="fastlane/metadata/android/en-US/images/phoneScreenshots/screen2.png" width="400"> <img src="fastlane/metadata/android/en-US/images/phoneScreenshots/screen3.png" width="400"> <img src="fastlane/metadata/android/en-US/images/phoneScreenshots/screen4.png" width="400">
|
||||||
|
|
||||||
## License
|
## License
|
||||||
Copyright (C) 2019 Federico Dossena
|
Copyright (C) 2021 Federico Dossena
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|||||||
Reference in New Issue
Block a user