Last active
February 2, 2026 21:44
-
-
Save ptrcnull/0a2d76d3406874a82a6e087eb254ea76 to your computer and use it in GitHub Desktop.
GMV bus app "Permission" keygen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Random; | |
| import java.text.SimpleDateFormat; | |
| import java.util.Date; | |
| import java.util.TimeZone; | |
| public final class SaePermission { | |
| public static final long MILLIS_MARGIN = 300000; | |
| public static final int m_iMultiplier = 131; | |
| private static String date; | |
| private static String key; | |
| public static final String FORMAT_PUBLIC_DATE = "yyyyMMddHHmmssSSSSS"; | |
| private static final SimpleDateFormat formatPublicDate = new SimpleDateFormat(FORMAT_PUBLIC_DATE); | |
| public static final String FORMAT_DATE = "yyssSSSSSMMHHddmm"; | |
| private static final SimpleDateFormat formatDate = new SimpleDateFormat(FORMAT_DATE); | |
| public static void main(String[] args) { | |
| Date date = new Date(System.currentTimeMillis() + MILLIS_MARGIN); | |
| formatPublicDate.setTimeZone(TimeZone.getTimeZone("UTC")); | |
| String k1 = formatPublicDate.format(date); | |
| formatDate.setTimeZone(TimeZone.getTimeZone("UTC")); | |
| String sKeyAux2 = Long.toString(Long.parseLong(formatDate.format(date)) * m_iMultiplier); | |
| String k2 = encrypt(sKeyAux2); | |
| System.out.print("k1: "); | |
| System.out.println(k1); | |
| System.out.print("k2: "); | |
| System.out.println(k2); | |
| } | |
| public static final char maskChar(char input) { | |
| char mask = 0b1010101; | |
| // Random random = new Random(); | |
| // char fill = random.nextInt() & 0b0101010; | |
| char fill = 0b0101010; | |
| return (char) ((input & mask) | fill); | |
| } | |
| public static final String encrypt(String sInput) { | |
| if (sInput.length() == 0) { | |
| return ""; | |
| } | |
| char[] charArray = sInput.toCharArray(); | |
| String key = ""; | |
| char mask = 0b1010101; | |
| char fill = 0b0101010; | |
| for (char c : charArray) { | |
| char c1 = (char) ((c & 170) >> 1); | |
| key += Character.valueOf(maskChar(c1)); | |
| key += Character.valueOf(maskChar(c)); | |
| } | |
| return key; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment