Ana içeriğe atla
Bu işlem tamamlandığında sistem lisansı otomatik olarak tanımlar ve ürünü belirtilen IP adresine bağlar. Böylece lisans yalnızca yetkili kullanıcılar tarafından kullanılabilir ve güvenlik sağlanır. Müşteriler gerektiğinde web sitesi üzerinden IP adresi değişikliklerini de kontrol edebilir. Bu yapı, satıcı olarak lisans dağıtım sürecini güvenli şekilde yönetmenize; müşterilerinizin ise satın aldıkları ürünleri hızlı ve sorunsuz biçimde etkinleştirmesine olanak tanır.

Lisans API’si (Java)

Aşağıdaki kodu düzenleyip projenize dahil edebilirsiniz. Yönetici panelinizden bir API anahtarı alarak erişim verebilirsiniz.
package docs.example.license;

import org.bukkit.Bukkit;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.*;
import java.util.Arrays;
import java.util.List;

public final class LicenseChecker {
    private static final String TOKEN       = "TOKEN RECEIVED FROM THE SITE"; 
    private static final String PRODUCT_ID  = "10"; // It will depend on which product.
    private static final int    TIMEOUT_MS  = 8000;

    // https://www.minenix.com/api/license/{TOKEN}/{PRODUCT_ID}/{IP}
    private static String buildLicenseUrl(String externalIp) {
        String base = "https://www.minenix.com"; // Your site address.
        String path = String.format("/api/license/%s/%s/%s",
                urlEncode(TOKEN), urlEncode(PRODUCT_ID), urlEncode(externalIp));
        return base + path;
    }

