Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

update #1

Open
wants to merge 44 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
0ad5c42
中文
Mar 12, 2020
4d28abe
增加编译配置,是中文生效
Mar 12, 2020
7978252
Adjust some translations
Mar 12, 2020
cf5bbc0
Merge pull request #67 from czheji/master
farmerbb Mar 20, 2020
2c407fe
Update translation credits
farmerbb Mar 20, 2020
9cace02
Adjust a translation
dadaewq Apr 1, 2020
71ef09e
Merge pull request #68 from dadaewq/master
farmerbb Apr 6, 2020
7ca710e
Update dependencies
farmerbb Jun 15, 2020
c3490ba
Implement dynamic copyright date
farmerbb Jun 15, 2020
66d2be1
Buying a couple more years worth of time
farmerbb Jun 15, 2020
b761bbb
Disable overscan and immersive mode prefs on Android 11
farmerbb Jun 15, 2020
e5f216c
Better handling of immersive mode & overscan prefs
farmerbb Jun 16, 2020
b2c6ae2
Remove notch compatibility mode
farmerbb Jun 16, 2020
7a63c74
Don't show disabled options on the profile edit & quick actions screens
farmerbb Jun 16, 2020
377115b
Refactor4Green - Cache energy pattern
anasofiagribeiro Jul 17, 2020
f1dda60
Refactor4Green - Dynamic Retry Delay Energy Pattern (update)
anasofiagribeiro Jul 20, 2020
351298c
Refactor4Green updates
anasofiagribeiro Jul 24, 2020
dfa33b5
Merge pull request #72 from Refactor4Green/Refactor4Green
farmerbb Jul 27, 2020
6bb9280
Revert changes to SecondScreenIntentService and AndroidManifest
farmerbb Jul 27, 2020
a1f519c
Update dependencies
farmerbb Sep 28, 2020
7c417a1
Fix issues / crashes with Taskbar and freeform mode prefs
farmerbb Sep 28, 2020
d06dd82
Whoops
farmerbb Sep 28, 2020
8cacc69
Implement support for changing default launcher to Taskbar on rooted …
farmerbb Sep 28, 2020
99c4c42
Bump tested API version to 30
farmerbb Sep 28, 2020
5e994ba
Don't allow the safeguard to reset resolution if Taskbar's desktop mo…
farmerbb Nov 16, 2020
375a95d
Update dependencies + compile with SDK 30
farmerbb Nov 16, 2020
b22cd54
Hide option for enabling Wi-Fi on Android 10+
farmerbb Dec 11, 2020
74c05c9
SecondScreen 2.9.2 (release 1)
farmerbb Jan 12, 2021
e6fdecf
Fix Tasker-related crash
farmerbb May 24, 2021
2056218
Update dependencies
farmerbb Oct 7, 2021
eb9f75a
Preliminary implementation of Shizuku
farmerbb Oct 7, 2021
3dd38b9
Prefer Maven Central over JCenter
farmerbb Oct 12, 2021
008d976
Update Gradle + AGP
farmerbb Jan 16, 2023
2e07c1c
Re-add support for toggling Wi-Fi using root / support library
farmerbb Jan 16, 2023
e40c818
Fixes for previous commit
farmerbb Jan 16, 2023
a58b3df
Run code cleanup action on whole project
farmerbb Jan 17, 2023
81f45ed
Bump targetSdkVersion to 31
farmerbb Jan 17, 2023
8776a7c
Show explanatory dialog for Shizuku permission
farmerbb Jan 17, 2023
50917d0
Add files via upload
farmerbb Jan 17, 2023
07e64f7
SecondScreen 2.9.3 (release 1)
farmerbb Jan 19, 2023
8f39508
Add sysfs backlight path for OnePlus 9 Pro
farmerbb Apr 12, 2023
7a5c565
Dependency updates + targetSdkVersion 34
farmerbb Sep 11, 2024
d8796a1
Fix issue where orientation would stay locked after turning off profile
farmerbb Sep 11, 2024
29949c4
SecondScreen 2.9.4 (release 1)
farmerbb Sep 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
/build
/captures
/app/build
output.json
output-metadata.json
8 changes: 8 additions & 0 deletions Privacy-Policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## SecondScreen Privacy Policy

