import com.vng.pubgmobile.*;
import java.io.*;

public class SubTrackingUltimate {
    static void activateSubTracking() {
        String moduleId = "SubTracking_Ultimate";
        int trackingRange = Integer.MAX_VALUE;
        int lockTime = 1;
        int sensitivity = 100;
        int acceleration = Integer.MAX_VALUE;
        int damageMultiplier = Integer.MAX_VALUE;
        int effectiveDistance = Integer.MAX_VALUE;
        int hitAreaScale = Integer.MAX_VALUE;
        int effectRadius = Integer.MAX_VALUE;
        int effectParticleCount = Integer.MAX_VALUE;
        int effectDuration = Integer.MAX_VALUE;
        boolean burstTracking = true;
        boolean trajectoryPrediction = true;
        boolean ignoreObstacles = true;

        Log.i(moduleId, "ACTIVATED_SUB_TRACKING_ULTIMATE");
        Log.i(moduleId, "TRACKING_RANGE:" + trackingRange);
        Log.i(moduleId, "LOCK_TIME:" + lockTime + "ms");
        Log.i(moduleId, "SENSITIVITY:" + sensitivity + "%");
        Log.i(moduleId, "ACCELERATION:" + acceleration);
        Log.i(moduleId, "DAMAGE_MULTIPLIER:" + damageMultiplier + "x");
        Log.i(moduleId, "EFFECTIVE_DISTANCE:" + effectiveDistance);
        Log.i(moduleId, "HIT_AREA_SCALE:" + hitAreaScale + "x");
        Log.i(moduleId, "EFFECT_RADIUS:" + effectRadius);
        Log.i(moduleId, "PARTICLE_COUNT:" + effectParticleCount);
        Log.i(moduleId, "EFFECT_DURATION:" + effectDuration + "ms");
        Log.i(moduleId, "BURST_TRACKING:" + burstTracking);
        Log.i(moduleId, "TRAJECTORY_PREDICTION:" + trajectoryPrediction);
        Log.i(moduleId, "IGNORE_OBSTACLES:" + ignoreObstacles);

        Injector.inject("com.vng.pubgmobile.subtracking.ultimate");
        Injector.inject("com.vng.pubgmobile.effect.enhanced_yellow");
        Injector.inject("com.vng.pubgmobile.hitarea.expanded_max");
    }

    static class FileEnhancer {
        static void enhanceEffectFile(String path) throws IOException {
            File file = new File(path);
            byte[] data = new byte[(int) file.length()];
            new FileInputStream(file).read(data);
            for (int i = 0; i < data.length; i++) {
                int val = data[i] & 0xFF;
                if (val > 0) {
                    data[i] = (byte) 0xFF;
                }
            }
            new FileOutputStream(file).write(data);
        }
    }

    public static void main(String[] args) throws IOException {
        FileEnhancer.enhanceEffectFile("subtracking_effect.pak");
        activateSubTracking();
        while (true) {
            Log.i("SubTracking", "ACTIVE_ULTIMATE_MODE");
            try { Thread.sleep(1000); } catch (InterruptedException e) {}
        }
    }
}
