Merge branch 'develop' into feature/#123
First attempt.
Conflicts:
.re-natal
android/app/build.gradle
android/settings.gradle
src/status_im/chat/handlers.cljs
src/status_im/chat/views/command.cljs
src/status_im/chat/views/content_suggestions.cljs
src/status_im/chat/views/message.cljs
src/status_im/chat/views/plain_input.cljs
Former-commit-id: 474729f230
This commit is contained in:
@@ -8,31 +8,35 @@ import com.facebook.react.shell.MainReactPackage;
|
||||
import com.rt2zz.reactnativecontacts.ReactNativeContacts;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.DialogInterface.OnClickListener;
|
||||
import android.content.DialogInterface.OnCancelListener;
|
||||
import com.github.ethereum.go_ethereum.cmd.Geth;
|
||||
import com.bitgo.randombytes.RandomBytesPackage;
|
||||
import com.BV.LinearGradient.LinearGradientPackage;
|
||||
import com.centaurwarchief.smslistener.SmsListener;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.util.Log;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
import java.io.File;
|
||||
import com.statusim.Jail.JailPackage;
|
||||
|
||||
import com.lwansbrough.RCTCamera.*;
|
||||
import com.i18n.reactnativei18n.ReactNativeI18n;
|
||||
import io.realm.react.RealmReactPackage;
|
||||
|
||||
|
||||
public class MainActivity extends ReactActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
final Handler handler = new Handler();
|
||||
|
||||
// Required for android-16 (???)
|
||||
System.loadLibrary("gethraw");
|
||||
System.loadLibrary("geth");
|
||||
|
||||
// Required because of crazy APN settings redirecting localhost
|
||||
protected void startStatus() {
|
||||
// Required because of crazy APN settings redirecting localhost (found in GB)
|
||||
Properties properties = System.getProperties();
|
||||
properties.setProperty("http.nonProxyHosts", "localhost|127.0.0.1");
|
||||
properties.setProperty("https.nonProxyHosts", "localhost|127.0.0.1");
|
||||
@@ -44,11 +48,56 @@ public class MainActivity extends ReactActivity {
|
||||
getApplicationInfo().dataDir;
|
||||
|
||||
// Launch!
|
||||
final Runnable addPeer = new Runnable() {
|
||||
public void run() {
|
||||
Log.w("Geth", "adding peer");
|
||||
Geth.run("--exec admin.addPeer(\"enode://e2f28126720452aa82f7d3083e49e6b3945502cb94d9750a15e27ee310eed6991618199f878e5fbc7dfa0e20f0af9554b41f491dc8f1dbae8f0f2d37a3a613aa@139.162.13.89:55555\") attach http://localhost:8545");
|
||||
}
|
||||
};
|
||||
new Thread(new Runnable() {
|
||||
public void run() {
|
||||
Geth.run("--bootnodes enode://e2f28126720452aa82f7d3083e49e6b3945502cb94d9750a15e27ee310eed6991618199f878e5fbc7dfa0e20f0af9554b41f491dc8f1dbae8f0f2d37a3a613aa@139.162.13.89:30303 --shh --ipcdisable --nodiscover --rpc --rpcapi db,eth,net,web3,shh,admin --fast --datadir=" + dataFolder);
|
||||
Geth.run("--shh --ipcdisable --nodiscover --rpc --rpcapi db,eth,net,web3,shh,admin --fast --datadir=" + dataFolder);
|
||||
|
||||
}
|
||||
}).start();
|
||||
handler.postDelayed(addPeer, 5000);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
// Required for android-16 (???)
|
||||
// Crash if put in startStatus() ?
|
||||
System.loadLibrary("gethraw");
|
||||
System.loadLibrary("geth");
|
||||
|
||||
if(!RootUtil.isDeviceRooted()) {
|
||||
startStatus();
|
||||
} else {
|
||||
AlertDialog dialog = new AlertDialog.Builder(MainActivity.this).setMessage(getResources().getString(R.string.root_warning))
|
||||
.setPositiveButton(getResources().getString(R.string.root_okay), new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
dialog.dismiss();
|
||||
startStatus();
|
||||
}
|
||||
}).setNegativeButton(getResources().getString(R.string.root_cancel), new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
dialog.dismiss();
|
||||
MainActivity.this.finishAffinity();
|
||||
}
|
||||
}).setOnCancelListener(new OnCancelListener() {
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
dialog.dismiss();
|
||||
MainActivity.this.finishAffinity();
|
||||
}
|
||||
}).create();
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,6 +133,7 @@ public class MainActivity extends ReactActivity {
|
||||
new ReactNativeI18n(),
|
||||
new RandomBytesPackage(),
|
||||
new LinearGradientPackage(),
|
||||
new RCTCameraPackage(),
|
||||
new SmsListener(this)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user