AndroidPatternGenerator is a software project that I developed to help people recover their forgotten Android lock screen patterns. One day, I came across a Reddit post where someone had forgotten their lock screen pattern and was searching for a software solution that could help them find it. After a bit of research, I realized that there wasn’t really any good solution available, so I decided to create one myself.
The software works by generating all possible pattern combinations that meet the user’s constraints, filtering out any that don’t fit the criteria. The user can specify custom constraints using Java, allowing them to program what they remember about the lock screen pattern. For example, if a user remembers that their pattern started in the top left corner of the grid, they can write a Java constraint function like this:
private static boolean startsInTopLeft(Pattern pattern) {
return pattern.line()[0].equals(Dot.TOP_LEFT);
}
Once the constraints are specified, the software generates a human-readable list of all possible patterns that meet the criteria. Here’s an example output for patterns with a length of 5:
#1 Length: 5
TOP_LEFT, CENTER, TOP, TOP_RIGHT, BOTTOM_LEFT
1 3 4
• 2 •
5 • •
#2 Length: 5
TOP_LEFT, CENTER, TOP, TOP_RIGHT, BOTTOM
1 3 4
• 2 •
• 5 •
// ...
The output shows the order of dots that make up each pattern, along with a visual representation of the pattern in a 3×3 grid. The numbers inside of the grid represent the order of the dots in the pattern.
In addition to the human-readable output, the software can also generate a computer-readable list of all possible pattern combinations. This can be useful for automating the solving process or performing further analysis on the patterns. Here’s an example of the computer-readable output:
15237
15238
// ...
The numbers in the output represent the order of dots in each pattern, with each digit representing a dot’s position in the grid.
One of the biggest challenges in developing AndroidPatternGenerator was figuring out the base constraints that are present in every lock screen pattern. For example, a dot may not be used twice, and no dot can be skipped between two other dots unless it has already been used. I was able to overcome this challenge through a combination of research and creative thinking, and the end result is a software tool that can help people recover their forgotten lock screen patterns.
Overall, I’m proud of what I’ve accomplished with AndroidPatternGenerator, and I hope that it can be of help to people who are struggling to recover their lost data. The code is available on GitHub.