Skip to content

Commit

Permalink
Merge pull request #19 from farhoud/main
Browse files Browse the repository at this point in the history
update go-fula
  • Loading branch information
farhoud authored Jul 7, 2022
2 parents 4dcee08 + 3cc98a3 commit cdde56b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 22 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ repositories {
dependencies {
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
implementation 'com.github.functionland:go-fula:0.4.2' // From jitpack.io
implementation 'com.github.functionland:go-fula:release-v0.4.5-SNAPSHOT' // From jitpack.io
// implementation files('fula.aar')
}
14 changes: 0 additions & 14 deletions android/src/main/java/land/fx/FileRef.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,4 @@ public class FileRef {
public byte[] iv;
public byte[] key;
public String id;

// public FileRef(msg byte[]){
// int lenIv = unsigned(msg[msg.length-3]);
// int lenKey = unsigned(msg[msg.length-2]);
// int lenId = unsigned(msg[msg.length-1]);

// iv = Arrays.copyOfRange(msg, 0, lenIv);
// key = Arrays.copyOfRange(msg, lenIv, lenIv+lenKey);
// id = new String(Arrays.copyOfRange(msg, lenIv+lenKey, lenId));
// }

// public static int unsigned(byte x) {
// return int(x & "0xFF");
// }
}
12 changes: 6 additions & 6 deletions android/src/main/java/land/fx/FulaModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public FulaModule(ReactApplicationContext reactContext) throws Exception{
success = storeDir.mkdirs();
}
if(success){
Log.d(NAME,"Store folder created");
Log.d(NAME,"store folder created");
}else{
Log.d(NAME,"Can not create folder");
Log.d(NAME,"can not create folder");
}
this.fula = Mobile.newFula();
}
Expand Down Expand Up @@ -126,11 +126,11 @@ public void receiveFile(String fileId, String fileName, boolean includeBS64,Prom
String filePath = storeDirPath + fileName;
fula.receiveFile(fileId, filePath);
Uri uri = Uri.fromFile(new File(filePath));
Log.d(NAME,"File Downloaded");
Log.d(NAME,"file downloaded");
WritableMap map;
if(includeBS64){
String bs64 = getBase64StringFromFile(filePath);
Log.d(NAME,"File Transform to bs64");
Log.d(NAME,"file transform to bs64");
map = makeResponseMap(uri.toString(), bs64);
}else{
map = makeResponseMap(uri.toString(), "");
Expand All @@ -149,11 +149,11 @@ public void receiveDecryptFile(String fileRef, String fileName, boolean includeB
String filePath = storeDirPath + fileName;
fula.receiveDecryptFile(fileRef, filePath);
Uri uri = Uri.fromFile(new File(filePath));
Log.d(NAME,"File Downloaded");
Log.d(NAME,"file downloaded");
WritableMap map;
if(includeBS64){
String bs64 = getBase64StringFromFile(filePath);
Log.d(NAME,"File Transform to bs64");
Log.d(NAME,"file transform to bs64");
map = makeResponseMap(uri.toString(), bs64);
}else{
map = makeResponseMap(uri.toString(), "");
Expand Down
2 changes: 1 addition & 1 deletion example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { Header } from 'react-native/Libraries/NewAppScreen';
const App = () => {
const isDarkMode = useColorScheme() === 'dark';
const [boxAddr, setBoxAddr] = useState(
'/ip4/192.168.1.10/tcp/4002/p2p/12D3KooWGrkcHUBzAAuYhMRxBreCgofKKDhLgR84FbawknJZHwK1'
'/ip4/54.91.64.211/tcp/4002/p2p/12D3KooWEYPfYC8B89xQMLA1fz4VB5J6EUS6J1SPiFko6QUihoyQ'
);
const [connectionStatus, setConnectionStatus] = useState(false);
const [connecting, setConnecting] = useState(false);
Expand Down

0 comments on commit cdde56b

Please sign in to comment.