Skip to content

Commit

Permalink
Revert "67 apk installation in emulator and on device (#70)"
Browse files Browse the repository at this point in the history
This reverts commit 3789a51.
  • Loading branch information
2byrds committed Jun 30, 2022
1 parent b6ca437 commit 3994ea0
Show file tree
Hide file tree
Showing 14 changed files with 378 additions and 591 deletions.
Binary file modified @rootsid/rootswallet.jks
Binary file not shown.
15 changes: 6 additions & 9 deletions App.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
//import 'react-native-gesture-handler';
import 'react-native-gesture-handler';
import React from 'react';
import {Text, View} from 'react-native';
import {styles} from "./src/styles/styles";
//import * as SplashScreen from 'expo-splash-screen';
import Providers from './src/navigation';

export default function App() {
// return (
// <View style={styles.container}>
// <Text>Open up App.tsx to start working on your app!</Text>
// </View>
// );
return (<Providers/>)
//SplashScreen.hideAsync();
return (
<Providers />
);
}
3 changes: 0 additions & 3 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

<application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />



</manifest>
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="10000"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://exp.host/@rootsid/rootswallet"/>
<activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:screenOrientation="unspecified" android:exported="true">
<activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:screenOrientation="unspecified">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down
3 changes: 2 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

buildscript {
ext {
buildToolsVersion = "29.0.3"
minSdkVersion = 26
compileSdkVersion = 30
targetSdkVersion = 30
Expand All @@ -13,7 +14,7 @@ buildscript {
jcenter()
}
dependencies {
classpath('com.android.tools.build:gradle:4.1.0')
classpath("com.android.tools.build:gradle:4.1.0")

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { registerRootComponent } from 'expo';

import App from './App';

// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
Expand Down
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"private": true,
"name": "rootswallet",
"version": "0.0.1-alpha",
"resolutions": {
"@types/react": "17.0.1"
},
Expand All @@ -16,6 +13,9 @@
"@react-native-community/masked-view": "0.1.10",
"@react-native-picker/picker": "^2.4.1",
"@react-navigation/bottom-tabs": "^6.3.1",
"@react-navigation/core": "6.2.1",
"@react-navigation/devtools": "6.0.7",
"@react-navigation/drawer": "6.4.1",
"@react-navigation/native": "6.0.10",
"@react-navigation/native-stack": "^6.6.2",
"@react-navigation/routers": "6.1.0",
Expand Down Expand Up @@ -59,5 +59,8 @@
"@types/react": "~17.0.21",
"@types/react-native": "~0.64.12",
"typescript": "~4.3.5"
}
},
"private": true,
"name": "rootswallet",
"version": "0.0.1-alpha"
}
4 changes: 3 additions & 1 deletion src/screens/ChatScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ export default function ChatScreen({route, navigation}: CompositeScreenProps<any
borderTopWidth: 1,
padding: 1,
}}
textInputStyle={{color: "white"}}
/>
);
}
Expand All @@ -258,7 +259,7 @@ export default function ChatScreen({route, navigation}: CompositeScreenProps<any
<View style={{backgroundColor: "#251520", flex: 1, display: "flex",}}>
<GiftedChat
isTyping={processing}
messages={messages?.sort((a, b) => {return ((b.createdAt as Date).getDate() - (a.createdAt as Date).getDate())})}
messages={messages?.sort((a, b) => b.createdAt - a.createdAt)}
onPress={ (context, message) => processBubbleClick(context,message)}
onQuickReply={reply => handleQuickReply(reply)}
onSend={messages => handleSend(messages)}
Expand Down Expand Up @@ -316,6 +317,7 @@ export default function ChatScreen({route, navigation}: CompositeScreenProps<any
placeholder={"Make a note..."}
renderInputToolbar={props => renderInputToolbar(props)}
//renderActions={renderActions}
renderAllAvatars={true}
renderAvatarOnTop={true}
renderBubble={renderBubble}
renderQuickReplySend={() => <Text style={{color: '#e69138', fontSize: 18}}>Confirm</Text>}
Expand Down
13 changes: 2 additions & 11 deletions src/screens/CreateRelScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import FormButton from '../components/FormButton';
import FormInput from '../components/FormInput';
import React, { useEffect, useState } from 'react';
import React, { useState } from 'react';
import { Text, View } from 'react-native';
import { IconButton, Title } from 'react-native-paper';
import * as models from '../models'
Expand All @@ -15,7 +15,6 @@ export default function CreateRelScreen({ route, navigation }: CompositeScreenPr
const [relAvatar, setRelAvatar] = useState<string>(rel.displayPictureUrl);
const [relDid, setRelDid] = useState<string>(rel.did);
const [problemDisabled, setProblemDisabled] = useState<boolean>(true)
const [errorText, setErrorText] = useState(<View/>)

async function handleButtonPress() {
if (relName.length > 0) {
Expand All @@ -31,14 +30,6 @@ export default function CreateRelScreen({ route, navigation }: CompositeScreenPr
}
}

useEffect(() => {
if(!problemDisabled) {
setErrorText(<View><Text style={displayProblem(problemDisabled)}>Could not create relationship</Text></View>)
} else {
setErrorText(<View></View>)
}
},[problemDisabled])

return (
<View style={styles.container}>
<View style={styles.closeButtonContainer}>
Expand Down Expand Up @@ -69,7 +60,7 @@ export default function CreateRelScreen({ route, navigation }: CompositeScreenPr
onChangeText={(text: string) => setRelDid(text)}
clearButtonMode="while-editing"
/>
{errorText}
<Text disable={problemDisabled} style={displayProblem(problemDisabled)}>Could not create relationship</Text>
<FormButton
title="Create Relationship"
modeValue="contained"
Expand Down
28 changes: 7 additions & 21 deletions src/screens/CreateWalletScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ export default function CreateWalletScreen({route, navigation}: CompositeScreenP
const [passwordAlpha, setPasswordAlpha] = useState<boolean>(false)
const [passwordNumeric, setPasswordNumeric] = useState<boolean>(false)
const [passwordLongEnough, setPasswordLongEnough] = useState<boolean>(false)
const [errorText, setErrorText] = useState(<View/>)

console.log("CreateWalletScreen - start")

const {signIn} = React.useContext(AuthContext);
Expand All @@ -43,24 +41,6 @@ export default function CreateWalletScreen({route, navigation}: CompositeScreenP
}, [password, confirmPassword]
);

useEffect(() => {
if(!problemDisabled) {
setErrorText(<View><Text style={displayProblem(problemDisabled)}>Could not create relationship</Text></View>)
} else if(!passwordLongEnough) {
setErrorText(<Text style={displayProblem(passwordLongEnough)}>Password is not at least 8
characters</Text>)
} else if(!passwordAlpha) {
setErrorText(<Text style={displayProblem(passwordAlpha)}>Password does not contain letters</Text>)
} else if(!passwordNumeric) {
setErrorText(<Text style={displayProblem(passwordNumeric)}>Password does not contain
numbers</Text>);
} else if(!passwordsMatch) {
setErrorText(<Text style={displayProblem(passwordsMatch)}>Passwords do not match</Text>)
} else {
setErrorText(<View/>)
}
},[problemDisabled,passwordsMatch,passwordNumeric,passwordLongEnough,passwordAlpha])

function handleOpenWithLinking() {
Linking.openURL('https://www.rootsid.com/projects/rootswallet/help');
}
Expand Down Expand Up @@ -91,7 +71,13 @@ export default function CreateWalletScreen({route, navigation}: CompositeScreenP
secureTextEntry={true}
onChangeText={(userPassword: React.SetStateAction<string>) => setConfirmPassword(userPassword)}
/>
{errorText}
<Text disable={problemDisabled} style={displayProblem(problemDisabled)}>Could not create wallet</Text>
<Text disable={passwordsMatch} style={displayProblem(passwordsMatch)}>Passwords do not match</Text>
<Text disable={passwordAlpha} style={displayProblem(passwordAlpha)}>Password does not contain letters</Text>
<Text disable={passwordNumeric} style={displayProblem(passwordNumeric)}>Password does not contain
numbers</Text>
<Text disable={passwordLongEnough} style={displayProblem(passwordLongEnough)}>Password is not at least 8
characters</Text>
<FormButton
disabled={!(passwordsMatch && passwordAlpha && passwordNumeric && passwordLongEnough)}
title="Create Wallet"
Expand Down
8 changes: 1 addition & 7 deletions src/screens/CredentialDetailScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ export default function CredentialDetailScreen({route, navigation}: CompositeScr
setCred(route.params.cred)
}, []);

function getCredPart(field: string) {
const c = decodeCredential(cred.verifiedCredential.encodedSignedCredential)
const cObj = c.credentialSubject
return utils.getObjectField(cObj,field)
}

async function updateVerification() {
const wal = wallet.getWallet(roots.TEST_WALLET_NAME)
if (wal) {
Expand Down Expand Up @@ -104,7 +98,7 @@ export default function CredentialDetailScreen({route, navigation}: CompositeScr
keyExtractor={(item) => item}
ItemSeparatorComponent={() => <Divider/>}
renderItem={({item}) => {
const output = utils.recursivePrint(getCredPart(item))
const output = utils.recursivePrint(decodeCredential(cred.verifiedCredential.encodedSignedCredential).credentialSubject[item])
console.log(item, ": ", output)
return <ScrollView style={styles.scrollableModal}><Text style={{color: "black"}}>{item + ": " + output}</Text></ScrollView>
}}
Expand Down
6 changes: 4 additions & 2 deletions src/store/AsyncStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,14 @@ export async function removeItem(key: string) {
}

export async function status() {
let keys: string[] = []
try {
const keys = await AsyncStorage.getAllKeys()
logger("AsyncStore - keys:",keys)
keys = await AsyncStorage.getAllKeys()
} catch(e) {
console.error("AsyncStore - Could not get async store status,",e)
}

logger("AsyncStore - keys:",keys)
}

export async function storeItem(alias: string, item: string, saveHistory: boolean=false) {
Expand Down
13 changes: 0 additions & 13 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
import {displayProblem} from "../styles/styles";
import {Text} from "react-native";
import React from "react";
import {decodeCredential} from "../credentials";

export function getObjectField(obj: object, field: string) {
for (const [key, value] of Object.entries(obj)) {
if(key === field) {
return value;
}
}
}

export function replaceSpecial(alias: string) {
return alias.replace(/[&\/\\#, +()$~%.'":*?<>{}]/g, '_');
}
Expand Down
Loading

0 comments on commit 3994ea0

Please sign in to comment.