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

[NEW] Passcode and biometric unlock #2059

Merged
merged 98 commits into from
May 8, 2020
Merged
Show file tree
Hide file tree
Changes from 88 commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
2fa3931
Update expo libs
diegolmello Apr 7, 2020
616f62d
Configure expo-local-authentication
diegolmello Apr 13, 2020
7819df5
ScreenLockedView
diegolmello Apr 13, 2020
1018fdf
Merge branch 'develop' into new.biometrics
diegolmello Apr 13, 2020
455d76f
Authenticate server change
diegolmello Apr 13, 2020
9d29298
Auth on app resume
diegolmello Apr 14, 2020
f865669
localAuthentication util
diegolmello Apr 14, 2020
dc59232
Add servers.lastLocalAuthenticatedSession column
diegolmello Apr 14, 2020
ff64cbd
Save last session date on background
diegolmello Apr 14, 2020
5ecbf2e
Use our own version of app state redux
diegolmello Apr 15, 2020
ab5d0b1
Merge branch 'develop' into new.biometrics
diegolmello Apr 15, 2020
bba76a7
Fix libs
diegolmello Apr 15, 2020
2b4ef42
Remove inactive
diegolmello Apr 15, 2020
67a9343
ScreenLockConfigView
diegolmello Apr 15, 2020
fa93c26
Apply on saved data
diegolmello Apr 16, 2020
36b39ff
Auto lock option label
diegolmello Apr 16, 2020
6abb844
Starting passcode
diegolmello Apr 16, 2020
28c58ed
Basic passcode flow working
diegolmello Apr 17, 2020
0f89686
Change passcode
diegolmello Apr 20, 2020
a79f833
Check if biometry is enrolled
diegolmello Apr 20, 2020
310bb2a
Use fork
diegolmello Apr 20, 2020
6668b3a
Migration
diegolmello Apr 20, 2020
f4d2ccf
Patch expo-local-authentication
diegolmello Apr 20, 2020
8a512d7
Use async storage
diegolmello Apr 20, 2020
6256163
Styling
diegolmello Apr 20, 2020
8d5efcd
Timer
diegolmello Apr 22, 2020
788b0dd
Refactor
diegolmello Apr 22, 2020
eee8ea0
Lock orientation portrait when not on tablet
diegolmello Apr 22, 2020
ce4799e
share extension
diegolmello Apr 22, 2020
7e4c890
Deep linking
diegolmello Apr 22, 2020
c13ea0f
Share extension
diegolmello Apr 23, 2020
7f61529
Refactoring passcode
diegolmello Apr 23, 2020
738fabf
use state
diegolmello Apr 23, 2020
94fdf44
Stash
diegolmello Apr 23, 2020
b13a88e
Refactor
diegolmello Apr 23, 2020
f11c924
Change passcode
diegolmello Apr 23, 2020
570e971
Animate dots on error
diegolmello Apr 23, 2020
afc3246
Matching passcodes
diegolmello Apr 23, 2020
2725919
Shake
diegolmello Apr 23, 2020
4a2e4ef
Remove lib
diegolmello Apr 23, 2020
fc9d75f
Delete button
diegolmello Apr 24, 2020
cdc30b1
Fade animation on modal
diegolmello Apr 24, 2020
2fbae65
Refactoring
diegolmello Apr 24, 2020
508701f
ItemInfo
diegolmello Apr 24, 2020
9c50614
I18n
diegolmello Apr 24, 2020
c420443
I18n
diegolmello Apr 24, 2020
9f3b932
Remove unnecessary prop
diegolmello Apr 24, 2020
bb09aa0
Save biometry column
diegolmello Apr 24, 2020
4739963
Raise time to lock to 30 seconds
diegolmello Apr 24, 2020
ced514f
Vibrate on wrong confirmation passcode
diegolmello Apr 24, 2020
478ff9f
Reset attempts and save last authentication on local passcode confirm…
diegolmello Apr 27, 2020
b9105a8
Remove inline style
diegolmello Apr 27, 2020
0a41f24
Save last auth
diegolmello Apr 27, 2020
850df6c
Fix header blink
diegolmello Apr 27, 2020
de9788d
Change function name
diegolmello Apr 27, 2020
8d5c5a2
Fix android modal
diegolmello Apr 27, 2020
a264e3a
Fix vibration permission
diegolmello Apr 27, 2020
ab36dd8
PasscodeEnter calls biometry
diegolmello Apr 27, 2020
b1a48da
Passcode on the state
diegolmello Apr 27, 2020
47a5909
Biometry button on PasscodeEnter
diegolmello Apr 27, 2020
3245fca
Show whole passcode
diegolmello Apr 27, 2020
3d65c59
Secure passcode
diegolmello Apr 27, 2020
cf71acd
Save passcode with promise to prevent empty passcodes and immediately…
diegolmello Apr 27, 2020
939dfe4
Patch expo-local-authentication
diegolmello Apr 28, 2020
da3ac2b
I18n
diegolmello Apr 28, 2020
759ed21
Fix biometry being called every time
diegolmello Apr 28, 2020
a4ce812
Blur screen on app inactive
diegolmello Apr 28, 2020
cb61989
Revert "Blur screen on app inactive"
diegolmello Apr 29, 2020
51aa090
Remove immediately because of how Activities work on Android
diegolmello Apr 29, 2020
402f28a
Pods
diegolmello Apr 29, 2020
9a715ff
New layout
diegolmello Apr 29, 2020
b8c85f8
stash
diegolmello Apr 29, 2020
e85c056
Layout refactored
diegolmello Apr 29, 2020
84b70b3
Fix icons
diegolmello Apr 29, 2020
d68f7d0
Force set passcode from server
diegolmello Apr 29, 2020
deba499
Lint
diegolmello Apr 29, 2020
c5f0bd4
Improve permission message
diegolmello Apr 30, 2020
b1a6243
Forced passcode subtitle
diegolmello Apr 30, 2020
09971e5
Disable based on admin's choice
diegolmello Apr 30, 2020
bb05c1b
Require local authentication on login success
diegolmello Apr 30, 2020
9e21903
Refactor
diegolmello Apr 30, 2020
1a12f1d
Update tests
diegolmello Apr 30, 2020
e0de555
Update react-native-device-info to fix notch
diegolmello Apr 30, 2020
1ce6e5f
Lint
diegolmello Apr 30, 2020
301a4d0
Merge branch 'develop' into new.biometrics
diegolmello Apr 30, 2020
b9cd89f
Fix modal
diegolmello Apr 30, 2020
d8b73b8
Fix icons
diegolmello May 4, 2020
5340977
Fix min auto lock time
diegolmello May 4, 2020
6a10673
Merge branch 'develop' of https://github.com/RocketChat/Rocket.Chat.R…
djorkaeffalexandre May 4, 2020
1d2d093
Review
djorkaeffalexandre May 5, 2020
a4a09ae
Merge Develop
djorkaeffalexandre May 5, 2020
ec0e6de
keep enabled on mobile
djorkaeffalexandre May 5, 2020
3b6d6ba
fix forced by admin when enable unlock with passcode
djorkaeffalexandre May 5, 2020
d1c2dbc
use DEFAULT_AUTO_LOCK when manual enable screenLock
djorkaeffalexandre May 5, 2020
a7f753d
fix check has passcode
djorkaeffalexandre May 5, 2020
431ca78
request biometry on first password
djorkaeffalexandre May 5, 2020
ec328fc
reset auto time lock when disabled on server
djorkaeffalexandre May 5, 2020
2ddbc6e
Merge branch 'develop' into new.biometrics
diegolmello May 8, 2020
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
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ module.exports = {
"no-regex-spaces": 2,
"no-undef": 2,
"no-unreachable": 2,
"no-unused-expressions": 0,
"no-unused-vars": [2, {
"vars": "all",
"args": "after-used"
Expand Down
3 changes: 2 additions & 1 deletion __mocks__/react-native-device-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ export default {
getModel: () => '',
getReadableVersion: () => '',
getBundleId: () => '',
isTablet: () => false
isTablet: () => false,
hasNotch: () => ''
};
56 changes: 28 additions & 28 deletions __tests__/__snapshots__/Storyshots.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11372,7 +11372,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
</View>
</View>
Expand Down Expand Up @@ -12413,7 +12413,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
</View>
</View>
Expand Down Expand Up @@ -15504,7 +15504,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
</View>
<Text
Expand Down Expand Up @@ -15811,7 +15811,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
</View>
</View>
Expand Down Expand Up @@ -16095,7 +16095,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
</View>
<RNCSlider
Expand Down Expand Up @@ -16444,7 +16444,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
</View>
<RNCSlider
Expand Down Expand Up @@ -16666,7 +16666,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
</View>
<RNCSlider
Expand Down Expand Up @@ -16851,7 +16851,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
</View>
<RNCSlider
Expand Down Expand Up @@ -18281,7 +18281,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
</View>
</View>
Expand Down Expand Up @@ -18398,7 +18398,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
</View>
</View>
Expand Down Expand Up @@ -18709,7 +18709,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
<Text
style={
Expand Down Expand Up @@ -19037,7 +19037,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
<Text
style={
Expand Down Expand Up @@ -19145,7 +19145,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -19377,7 +19377,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -19609,7 +19609,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -19841,7 +19841,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -20073,7 +20073,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -20305,7 +20305,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -20537,7 +20537,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -21009,7 +21009,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
<Text
style={
Expand Down Expand Up @@ -21584,7 +21584,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
<Text
numberOfLines={1}
Expand Down Expand Up @@ -22504,7 +22504,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
<Text
style={
Expand Down Expand Up @@ -22831,7 +22831,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
<Text
style={
Expand Down Expand Up @@ -23160,7 +23160,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
<Text
style={
Expand Down Expand Up @@ -23489,7 +23489,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
<Text
style={
Expand Down Expand Up @@ -26041,7 +26041,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
<Text
style={
Expand Down Expand Up @@ -26558,7 +26558,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
</View>
</View>
Expand Down Expand Up @@ -26752,7 +26752,7 @@ exports[`Storyshots Message list message 1`] = `
]
}
>
</Text>
</View>
</View>
Expand Down
Binary file modified android/app/src/main/assets/fonts/custom.ttf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

public class MainApplication extends Application implements ReactApplication, INotificationsApplication {

private final ReactModuleRegistryProvider mModuleRegistryProvider = new ReactModuleRegistryProvider(new BasePackageList().getPackageList(), Arrays.<SingletonModule>asList());
private final ReactModuleRegistryProvider mModuleRegistryProvider = new ReactModuleRegistryProvider(new BasePackageList().getPackageList(), null);

private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
Expand All @@ -58,7 +58,11 @@ protected List<ReactPackage> getPackages() {
packages.add(new RNNotificationsPackage(MainApplication.this));
packages.add(new WatermelonDBPackage());
packages.add(new RNCViewPagerPackage());
packages.add(new ModuleRegistryAdapter(mModuleRegistryProvider));
// packages.add(new ModuleRegistryAdapter(mModuleRegistryProvider));
List<ReactPackage> unimodules = Arrays.<ReactPackage>asList(
new ModuleRegistryAdapter(mModuleRegistryProvider)
);
packages.addAll(unimodules);
return packages;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public List<Package> getPackageList() {
new expo.modules.constants.ConstantsPackage(),
new expo.modules.filesystem.FileSystemPackage(),
new expo.modules.haptics.HapticsPackage(),
new expo.modules.imageloader.ImageLoaderPackage(),
new expo.modules.localauthentication.LocalAuthenticationPackage(),
new expo.modules.permissions.PermissionsPackage(),
new expo.modules.webbrowser.WebBrowserPackage()
);
Expand Down
1 change: 1 addition & 0 deletions app/actions/actionsTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ export const INVITE_LINKS = createRequestTypes('INVITE_LINKS', [
...defaultTypes
]);
export const SETTINGS = createRequestTypes('SETTINGS', ['CLEAR', 'ADD']);
export const APP_STATE = createRequestTypes('APP_STATE', ['FOREGROUND', 'BACKGROUND']);
27 changes: 24 additions & 3 deletions app/constants/colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ export const themes = {
messageboxBackground: '#ffffff',
searchboxBackground: '#E6E6E7',
buttonBackground: '#414852',
buttonText: '#ffffff'
buttonText: '#ffffff',
passcodeBackground: '#EEEFF1',
passcodeButtonActive: '#E4E7EA',
passcodeLockIcon: '#6C727A',
passcodePrimary: '#2F343D',
passcodeSecondary: '#6C727A',
passcodeDotEmpty: '#CBCED1',
passcodeDotFull: '#6C727A'
},
dark: {
backgroundColor: '#030b1b',
Expand Down Expand Up @@ -81,7 +88,14 @@ export const themes = {
messageboxBackground: '#0b182c',
searchboxBackground: '#192d4d',
buttonBackground: '#414852',
buttonText: '#ffffff'
buttonText: '#ffffff',
passcodeBackground: '#030C1B',
passcodeButtonActive: '#0B182C',
passcodeLockIcon: '#6C727A',
passcodePrimary: '#FFFFFF',
passcodeSecondary: '#CBCED1',
passcodeDotEmpty: '#CBCED1',
passcodeDotFull: '#6C727A'
},
black: {
backgroundColor: '#000000',
Expand Down Expand Up @@ -116,6 +130,13 @@ export const themes = {
messageboxBackground: '#0d0d0d',
searchboxBackground: '#1f1f1f',
buttonBackground: '#414852',
buttonText: '#ffffff'
buttonText: '#ffffff',
passcodeBackground: '#000000',
passcodeButtonActive: '#0E0D0D',
passcodeLockIcon: '#6C727A',
passcodePrimary: '#FFFFFF',
passcodeSecondary: '#CBCED1',
passcodeDotEmpty: '#CBCED1',
passcodeDotFull: '#6C727A'
}
};
12 changes: 12 additions & 0 deletions app/constants/localAuthentication.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export const PASSCODE_KEY = 'kPasscode';
export const LOCKED_OUT_TIMER_KEY = 'kLockedOutTimer';
export const ATTEMPTS_KEY = 'kAttempts';

export const LOCAL_AUTHENTICATE_EMITTER = 'LOCAL_AUTHENTICATE';
export const CHANGE_PASSCODE_EMITTER = 'CHANGE_PASSCODE';

export const PASSCODE_LENGTH = 6;
export const MAX_ATTEMPTS = 6;
export const TIME_TO_LOCK = 30000;

export const DEFAULT_AUTO_LOCK = 1800;
6 changes: 6 additions & 0 deletions app/constants/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,11 @@ export default {
},
CAS_login_url: {
type: 'valueAsString'
},
Force_Screen_Lock: {
type: 'valueAsBoolean'
},
Force_Screen_Lock_After: {
type: 'valueAsNumber'
}
};
Loading