public static Image GenerateQRCode7(PK7 pk7, int box = 0, int slot = 0, int num_copies = 1) { byte[] data = QR7.GenerateQRData(pk7, box, slot, num_copies); var msg = QRMessageUtil.GetMessage(data); return(GenerateQRCode(msg, ppm: 4)); }
// QR7 Utility public static Image GenerateQRCode7(PK7 pk7, int box = 0, int slot = 0, int num_copies = 1) { byte[] data = QR7.GenerateQRData(pk7, box, slot, num_copies); using (var generator = new QRCodeGenerator()) using (var qr_data = generator.CreateQRCode(data)) using (var qr_code = new QRCode(qr_data)) return(qr_code.GetGraphic(4)); }
/// <summary> /// Gets a QR Message from the input <see cref="PKM"/> data. /// </summary> /// <param name="pk">Pokémon to encode</param> /// <returns>QR Message</returns> public static string GetMessage(PKM pk) { if (pk is PK7 pk7) { byte[] payload = QR7.GenerateQRData(pk7); return(GetMessage(payload)); } var server = GetExploitURLPrefixPKM(pk.Format); var data = pk.EncryptedBoxData; return(GetMessageBase64(data, server)); }
public static string GetQRMessage(PKM pkm) { if (pkm is PK7 pk7) { byte[] payload = QR7.GenerateQRData(pk7); return(string.Concat(payload.Select(z => (char)z))); } var server = GetQRServer(pkm.Format); var data = pkm.EncryptedBoxData; string qrdata = Convert.ToBase64String(data); return(server + qrdata); }
// QR7 Utility public static Image GenerateQRCode7(PK7 pk7, int box = 0, int slot = 0, int num_copies = 1) { byte[] data = QR7.GenerateQRData(pk7, box, slot, num_copies); return(GenerateQRCode(data, ppm: 4)); }