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 sed to fix issue#27 for longer password length #119

Closed

Conversation

AkechiShiro
Copy link

@AkechiShiro AkechiShiro commented Jun 6, 2022

If there is any misplacement of the sed lines, be sure to tell me where I should move them in the logic of the Patch.sh
Fixes #27

@AkechiShiro AkechiShiro changed the title Add sed to fix issue#27 for longer password Add sed to fix issue#27 for longer password length Jun 6, 2022
@SkewedZeppelin
Copy link
Member

SkewedZeppelin commented Jun 6, 2022

While that file exists in all branches, MAX_PASSWORD_LENGTH is only defined in 18.1 and 19.1: GrapheneOS/platform_frameworks_base@0708fbd

And the Settings change is needed for <18.1 too: GrapheneOS/platform_packages_apps_Settings@0f1fc64

@AkechiShiro
Copy link
Author

Hey @SkewedZeppelin there were already patches for LOS <18 but up to 48 chars max, I've increased all those to 64 chars.

@AkechiShiro
Copy link
Author

Hey any reason why this PR was closed ? Should I have signed my commits ?
Also I've seen you added more sed for a return statement I believe, would you mind explaining that please ?

Copy link
Member

@SkewedZeppelin SkewedZeppelin left a comment

Choose a reason for hiding this comment

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

OK so:

14/15/16/17 needed this for frameworks/base: GrapheneOS/platform_frameworks_base@0708fbd
and this for packages/apps/Settings: GrapheneOS/platform_packages_apps_Settings@0f1fc64

18 and 19 only needed this for frameworks/base: GrapheneOS/platform_frameworks_base@63da3a2

DivestOS had already included the Settings change for 14/15/16/17, but at 48 instead of 64 characters

And yes commits need to be signed using -s as appropriate: https://divestos.org/index.php?page=about#contributing

@@ -120,6 +120,7 @@ sed -i 's/DEFAULT_MAX_FILES = 1000;/DEFAULT_MAX_FILES = 0;/' services/core/java/
sed -i 's/DEFAULT_MAX_FILES_LOWRAM = 300;/DEFAULT_MAX_FILES_LOWRAM = 0;/' services/core/java/com/android/server/DropBoxManagerService.java;
sed -i 's/(notif.needNotify)/(true)/' location/java/com/android/internal/location/GpsNetInitiatedHandler.java; #Notify the user if their location is requested via SUPL
sed -i 's/DEFAULT_STRONG_AUTH_TIMEOUT_MS = 72 \* 60 \* 60 \* 1000;/DEFAULT_STRONG_AUTH_TIMEOUT_MS = 12 * 60 * 60 * 1000;/' core/java/android/app/admin/DevicePolicyManager.java; #Decrease the strong auth prompt timeout to occur more often
sed -i 's/mPasswordMaxLength = 16;/mPasswordMaxLength = 64;/' src/com/android/settings/password/ChooseLockPassword.java #MaxPassword Length increased (GrapheneOS)
Copy link
Member

Choose a reason for hiding this comment

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

this is the Settings changed placed in the frameworks/base section and does not match the others

@@ -173,6 +173,7 @@ sed -i 's/(notif.needNotify)/(true)/' location/java/com/android/internal/locatio
sed -i 's/entry == null/entry == null || true/' core/java/android/os/RecoverySystem.java; #Skip strict update compatibiltity checks XXX: TEMPORARY FIX
sed -i 's/!Build.isBuildConsistent()/false/' services/core/java/com/android/server/wm/ActivityTaskManagerService.java; #Disable partition fingerprint mismatch warnings XXX: TEMPORARY FIX
sed -i 's/DEFAULT_STRONG_AUTH_TIMEOUT_MS = 72 \* 60 \* 60 \* 1000;/DEFAULT_STRONG_AUTH_TIMEOUT_MS = 12 * 60 * 60 * 1000;/' core/java/android/app/admin/DevicePolicyManager.java; #Decrease the strong auth prompt timeout to occur more often
sed -i 's/MAX_PASSWORD_LENGTH = 16;/MAX_PASSWORD_LENGTH = 64;/' core/java/android/app/admin/DevicePolicyManager.java; # Increase max password length (GrapheneOS)
Copy link
Member

Choose a reason for hiding this comment

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

this one and the 19.1 one are correct

@@ -220,7 +220,7 @@ if [ "$DOS_SENSORS_PERM" = true ]; then
applyPatch "$DOS_PATCHES/android_packages_apps_Settings/0002-Sensors-P1.patch"; #Permission for sensors access (MSe1969)
applyPatch "$DOS_PATCHES/android_packages_apps_Settings/0002-Sensors-P2.patch";
fi;
sed -i 's/private int mPasswordMaxLength = 16;/private int mPasswordMaxLength = 48;/' src/com/android/settings/ChooseLockPassword.java; #Increase max password length (GrapheneOS)
sed -i 's/private int mPasswordMaxLength = 16;/private int mPasswordMaxLength = 64;/' src/com/android/settings/ChooseLockPassword.java; #Increase max password length (GrapheneOS)
Copy link
Member

Choose a reason for hiding this comment

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

this and the 16.0 and 17.1 are correct

@SkewedZeppelin
Copy link
Member

SkewedZeppelin commented Jun 7, 2022

I appreciate your contribution and I should've reviewed it and let you fix it first, but I was impatient. Apologies.
I've added you to the website credits regardless and will try to better review if you decide to contribute again.

@AkechiShiro
Copy link
Author

AkechiShiro commented Jun 8, 2022

It's okay, I was just confused as I might have been doing the sed somewhere I wasn't supposed too or else, I understand you could be eager for such an easy fix, it's alright I'll give a try to contribute once more, it's okay if you think that single contribution doesn't warrant me any credit, I didn't start helping looking for any fame or credit, I'm looking to run DivestOS as my daily driver on Android in a few months, hence it's in my best interest to help it best as I can.

@AkechiShiro
Copy link
Author

AkechiShiro commented Jun 8, 2022

I'd like to ask is there an IRC chat or any place where we can contact/exchange with the DivestOS devs/community about issues or questions, we might have ?
Edit : Shouldn't all the question that are asked in this repo issues, be inside the documentation for everyone to see ?

@SkewedZeppelin
Copy link
Member

SkewedZeppelin commented Jun 8, 2022 via email

@SkewedZeppelin
Copy link
Member

SkewedZeppelin commented Jun 8, 2022 via email

@SkewedZeppelin SkewedZeppelin added the enhancement New feature or request label Jul 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

Add support for longer passwords
2 participants