Exploit databaseDownload repository ZIP
GH-6ece003a571ae192e197761e9cc9423a
nicchongwb/rootsmart-v2.0
Sources for CVE-2019-2215
37 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files15
nicchongwb/rootsmart-v2.0Revision 116e5822bd19
- ↑..Parent directory
- AnimationCell.java
- AnimationGrid.java
- Cell.java
- Encrypt.java
- EncryptFile.kt
- Grid.java
- InputListener.java
- Locker.java
- MainActivity.java
- MainGame.java
- MainView.java
- PostData.java
- SplitToolbar.java
- Temproot.java
- Tile.java
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
2048-Game/app/src/main/java/aarkay/a2048game/Grid.java
Java · 3,952 bytespackage aarkay.a2048game;
import java.util.ArrayList;
public class Grid {
public final Tile[][] field;
public final Tile[][] undoField;
private final Tile[][] bufferField;
public Grid(int sizeX, int sizeY) {
field = new Tile[sizeX][sizeY];
undoField = new Tile[sizeX][sizeY];
bufferField = new Tile[sizeX][sizeY];
clearGrid();
clearUndoGrid();
}
public Cell randomAvailableCell() {
ArrayList<Cell> availableCells = getAvailableCells();
if (availableCells.size() >= 1) {
return availableCells.get((int) Math.floor(Math.random() * availableCells.size()));
}
return null;
}
private ArrayList<Cell> getAvailableCells() {
ArrayList<Cell> availableCells = new ArrayList<>();
for (int xx = 0; xx < field.length; xx++) {
for (int yy = 0; yy < field[0].length; yy++) {
if (field[xx][yy] == null) {
availableCells.add(new Cell(xx, yy));
}
}
}
return availableCells;
}
public boolean isCellsAvailable() {
return (getAvailableCells().size() >= 1);
}
public boolean isCellAvailable(Cell cell) {
return !isCellOccupied(cell);
}
public boolean isCellOccupied(Cell cell) {
return (getCellContent(cell) != null);
}
public Tile getCellContent(Cell cell) {
if (cell != null && isCellWithinBounds(cell)) {
return field[cell.getX()][cell.getY()];
} else {
return null;
}
}
public Tile getCellContent(int x, int y) {
if (isCellWithinBounds(x, y)) {
return field[x][y];
} else {
return null;
}
}
public boolean isCellWithinBounds(Cell cell) {
return 0 <= cell.getX() && cell.getX() < field.length
&& 0 <= cell.getY() && cell.getY() < field[0].length;
}
private boolean isCellWithinBounds(int x, int y) {
return 0 <= x && x < field.length
&& 0 <= y && y < field[0].length;
}
public void insertTile(Tile tile) {
field[tile.getX()][tile.getY()] = tile;
}
public void removeTile(Tile tile) {
field[tile.getX()][tile.getY()] = null;
}
public void saveTiles() {
for (int xx = 0; xx < bufferField.length; xx++) {
for (int yy = 0; yy < bufferField[0].length; yy++) {
if (bufferField[xx][yy] == null) {
undoField[xx][yy] = null;
} else {
undoField[xx][yy] = new Tile(xx, yy, bufferField[xx][yy].getValue());
}
}
}
}
public void prepareSaveTiles() {
for (int xx = 0; xx < field.length; xx++) {
for (int yy = 0; yy < field[0].length; yy++) {
if (field[xx][yy] == null) {
bufferField[xx][yy] = null;
} else {
bufferField[xx][yy] = new Tile(xx, yy, field[xx][yy].getValue());
}
}
}
}
public void revertTiles() {
for (int xx = 0; xx < undoField.length; xx++) {
for (int yy = 0; yy < undoField[0].length; yy++) {
if (undoField[xx][yy] == null) {
field[xx][yy] = null;
} else {
field[xx][yy] = new Tile(xx, yy, undoField[xx][yy].getValue());
}
}
}
}
public void clearGrid() {
for (int xx = 0; xx < field.length; xx++) {
for (int yy = 0; yy < field[0].length; yy++) {
field[xx][yy] = null;
}
}
}
private void clearUndoGrid() {
for (int xx = 0; xx < field.length; xx++) {
for (int yy = 0; yy < field[0].length; yy++) {
undoField[xx][yy] = null;
}
}
}
}