HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/xampp/htdocs/myapi/yearCheck.txt
String fileStamp = "";
			long OldStamp = 0;
			try {
				fileStamp = readFile("Tstamp.txt", this); // In an Activity
				System.out.println("File Content: " + fileStamp);			}
			catch (Exception e) {
				writeFile("Tstamp.txt", String.valueOf(System.currentTimeMillis()), BleDeviceSearch.this); // In an Activity // In an Activity
			}

			long NowStamp = System.currentTimeMillis();
			OldStamp = Long.parseLong(fileStamp);
			long yearStamp = OldStamp + 31536000000L;

			System.out.println("NowStamp: " + NowStamp);
			System.out.println("Stamp Diff: " + (NowStamp - OldStamp));

			if (NowStamp - OldStamp > 1 ) {
				Toast.makeText(this, "App 已到期,請更新!", Toast.LENGTH_LONG).show();
				writeFile("installBit.txt", "0", BleDeviceSearch.this);
				//System.exit(0);
				try {
					URL url = new URL("https://fredkuo.idv.tw/myapi/deActiveSn.php?sn="+ss0);// Change this URL to your PHP script URL
					System.out.println(" Ur in 253 ss0:"+url);
					HttpURLConnection connection = (HttpURLConnection) url.openConnection();

					// Get the response code
					int responseCode = connection.getResponseCode();
					System.out.println("Response Code: " + responseCode);

					// Get the response code
					//int responseCode = connection.getResponseCode();
					//System.out.println("Response Code: " + responseCode);

				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			else if (yearStamp - NowStamp < 30 * 86400000) {
				Toast.makeText(this, "App 即將到期,請更新!", Toast.LENGTH_LONG).show();
			}