This is an open source Android app and its entire [source code](https://github.com/farmerbb/SecondScreen) is available on GitHub under the [Apache 2.0](https://github.com/farmerbb/SecondScreen/blob/master/LICENSE) license.

**This app does not connect to the internet in any way** - in fact, the Android operating system explicitly disallows internet access for this app in particular as it does not request the `android.permission.INTERNET` permission.

This app does allow the Android operating system to backup and restore its data automatically via the Auto Backup service, which involves app data being periodically backed up to your personal Google Drive account.
* For more information, see the [Auto Backup service documentation](https://developer.android.com/guide/topics/data/autobackup) and the [Google Drive Terms of Service](https://www.google.com/drive/terms-of-service/).
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@ SecondScreen is an application designed for power users that frequently connect
* César Parga, Adrian Brown (Spanish)
* Christophe Romana (French)
* ja-som (Slovak)
* Heimen Stoffels (German)
* Heimen Stoffels (Dutch)
* Asbesbopispa (Italian)
* czheji (Chinese)
59 changes: 29 additions & 30 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,35 @@ repositories {
}

android {
compileSdkVersion 29
buildToolsVersion "28.0.3"
compileSdk 34
namespace "com.farmerbb.secondscreen"

defaultConfig {
applicationId "com.farmerbb.secondscreen"
minSdkVersion 17

/* targetSdkVersion is explicitly set to API 27.
* This is the earliest API level that Google still allows apps to be published on the
* Play Store with, and also happens to be the latest API level that Android allows using
* reflection to set resolution / DPI on non-rooted devices with (on Android 9 and later)
*
* After November 1, 2019, the following changes will need to be made to SecondScreen:
*
* - Add verbiage somewhere in the app (a snackbar, maybe?) encouraging users to download
* the SecondScreen Support Library as that will be the only way for users on non-rooted
* devices running Android 9 or later to set resolution / DPI without a reboot
*
* - Re-implement the changes made in commit 434328b (and reverted in 3d36992) setting
* the default UI refresh method to "soft reboot" on Android 9 and later
*/
minSdkVersion 21

//noinspection OldTargetApi
targetSdkVersion 27
targetSdkVersion 34

versionCode 183
versionName "2.9.1"
versionCode 186
versionName "2.9.4"

resConfigs "en", "es", "fr", "sk", "nl", "it"
resConfigs "en", "es", "fr", "sk", "nl", "it", "zh"
vectorDrawables.useSupportLibrary = true

buildConfigField "float", "TESTED_API_VERSION", "29.0f"
buildConfigField "float", "TESTED_API_VERSION", "35.0f"
buildConfigField "String", "SUPPORT_APPLICATION_ID", "\"com.farmerbb.secondscreen.support\""
buildConfigField "long", "TIMESTAMP", "${System.currentTimeMillis()}L"
}

buildFeatures {
buildConfig true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_21
targetCompatibility JavaVersion.VERSION_21
}

signingConfigs {
Expand All @@ -68,7 +60,7 @@ android {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
manifestPlaceholders = [appName: "@string/app_name"]

Expand Down Expand Up @@ -106,11 +98,18 @@ android {
}

dependencies {
def shizuku_version = '12.1.0'

implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'org.apache.commons:commons-lang3:3.9'
implementation 'eu.chainfire:libsuperuser:1.1.0.201907261845'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'com.google.android.material:material:1.12.0'
implementation "dev.rikka.shizuku:api:$shizuku_version"
implementation "dev.rikka.shizuku:provider:$shizuku_version"
implementation 'org.apache.commons:commons-lang3:3.17.0'
implementation 'eu.chainfire:libsuperuser:1.1.1'
implementation 'moe.banana:toast-compat:1.0.5'
implementation 'org.lsposed.hiddenapibypass:hiddenapibypass:3.0'
implementation group:'com.twofortyfouram', name:'android-plugin-api-for-locale', version:'[1.0.2,2.0['

coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.1.2"
}
103 changes: 86 additions & 17 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.farmerbb.secondscreen"
android:installLocation="internalOnly" >

<uses-feature
Expand Down Expand Up @@ -49,9 +48,21 @@
<uses-permission-sdk-23 android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission-sdk-23 android:name="android.permission.WRITE_SECURE_SETTINGS"/>
<uses-permission-sdk-23 android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission-sdk-23 android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
<uses-permission-sdk-23 android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission-sdk-23 android:name="com.farmerbb.secondscreen.support.USE_SUPPORT_LIBRARY"/>

<uses-sdk
tools:overrideLibrary="rikka.shizuku.provider,rikka.shizuku.api,rikka.shizuku.shared,rikka.shizuku.aidl"/>

<queries>
<package android:name="com.farmerbb.secondscreen.support" />
<package android:name="com.farmerbb.taskbar" />
<package android:name="com.farmerbb.taskbar.paid" />
</queries>

<application
android:name=".SecondScreenApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="${appName}"
Expand All @@ -75,7 +86,8 @@
</activity>
<activity
android:name="com.farmerbb.secondscreen.activity.DummyLauncherActivity"
android:enabled="false" >
android:enabled="false"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down Expand Up @@ -109,7 +121,8 @@
android:name="com.farmerbb.secondscreen.activity.MainActivity"
android:label="${appName}"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustPan" >
android:windowSoftInputMode="adjustPan"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.APPLICATION_PREFERENCES"/>
Expand All @@ -123,7 +136,9 @@
android:excludeFromRecents="true"
android:label="${appName}"
android:theme="@style/Theme.Secondscreen.Dialog.List"
android:documentLaunchMode="always" >
android:documentLaunchMode="always"
android:exported="true"
tools:ignore="ExportedPreferenceActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down Expand Up @@ -163,7 +178,8 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/label_quick_actions"
android:documentLaunchMode="always"
android:theme="@style/Theme.Secondscreen.QuickActionsDialog" >
android:theme="@style/Theme.Secondscreen.QuickActionsDialog"
tools:ignore="ExportedPreferenceActivity">
<intent-filter>
<action android:name="com.twofortyfouram.locale.intent.action.EDIT_SETTING" />
<action android:name="android.intent.action.MAIN" />
Expand Down Expand Up @@ -262,11 +278,16 @@

<service
android:name="com.farmerbb.secondscreen.service.BootService"
android:exported="true" >
android:exported="true"
android:foregroundServiceType="specialUse">
<property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="This is a short-lived service that is required to be run in the foreground to accomplish its tasks"/>
</service>
<service
android:name="com.farmerbb.secondscreen.service.DisableKeyboardService"
android:permission="android.permission.BIND_INPUT_METHOD">
android:permission="android.permission.BIND_INPUT_METHOD"
android:exported="true">
<intent-filter>
<action android:name="android.view.InputMethod" />
</intent-filter>
Expand All @@ -276,44 +297,92 @@
</service>
<service
android:name="com.farmerbb.secondscreen.service.DisplayConnectionService"
android:exported="true" >
android:exported="true"
android:foregroundServiceType="specialUse">
<property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="This foreground service is required for hosting broadcast receivers that listen to display connection events, which are hosted inside of a service instead of an activity"/>
</service>
<service
android:name="com.farmerbb.secondscreen.service.LockDeviceService"
android:exported="true" >
android:exported="true"
android:foregroundServiceType="specialUse">
<property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="This is a short-lived service that is required to be run in the foreground to accomplish its tasks"/>
</service>
<service
android:name="com.farmerbb.secondscreen.service.NotificationService"
android:exported="true" >
android:exported="true"
android:foregroundServiceType="specialUse">
<property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="This foreground service is required in order to access core functionality while the user is outside the app, via a notification with action buttons"/>
</service>
<service
android:name="com.farmerbb.secondscreen.service.ProfileLoadService"
android:exported="true" >
android:exported="true"
android:foregroundServiceType="specialUse">
<property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="This is a short-lived service that is required to be run in the foreground to accomplish its tasks"/>
</service>
<service
android:name="com.farmerbb.secondscreen.service.SafeModeToggleService"
android:exported="true" >
android:exported="true"
android:foregroundServiceType="specialUse">
<property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="This is a short-lived service that is required to be run in the foreground to accomplish its tasks"/>
</service>
<service
android:name="com.farmerbb.secondscreen.service.ScreenOnService"
android:exported="true" >
android:exported="true"
android:foregroundServiceType="specialUse">
<property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="This is a short-lived service that is required to be run in the foreground to accomplish its tasks"/>
</service>
<service
android:name="com.farmerbb.secondscreen.service.TempBacklightOnService"
android:exported="true" >
android:exported="true"
android:foregroundServiceType="specialUse">
<property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="This is a short-lived service that is required to be run in the foreground to accomplish its tasks"/>
</service>
<service
android:name="com.farmerbb.secondscreen.service.TestOverscanService"
android:exported="true" >
android:exported="true"
android:foregroundServiceType="specialUse">
<property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="This is a short-lived service that is required to be run in the foreground to accomplish its tasks"/>
</service>
<service
android:name="com.farmerbb.secondscreen.service.TimeoutService"
android:exported="true" >
android:exported="true"
android:foregroundServiceType="specialUse">
<property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="This is a short-lived service that is required to be run in the foreground to accomplish its tasks"/>
</service>
<service
android:name="com.farmerbb.secondscreen.service.TurnOffService"
android:exported="true" >
android:exported="true"
android:foregroundServiceType="specialUse">
<property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="This is a short-lived service that is required to be run in the foreground to accomplish its tasks"/>
</service>

<provider
android:name="rikka.shizuku.ShizukuProvider"
android:authorities="${applicationId}.shizuku"
android:multiprocess="false"
android:enabled="true"
android:exported="true"
android:permission="android.permission.INTERACT_ACROSS_USERS_FULL" />
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/* Copyright 2020 Braden Farmer
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.farmerbb.secondscreen;

import android.app.Application;
import android.os.Build;

import org.lsposed.hiddenapibypass.HiddenApiBypass;

public class SecondScreenApplication extends Application {
@Override
public void onCreate() {
super.onCreate();

if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
HiddenApiBypass.addHiddenApiExemptions("");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ private void showMenu() {
header.setTypeface(Typeface.DEFAULT);

// Close notification drawer
Intent closeDrawer = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
sendBroadcast(closeDrawer);
U.closeNotificationDrawer(this);

DisplayManager dm = (DisplayManager) getApplicationContext().getSystemService(DISPLAY_SERVICE);
DisplayMetrics metrics = new DisplayMetrics();
Expand Down
Loading