Skip to content

Commit fe9617b

Browse files
Add Web3E constructor
1 parent d716562 commit fe9617b

4 files changed

Lines changed: 35 additions & 2 deletions

File tree

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ android {
99
applicationId "com.stormbird.augustcodereader"
1010
minSdk 21
1111
targetSdk 31
12-
versionCode 1
13-
versionName "1.0"
12+
versionCode 2
13+
versionName "1.1"
1414

1515
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1616
}

app/src/main/java/com/stormbird/augustcodereader/MainActivity.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public class MainActivity extends AppCompatActivity {
1515
private CopyTextView addrText;
1616
private CopyTextView handshakeText;
1717
private CopyTextView handshakeIndexText;
18+
private CopyTextView augustCode;
1819

1920
private final String BlueToothAddress = "bluetoothAddress";
2021
private final String HandShakeKey = "handshakeKey";
@@ -29,6 +30,7 @@ protected void onCreate(Bundle savedInstanceState) {
2930
addrText = findViewById(R.id.bluetooth_addr);
3031
handshakeText = findViewById(R.id.bluetooth_key);
3132
handshakeIndexText = findViewById(R.id.key_index);
33+
augustCode = findViewById(R.id.key_code);
3234

3335
//check if this is rooted
3436
if (!RootUtil.isDeviceRooted())
@@ -83,6 +85,14 @@ private void getCodes()
8385
addrText.setText(getElement(BlueToothAddress, decodedText));
8486
handshakeText.setText(getElement(HandShakeKey, decodedText));
8587
handshakeIndexText.setText(getNumericElement(HandshakeKeyIndex, decodedText));
88+
89+
String constructorText = "AugustLock augustLock(\"[BLUETOOTH_ADDR]\", \"[HANDSHAKE_KEY]\", [HANDSHAKE_INDEX]);";
90+
91+
constructorText = constructorText.replace("[BLUETOOTH_ADDR]", getElement(BlueToothAddress, decodedText));
92+
constructorText = constructorText.replace("[HANDSHAKE_KEY]", getElement(HandShakeKey, decodedText));
93+
constructorText = constructorText.replace("[HANDSHAKE_INDEX]", getNumericElement(HandshakeKeyIndex, decodedText));
94+
95+
augustCode.setText(constructorText);
8696
}
8797

8898
private String getElement(String elementCode, String data)

app/src/main/res/layout/activity_main.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,23 @@
7272
<com.stormbird.augustcodereader.CopyTextView
7373
android:id="@+id/key_index"
7474
android:layout_width="match_parent"
75+
android:layout_height="wrap_content" />
76+
77+
<TextView
78+
android:id="@+id/report4"
79+
android:layout_width="wrap_content"
80+
android:layout_height="wrap_content"
81+
android:layout_gravity="center_horizontal"
82+
android:layout_marginTop="12dp"
83+
android:layout_marginBottom="6dp"
84+
android:text="Code for Web3E"
85+
android:textColor="@color/black"
86+
android:textSize="20sp"
87+
android:textStyle="bold" />
88+
89+
<com.stormbird.augustcodereader.CopyTextView
90+
android:id="@+id/key_code"
91+
android:layout_width="match_parent"
7592
android:layout_height="wrap_content"
7693
android:layout_marginBottom="100dp"/>
7794

0 commit comments

Comments
 (0)