Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ModuleConfig.gaTrackingId = 'UA-110176262-1';
ModuleConfig.init();
ModuleConfig.setLogo(require('../images/logo.png')); // eslint-disable-line global-require
ModuleConfig.setNavLogo(require('../images/logo.png')); // eslint-disable-line global-require
ModuleConfig.setFilterRooms([
'support', 'exceptions',
]);
// set user agent
let ua = ModuleConfig.appName;
try {
// Build user agent string
ua = `${ModuleConfig.appName} ` +
`${DeviceInfo.getVersion()}; ${DeviceInfo.getSystemName()} ` +
`${DeviceInfo.getSystemVersion()}; ${DeviceInfo.getBrand()} ` +
`${DeviceInfo.getDeviceId()}`;
} catch (e) {
// do nothing
}
AppAPI.setUserAgent(ua);
},
async function getDeviceInfo() {
return {
AppName: DeviceInfo.getApplicationName(),
Brand: DeviceInfo.getBrand(),
BuildNumber: DeviceInfo.getBuildNumber(),
BundleId: DeviceInfo.getBundleId(),
Carrier: await DeviceInfo.getCarrier(),
DeviceId: DeviceInfo.getDeviceId(),
DeviceName: await DeviceInfo.getDeviceName(), // NOTE(nitya) this might contain PII, monitor
FirstInstallTime: await DeviceInfo.getFirstInstallTime(),
FontScale: await DeviceInfo.getFontScale(),
FreeDiskStorage: await DeviceInfo.getFreeDiskStorage(),
InstallReferrer: await DeviceInfo.getInstallReferrer(),
InstanceID: await DeviceInfo.getInstanceId(),
LastUpdateTime: await DeviceInfo.getLastUpdateTime(),
Manufacturer: await DeviceInfo.getManufacturer(),
MaxMemory: await DeviceInfo.getMaxMemory(),
Model: DeviceInfo.getModel(),
ReadableVersion: DeviceInfo.getReadableVersion(),
SerialNumber: await DeviceInfo.getSerialNumber(),
SystemName: DeviceInfo.getSystemName(),
SystemVersion: DeviceInfo.getSystemVersion(),
TotalDiskCapacity: await DeviceInfo.getTotalDiskCapacity(),
TotalMemory: await DeviceInfo.getTotalMemory(),
constructor (props) {
console.log("LoginView");
super (props);
this.state = {
userName:null,
passwd:null,
uuid:DeviceInfo.getDeviceId(),
}
}
getConstantDeviceInfo() {
let deviceJSON = {};
deviceJSON.uniqueId = DeviceInfo.getUniqueId();
deviceJSON.deviceId = DeviceInfo.getDeviceId();
deviceJSON.bundleId = DeviceInfo.getBundleId();
deviceJSON.systemName = DeviceInfo.getSystemName();
deviceJSON.systemVersion = DeviceInfo.getSystemVersion();
deviceJSON.version = DeviceInfo.getVersion();
deviceJSON.readableVersion = DeviceInfo.getReadableVersion();
deviceJSON.buildNumber = DeviceInfo.getBuildNumber();
deviceJSON.isTablet = DeviceInfo.isTablet();
deviceJSON.appName = DeviceInfo.getApplicationName();
deviceJSON.brand = DeviceInfo.getBrand();
deviceJSON.model = DeviceInfo.getModel();
deviceJSON.deviceType = DeviceInfo.getDeviceType();
return deviceJSON;
}
const HARDWARE_DATA = [
{title: 'Device Manufacturer', info: DeviceInfo.getManufacturer()},
{title: 'Device Name', info: DeviceInfo.getDeviceName()},
{title: 'Device Model', info: DeviceInfo.getModel()},
{title: 'Device Unique ID', info: DeviceInfo.getUniqueID()},
{title: 'Device Locale', info: DeviceInfo.getDeviceLocale()},
{title: 'Device Country', info: DeviceInfo.getDeviceCountry()},
{title: 'User Agent', info: DeviceInfo.getUserAgent()},
{title: 'Screen Width', info: Metrics.screenWidth},
{title: 'Screen Height', info: Metrics.screenHeight}
]
const OS_DATA = [
{title: 'Device System Name', info: DeviceInfo.getSystemName()},
{title: 'Device ID', info: DeviceInfo.getDeviceId()},
{title: 'Device Version', info: DeviceInfo.getSystemVersion()}
]
const APP_DATA = [
{title: 'Bundle Id', info: DeviceInfo.getBundleId()},
{title: 'Build Number', info: DeviceInfo.getBuildNumber()},
{title: 'App Version', info: DeviceInfo.getVersion()},
{title: 'App Version (Readable)', info: DeviceInfo.getReadableVersion()}
]
export default class DeviceInfoScreen extends React.Component {
constructor (props) {
super(props)
this.state = {
isConnected: false,
"cancelled",
]),
"draft",
),
reason: types.optional(types.string, ""),
customer: types.string,
lines: types.optional(types.array(ReceiptLine), []),
discountName: types.optional(types.string, ""),
discount: types.optional(types.string, ""),
discountValue: types.optional(types.number, 0),
receiptNumber: types.optional(types.number, 0),
discountType: types.optional(types.string, "percentage"),
taxesValue: types.optional(types.string, ""),
taxesAmount: types.optional(types.number, 0),
shift: types.optional(types.string, ""),
deviceId: types.optional(types.string, DeviceInfo.getDeviceId()),
dateUpdated: types.optional(types.Date, Date.now),
syncStatus: types.optional(types.boolean, false),
attendant: types.optional(types.string, ""),
orderType: types.optional(
types.enumeration("OrderType", [
"Dine-in",
"Takeaway",
"Delivery",
"Online",
"Family",
"None",
]),
"None",
),
})
.preProcessSnapshot(snapshot => assignUUID(snapshot, "Receipt"))
componentDidMount() {
this.deviceInfo = {
applicationName: DeviceInfo.getApplicationName(),
buildNumber: DeviceInfo.getBuildNumber(),
bundleId: DeviceInfo.getBundleId(),
deviceId: DeviceInfo.getDeviceId(),
readableVersion: DeviceInfo.getReadableVersion(),
version: DeviceInfo.getVersion()
};
}
] = await Promise.all([
NetInfo.fetch(),
getGDPREntries(),
getCASCode(),
userDataCache.get(),
iapReceiptCache.get(),
])
const folderStat = await RNFetchBlob.fs.stat(FSPaths.issuesDir)
const size = parseInt(folderStat.size)
const bytes = size
const kilobytes = bytes / 1000
const megabytes = kilobytes / 1000
const gigabytes = megabytes / 1000
const buildNumber = DeviceInfo.getBuildNumber()
const version = DeviceInfo.getVersion()
const deviceId = DeviceInfo.getDeviceId()
const [
firstInstallTime,
lastUpdateTime,
totalDiskCapacity,
freeDiskStorage,
pushTracking,
fileList,
] = await Promise.all([
DeviceInfo.getFirstInstallTime(),
DeviceInfo.getLastUpdateTime(),
DeviceInfo.getTotalDiskCapacity(),
DeviceInfo.getFreeDiskStorage(),
getPushTracking(),
getFileList(),
])
const HARDWARE_DATA = [
{title: 'Device Manufacturer', info: DeviceInfo.getManufacturer()},
{title: 'Device Name', info: DeviceInfo.getDeviceName()},
{title: 'Device Model', info: DeviceInfo.getModel()},
{title: 'Device Unique ID', info: DeviceInfo.getUniqueID()},
{title: 'Device Locale', info: DeviceInfo.getDeviceLocale()},
{title: 'Device Country', info: DeviceInfo.getDeviceCountry()},
{title: 'User Agent', info: DeviceInfo.getUserAgent()},
{title: 'Screen Width', info: Metrics.screenWidth},
{title: 'Screen Height', info: Metrics.screenHeight}
]
const OS_DATA = [
{title: 'Device System Name', info: DeviceInfo.getSystemName()},
{title: 'Device ID', info: DeviceInfo.getDeviceId()},
{title: 'Device Version', info: DeviceInfo.getSystemVersion()}
]
const APP_DATA = [
{title: 'Bundle Id', info: DeviceInfo.getBundleId()},
{title: 'Build Number', info: DeviceInfo.getBuildNumber()},
{title: 'App Version', info: DeviceInfo.getVersion()},
{title: 'App Version (Readable)', info: DeviceInfo.getReadableVersion()}
]
export default class DeviceInfoScreen extends React.Component {
constructor (props) {
super(props)
this.state = {
isConnected: false,