    public static void run() {
        try {
            sendConsole("§6[LISANS KONTROLCUSU] §fEklenti lisansi kontrol ediliyor.");
            String ip = getExternalIP();
            if (ip == null || ip.isEmpty()) {
                sendConsole("§cDis IP tespit edilemedi. Lisans dogrulamasi atlandi.");
                return;
            }

            String url  = buildLicenseUrl(ip);
            String resp = httpGet(url);
            boolean ok  = resp != null && resp.toLowerCase().contains("true");

            if (ok) {
                printAsciiSuccess();
            } else {
                printAsciiFail();
                Bukkit.shutdown();
            }
        } catch (UnknownHostException e) {
            e.printStackTrace();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public static String getExternalIP() {
        List<String> endpoints = Arrays.asList(
                "http://checkip.amazonaws.com",
                "https://api.ipify.org",
                "https://ifconfig.me/ip"
        );
        for (String ep : endpoints) {
            try {
                String s = httpGet(ep);
                if (s != null) {
                    s = s.trim();
                    if (s.matches("\\d+\\.\\d+\\.\\d+\\.\\d+") || s.contains(":")) {
                        return s;
                    }
                }
            } catch (Exception ignored) {}
        }
        return null;
    }

    public static String httpGet(String urlStr) throws IOException {
        HttpURLConnection conn = null;
        BufferedReader reader  = null;
        try {
            URL url = new URL(urlStr);
            conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("GET");
            conn.setConnectTimeout(TIMEOUT_MS);
            conn.setReadTimeout(TIMEOUT_MS);
            conn.setRequestProperty("User-Agent", "Zonely-License-Checker/1.0");

            int code = conn.getResponseCode();
            reader = new BufferedReader(new InputStreamReader(
                    code == 200 ? conn.getInputStream()
                                : (conn.getErrorStream() != null ? conn.getErrorStream() : conn.getInputStream())
            ));
            StringBuilder sb = new StringBuilder();
            String line;
            while ((line = reader.readLine()) != null)
                sb.append(line);

            if (code != 200) {
                System.out.println("GET isteği başarısız. Yanıt kodu: " + code);
            }
            return sb.toString();
        } finally {
            if (reader != null) try { reader.close(); } catch (IOException ignored) {}
            if (conn != null) conn.disconnect();
        }
    }

    private static String urlEncode(String s) {
        try { return URLEncoder.encode(s, "UTF-8"); }
        catch (Exception e) { return s; }
    }

    private static void sendConsole(String msg) {
        Bukkit.getConsoleSender().sendMessage(msg);
    }

    private static void printAsciiSuccess() {
        sendConsole("§6");
        sendConsole("§6      __     __               _    _    __   __       ");
        sendConsole("§e     |  \\   /  | _           | \\  | |_ /  \\ /  \\      ");
        sendConsole("§4     | + \\_/ + |(_) ____ ___ |  \\ | (_)\\  _|_  /      ");
        sendConsole("§9     |  \\   /  || || __ / -_|| | \\  | |/   |   \\      ");
        sendConsole("§b     |__|\\_/|__||_||_||_\\___/|_|  |_|_|\\__/ \\__/      ");
        sendConsole("§6");
        sendConsole("§a  EKLENTI LISANSI DOGRULANDI!");
        sendConsole("§6");
        sendConsole("§f  Urun, §alisans §fsunucularimiz tarafindan");
        sendConsole("§f  basariyla dogrulandi. Urun kullanimina hazirdir.");
        sendConsole("§f  Eger bir urunde sorun oldugunu dusunuyorsaniz");
        sendConsole("§6  https://www.minenix.com/support §fkismindan bize");
        sendConsole("§f  destek talebi gonderebilirsiniz.");
        sendConsole("§6");
        sendConsole("§f  Urunu kullanmadan once okuyun;");
        sendConsole("§e  https://www.minenix.com/terms/sale");
        sendConsole("");
        sendConsole("§b  wCore vX.Y.Z §feklentisini kullandiginiz");
        sendConsole("§f  icin ve bizi desteklediginiz tesekkurler!");
        sendConsole("");
    }

    private static void printAsciiFail() {
        sendConsole("§6");
        sendConsole("§6      __     __               _    _    __   __       ");
        sendConsole("§e     |  \\   /  | _           | \\  | |_ /  \\ /  \\      ");
        sendConsole("§4     | + \\_/ + |(_) ____ ___ |  \\ | (_)\\  _|_  /      ");
        sendConsole("§9     |  \\   /  || || __ / -_|| | \\  | |/   |   \\      ");
        sendConsole("§b     |__|\\_/|__||_||_||_\\___/|_|  |_|_|\\__/ \\__/      ");
        sendConsole("§6");
        sendConsole("§4  EKLENTI LISANSI HATALI!");
        sendConsole("§6");
        sendConsole("§c  Musterimiz degilsin veya sozlesmelerimize uymadin");
        sendConsole("§c  bu yuzden senin cihazini otomatik olarak");
        sendConsole("§c  sistemimizden devre disi biraktik.");
        sendConsole("§6");
        sendConsole("§f  Urunu kullanmadan once okuyun;");
        sendConsole("§e  https://www.minenix.com/terms/sale");
        sendConsole("");
        sendConsole("§f  Bu konuda itiraz etmek isterseniz,");
        sendConsole("§c  https://www.minenix.com/support §fkismindan bize");
        sendConsole("§f  destek talebi gonderebilirsiniz.");
        sendConsole("");
    }
}
Ardından onEnable() içinde şu şekilde çağırın: LicenseChecker.run();

Lisans API’si (Skript)

Lisansı Minecraft skript eklentisiyle kontrol edebilirsiniz. skript-reflect eklentisi gereklidir.
options:
  TOKEN: TOKEN RECEIVED FROM THE SITE
  PRODUCT_ID: 10
  HTTP_TIMEOUT_MS: 8000

import:
  java.net.URL
  java.net.HttpURLConnection
  java.net.URLEncoder
  java.io.InputStreamReader
  java.io.BufferedReader

function urlenc(t: text) :: text:
  set {_enc} to URLEncoder:encode({_t}, "UTF-8")
  return {_enc}

function jhttp_get(u: text) :: text:
  set {_url} to new URL({_u})
  set {_conn} to {_url}.openConnection()
  {_conn}.setRequestMethod("GET")
  {_conn}.setConnectTimeout({@HTTP_TIMEOUT_MS})
  {_conn}.setReadTimeout({@HTTP_TIMEOUT_MS})
  {_conn}.setRequestProperty("User-Agent", "Zonely-License-Checker/1.0")

  set {_code} to {_conn}.getResponseCode()
  if {_code} = 200:
    set {_isr} to new InputStreamReader({_conn}.getInputStream())
  else:
    set {_es} to {_conn}.getErrorStream()
    if {_es} is not null:
      set {_isr} to new InputStreamReader({_es})
    else:
      set {_isr} to new InputStreamReader({_conn}.getInputStream())

  set {_br} to new BufferedReader({_isr})
  set {_sb::*} to ""
  while true:
    set {_line} to {_br}.readLine()
    if {_line} is null:
      break
    add {_line} to {_sb::*}
  {_br}.close()
  {_conn}.disconnect()

  set {_body} to join {_sb::*} with ""
  return {_body}

function discover_ip() :: text:
  set {_sources::*} to "http://checkip.amazonaws.com", "https://api.ipify.org", "https://ifconfig.me/ip"
  loop {_sources::*}:
    set {_b} to jhttp_get(loop-value)
    if {_b} is set:
      set {_ip} to trim({_b})
      if {_ip} matches regex "\\d+\\.\\d+\\.\\d+\\.\\d+" or "%{_ip}%" contains ":":
        return {_ip}
  return ""

function banner_ok():
  send "&6" to console
  send "&6      __     __               _    _    __   __       " to console
  send "&e     |  \   /  | _           | \  | |_ /  \ /  \      " to console
  send "&4     | + \_/ + |(_) ____ ___ |  \ | (_)\\  _|_  /      " to console
  send "&9     |  \   /  || || __ / -_|| | \  | |/   |   \      " to console
  send "&b     |__|\_/|__||_||_||_\___/|_|  |_|_|\__/ \__/      " to console
  send "&6" to console
  send "&a  EKLENTI LISANSI DOGRULANDI!" to console
  send "&6" to console
  send "&f  Urun, &alisans &fsunucularimiz tarafindan" to console
  send "&f  basariyla dogrulandi. Urun kullanimina hazirdir." to console
  send "&f  Eger bir urunde sorun oldugunu dusunuyorsaniz" to console
  send "&6  https://www.minenix.com/support &fkismindan bize" to console
  send "&f  destek talebi gonderebilirsiniz." to console
  send "&6" to console
  send "&f  Urunu kullanmadan once okuyun;" to console
  send "&e  https://www.minenix.com/terms/sale" to console
  send "" to console
  send "&b  wCore vX.Y.Z &feklentisini kullandiginiz" to console
  send "&f  icin ve bizi desteklediginiz tesekkurler!" to console
  send "" to console

function banner_fail():
  send "&6" to console
  send "&6      __     __               _    _    __   __       " to console
  send "&e     |  \   /  | _           | \  | |_ /  \ /  \      " to console
  send "&4     | + \_/ + |(_) ____ ___ |  \ | (_)\\  _|_  /      " to console
  send "&9     |  \   /  || || __ / -_|| | \  | |/   |   \      " to console
  send "&b     |__|\_/|__||_||_||_\___/|_|  |_|_|\__/ \__/      " to console
  send "&6" to console
  send "&4  EKLENTI LISANSI HATALI!" to console
  send "&6" to console
  send "&c  Musterimiz degilsin veya sozlesmelerimize uymadin" to console
  send "&c  bu yuzden senin cihazini otomatik olarak" to console
  send "&c  sistemimizden devre disi biraktik." to console
  send "&6" to console
  send "&f  Urunu kullanmadan once okuyun;" to console
  send "&e  https://www.minenix.com/terms/sale" to console
  send "" to console
  send "&f  Bu konuda itiraz etmek isterseniz," to console
  send "&c  https://www.minenix.com/support &fkismindan bize" to console
  send "&f  destek talebi gonderebilirsiniz." to console
  send "" to console

on load:
  send "&6[LISANS KONTROLCUSU] &fEklenti lisansi kontrol ediliyor." to console

  set {_ip} to discover_ip()
  if {_ip} is "":
    send "&cDis IP tespit edilemedi. Lisans dogrulamasi atlandi." to console
    stop

  set {_url} to "https://www.minenix.com/api/license/%{urlenc(@TOKEN)}%/%{urlenc(@PRODUCT_ID)}%/%{urlenc({_ip})}%"
  set {_resp} to jhttp_get({_url})

  if {_resp} is set and "%{_resp}%" contains "true":
    banner_ok()
  else:
    banner_fail()
    send "&c[ZONELY] Sunucu kapatiliyor (lisans hatali)..." to console
    execute console command "stop"
Tebrikler! Artık ürünlerinizde lisans API’sini kullanabilirsiniz.

Java Kod Gizleme

Kod gizleme (obfuscation), lisans doğrulama akışındaki yöntemlere ve sabit değerlere (örneğin tokenlar veya endpoint yolları) kullanıcıların doğrudan erişmesini zorlaştırır. Bu işlem tersine mühendislik girişimlerini önemli ölçüde zorlaştırır. Önerilen araç (açık kaynak): Java Obfuscator 1.9.3
Jar dosyasını GUI içine yükleyin ve şifrelemeyi başlatın. Bu kadar basit!

Script Kod Gizleme

1.7 – 1.21+:

1. Wenta Script Obfuscator (Python tabanlı)

  • Uyumluluk: 1.7 – 1.21+
  • Özellikler:
  • Değişken ve fonksiyon adlarını gizler
  • String değerlerini Base64 ile kodlayabilir
  • Rastgele gereksiz kod ekler
  • Kod gizleme seviyeleri (1–5)
  • Gereksinim: Python 3.6+
Link: SpigotMC – Script Obfuscator (Wenta)
Tebrikler! Ürünlerinizi artık daha güvenli hale getirdiniz.