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

Add support for API 26 and above #6

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

mtiidla
Copy link

@mtiidla mtiidla commented Jan 28, 2020

ActivityManagerNative was deprecated in API 26 and most of the functionality, including setAlwaysFinish() moved to ActivityManager.

  • Added support for reflectively calling setAlwaysFinish() on ActivityManager on API 26 and above
  • Kept support for reflectively calling setAlwaysFinish() on ActivityManagerNative on API 24 and API 25
  • Bumped Gradle versions to the latest stable releases
  • Migrated the project to AndroidX
  • Added error to the Log.e statement to allow debugging potential issues more easily in the future.

Tested with emulators on API level 25, 26, 28 and 29. All work as expected.
The required permissions have not changed, so running the same adb commands is still necessary.

This fixes #4 and should also fix #5

Copy link

@prcaen prcaen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for providing this update :),

I think you should also build the APK present in:
app/keep-activities-qs-release.apk

app/build.gradle Outdated
@@ -41,5 +37,5 @@ android {
}
}
dependencies {
compile 'com.android.support:support-annotations:25.0.1'
api 'androidx.annotation:annotation:1.1.0'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compile has been replaced by implementation
api is useful when you want to expose class and symbols to another module.
Here this is useless.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, didn't notice that migration to AndroidX automatically used api.

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, you should run the following command:
./gradlew wrapper --gradle-version=5.4.1 --distribution-type=all, it will update:

  • gradlew
  • gradlew.bat
  • ...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. If I remember correctly, this was no longer updating anything around gradle version 4 and 5, but there were a lot of changes since v2.14.

@mtiidla
Copy link
Author

mtiidla commented Jan 28, 2020

Regarding the release .apk, I would need release keystore to sign it. Or is it just the debug apk?

@prcaen
Copy link

prcaen commented Jan 29, 2020

Yes, the APK is signed.
Keytool command give us the following info:

  • Owner: Stocard.
    MD5 : A2:A8:8B:0B:36:DF:45:C0:73:B3:88:A0:72:75:E6:DC
  • SHA1 : 6F:46:5C:A1:3D:A6:5B:2C:C3:39:19:85:DF:35:22:41:7D:4A:BC:24
  • SHA256 : 25:B3:8E:D5:3B:21:67:F9:53:A8:98:7E:3F:D9:16:23:10:7E:3E:30:6E:74:6D:C3:10:0A:41:25:B5:19:C1:6A

So I guess this is signed.
Maybe @f-barth can help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error grant permissions on Android 8.1.0 The reflected classes and methods have moved
2 participants