diff --git a/src/chrome/WarningEmployee.tsx b/src/chrome/WarningEmployee.tsx
new file mode 100644
index 000000000..f9ced1d92
--- /dev/null
+++ b/src/chrome/WarningEmployee.tsx
@@ -0,0 +1,55 @@
+/**
+ * Copyright 2019-present Facebook.
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ * @format
+ */
+
+import {styled, FlexColumn, Text, Button, colors} from 'flipper';
+
+import React from 'react';
+
+const Container = styled(FlexColumn)({
+ height: '100%',
+ width: '100%',
+ justifyContent: 'center',
+ alignItems: 'center',
+ backgroundColor: colors.light02,
+});
+
+const Box = styled(FlexColumn)({
+ justifyContent: 'center',
+ alignItems: 'center',
+ background: colors.white,
+ borderRadius: 10,
+ boxShadow: '0 1px 3px rgba(0,0,0,0.25)',
+ paddingBottom: 16,
+});
+
+const Warning = styled(Text)({
+ fontSize: 24,
+ fontWeight: 300,
+ textAlign: 'center',
+ margin: 16,
+});
+
+const AckButton = styled(Button)({
+ type: 'warning',
+});
+
+export default function WarningEmployee(props: {
+ onClick: (event: React.MouseEvent) => any;
+}) {
+ return (
+
+
+
+ You are using the open-source version of Flipper. You will get access
+ to more plugins. To use the internal version, please install it from
+ Managed Software Center
+
+ Okay
+
+
+ );
+}
diff --git a/src/fb-stubs/config.tsx b/src/fb-stubs/config.tsx
index 2de59bef7..6edb5c1fe 100644
--- a/src/fb-stubs/config.tsx
+++ b/src/fb-stubs/config.tsx
@@ -10,4 +10,5 @@ export default {
bugReportButtonVisible: false,
showLogin: false,
showFlipperRating: false,
+ warnFBEmployees: true,
};
diff --git a/src/init.js b/src/init.js
index 244b8e2d7..fd88f165c 100644
--- a/src/init.js
+++ b/src/init.js
@@ -7,6 +7,7 @@
import {Provider} from 'react-redux';
import ReactDOM from 'react-dom';
+import {useState, useEffect} from 'react';
import {ContextMenuProvider} from 'flipper';
import GK from './fb-stubs/GK.tsx';
import {init as initLogger} from './fb-stubs/Logger.tsx';
@@ -22,7 +23,10 @@ import config from './utils/processConfig.tsx';
import {stateSanitizer} from './utils/reduxDevToolsConfig.tsx';
import {initLauncherHooks} from './utils/launcher.tsx';
import initCrashReporter from './utils/electronCrashReporter.tsx';
+import fbConfig from './fb-stubs/config.tsx';
+import {isFBEmployee} from './utils/fbEmployee.js';
import path from 'path';
+import WarningEmployee from './chrome/WarningEmployee.tsx';
const store = createStore(
reducers,
@@ -35,15 +39,34 @@ const bugReporter = new BugReporter(logger, store);
GK.init();
-const AppFrame = () => (
-
-
-
-
-
-
-
-);
+const AppFrame = () => {
+ const [warnEmployee, setWarnEmployee] = useState(false);
+ useEffect(() => {
+ if (fbConfig.warnFBEmployees) {
+ isFBEmployee().then(isEmployee => {
+ setWarnEmployee(isEmployee);
+ });
+ }
+ }, []);
+
+ return (
+
+
+
+ {warnEmployee ? (
+ {
+ setWarnEmployee(false);
+ }}
+ />
+ ) : (
+
+ )}
+
+
+
+ );
+};
function init() {
// $FlowFixMe: this element exists!
diff --git a/src/utils/fbEmployee.js b/src/utils/fbEmployee.js
new file mode 100644
index 000000000..4641d34df
--- /dev/null
+++ b/src/utils/fbEmployee.js
@@ -0,0 +1,25 @@
+/**
+ * Copyright 2019-present Facebook.
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ * @format
+ */
+
+import util from 'util';
+const exec = util.promisify(require('child_process').exec);
+
+const cmd = 'klist --json';
+const endWith = '@THEFACEBOOK.COM';
+
+export function isFBEmployee(): Promise {
+ return exec(cmd).then(
+ (stdobj: {stderr: string, stdout: string}) => {
+ const principal = String(JSON.parse(stdobj.stdout).principal);
+
+ return principal.endsWith(endWith);
+ },
+ err => {
+ return false;
+ },
+ );
+}