Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Simmitive_Chris_Crook
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chris.crook
Simmitive_Chris_Crook
Commits
80b671f6
Commit
80b671f6
authored
Apr 08, 2021
by
chris.crook
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
> added load on login button
parent
a4be48af
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
0 deletions
+66
-0
MainActivity.java
.../java/com/example/summative_chris_crook/MainActivity.java
+65
-0
activity_main.xml
app/src/main/res/layout/activity_main.xml
+1
-0
No files found.
app/src/main/java/com/example/summative_chris_crook/MainActivity.java
View file @
80b671f6
...
...
@@ -120,5 +120,70 @@ public class MainActivity extends AppCompatActivity {
}
}
public
void
testlogin
(
View
view
){
file1
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename1
+
".txt"
);
file2
=
new
File
(
getApplicationContext
().
getFilesDir
(),
filename2
+
".txt"
);
for
(
int
i
=
0
;
i
<
sizeoverride
;
i
++){
magicwords
[
i
]
[
0
]
=
"END"
;
}
try
{
FileWriter
stream
=
new
FileWriter
(
file1
,
true
);
stream
.
append
(
""
);
//opens and test-loads an append
stream
.
close
();
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"write error"
,
Toast
.
LENGTH_SHORT
).
show
();
}
try
{
Scanner
reader
=
new
Scanner
(
file1
);
String
temp
=
""
;
while
(
reader
.
hasNextLine
()){
temp
=
temp
+
reader
.
nextLine
();
}
}
catch
(
Exception
e
){
Toast
.
makeText
(
getApplicationContext
(),
"read error"
,
Toast
.
LENGTH_SHORT
).
show
();
}
tempload
=
openandload
();
if
(
tempload
.
equals
(
"&&&"
)){
// this means that the load failed
}
else
{
// load successful
if
(
tempload
.
equals
(
""
)){
// dont add a '#' to the start
}
else
{
tempload
+=
"#"
;
}
tempload
+=
"adminname&adminuser&adminpassword&ADMIN"
;
String
[]
temploadarray
=
tempload
.
split
(
"%"
);
size
=
temploadarray
.
length
;
for
(
int
i
=
0
;
i
<
size
;
i
++){
magicwords
[
i
]
[
0
]
=
temploadarray
[
i
];
// splits by user
}
for
(
int
i
=
0
;
i
<
size
;
i
++){
String
[]
sort
=
temploadarray
[
i
].
split
(
"&"
);
magicwords
[
i
]
[
1
]
=
sort
[
0
];
magicwords
[
i
]
[
2
]
=
sort
[
1
];
magicwords
[
i
]
[
3
]
=
sort
[
2
];
magicwords
[
i
]
[
4
]
=
sort
[
3
];
}
for
(
int
i
=
0
;
i
<
sizeoverride
;
i
++){
if
(
magicwords
[
i
]
[
0
].
equals
(
"END"
)){
// end marker found
tempint
=
i
;
break
;
}
System
.
out
.
println
(
size
+
""
);
System
.
out
.
println
(
tempint
+
""
);
}
System
.
out
.
println
(
tempint
);
System
.
out
.
println
(
"RAW DATA: "
+
magicwords
[
0
]
[
0
]
+
" NAME: "
+
magicwords
[
0
]
[
1
]
+
" USERNAME: "
+
magicwords
[
0
]
[
2
]
+
" PASSWORD: "
+
magicwords
[
0
]
[
3
]
+
" ADMIN FLAG: "
+
magicwords
[
0
]
[
4
]);
}
}
//
}
\ No newline at end of file
app/src/main/res/layout/activity_main.xml
View file @
80b671f6
...
...
@@ -40,6 +40,7 @@
android:id=
"@+id/button"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:onClick=
"testlogin"
android:text=
"Log In"
/>
<Button
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment