boy666 发表于 2022-10-18 18:21

求助java代码解释

反编译的一个jar文件,求解这段代码是啥意思,是生成注册码对比的吗



package com.kamava.lockhub;

import java.io.ByteArrayOutputStream;
import java.util.Locale;
import javax.xml.bind.annotation.adapters.HexBinaryAdapter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class JNIHelper
{
private static final Logger a = LoggerFactory.getLogger(JNIHelper.class);
private Long b = new Long(0L);
private static boolean c = false;
private p d = null;

private native long JNICCCFFF();

private native int SDICreateConnection(int paramInt, Object paramObject);

private native int SDIRefDeallocate(Object paramObject);

private native int SDIDispatch(Object paramObject, int paramInt, long paramLong);

private native int SDIRegisterService(Object paramObject, int paramInt1, String paramString, int paramInt2);

private native int SDIServiceBrowse(Object paramObject, int paramInt);

private native LockServerInfo SDIServiceResolve(int paramInt, String paramString, long paramLong);

public static boolean a()
{
    if (!c)
    {
      System.loadLibrary("libgcc_s_sjlj-1");
      System.loadLibrary("libevent_core-2-0-5");
      System.loadLibrary("nspr4");
      System.loadLibrary("libJNIHelper");
      c = true;
    }
    return c;
}

public static void b() {}

private void SDIDriverServiceBrowseRespose(int paramInt1, int paramInt2, String paramString)
{
    a.info((paramInt1 == 0 ? "remove" : "add") + " service:" + paramString + " " + (paramInt2 == 0 ? "" : "more..."));
    if (this.d != null) {
      this.d.a(paramInt1, paramString);
    }
}

public final int a(int paramInt, p paramp)
{
    paramInt = -1;
    this.d = paramp;
    try
    {
      paramInt = SDIServiceBrowse(this.b, 0);
    }
    catch (Exception paramp)
    {
      a.error(paramp.toString());
    }
    return paramInt;
}

public final LockServerInfo a(int paramInt, String paramString, long paramLong)
{
    paramInt = null;
    try
    {
      paramInt = SDIServiceResolve(0, paramString, 0L);
    }
    catch (Exception paramString)
    {
      a.error(paramString.toString());
    }
    return paramInt;
}

public final int a(int paramInt)
{
    try
    {
      if (this.b.longValue() != 0L) {
      c();
      }
      paramInt = SDICreateConnection(0, this.b);
    }
    catch (Exception localException)
    {
      paramInt = -1;
      a.error(localException.toString());
    }
    return paramInt;
}

public final void c()
{
    try
    {
      if (this.b.longValue() != 0L) {
      SDIRefDeallocate(this.b);
      }
    }
    catch (Exception localException)
    {
      a.error(localException.toString());
    }
    this.b = Long.valueOf(0L);
}

public final int a(int paramInt, long paramLong)
{
    paramInt = -1;
    try
    {
      if (this.b.longValue() != 0L) {
      paramInt = SDIDispatch(this.b, 0, 0L);
      }
    }
    catch (Exception paramLong)
    {
      paramInt = -1;
      a.error(paramLong.toString());
    }
    return paramInt;
}

public final int a(int paramInt1, String paramString, int paramInt2)
{
    paramInt1 = -1;
    try
    {
      if (this.b.longValue() != 0L) {
      paramInt1 = SDIRegisterService(this.b, 0, paramString, paramInt2);
      }
    }
    catch (Exception paramString)
    {
      paramInt1 = -1;
      a.error(paramString.toString());
    }
    return paramInt1;
}

public static int a(o paramo, String paramString)
{
    int i = 0;
    try
    {
      if ((paramString = new HexBinaryAdapter().unmarshal(paramString)).length < 14)
      {
      i = -1;
      }
      else
      {
      paramo.i = false;
      paramo.b = ((paramString & 0xFF) << 24 | (paramString & 0xFF) << 16 | (paramString & 0xFF) << 8 | paramString & 0xFF);
      paramo.c = (2010 + (byte)(paramString ^ 0xFFFFFFFF));
      paramo.d = ((byte)(paramString ^ 0xFFFFFFFF));
      paramo.e = ((byte)(paramString ^ 0xFFFFFFFF));
      paramo.f = (2010 + paramString);
      paramo.g = paramString;
      paramo.h = ((byte)(paramString ^ 0xFFFFFFFF));
      paramo.a = (paramString & 0xFF | (paramString & 0xFF) << 8 | (paramString & 0xFF) << 16 | (paramString & 0xFF) << 24);
      if ((!Locale.getDefault().getLanguage().equalsIgnoreCase("zh")) && (paramo.c == 1983) && (paramo.d == 1) && (paramo.e == 2) && (paramo.f == 1982) && (paramo.g == 3) && (paramo.h == 4)) {
          paramo.i = true;
      }
      i = 0;
      }
    }
    catch (Exception paramString)
    {
      i = -1;
      a.error(paramString.toString());
    }
    return i;
}

public static int a(StringBuilder paramStringBuilder, o paramo)
{
    if (paramo.b == 0) {
      return -1;
    }
    try
    {
      ByteArrayOutputStream localByteArrayOutputStream;
      (localByteArrayOutputStream = new ByteArrayOutputStream(11)).write((byte)(paramo.b >> 24));
      localByteArrayOutputStream.write((byte)(2010 - paramo.c ^ 0xFFFFFFFF));
      localByteArrayOutputStream.write((byte)(int)(paramo.a >> 8));
      localByteArrayOutputStream.write((byte)(paramo.d ^ 0xFFFFFFFF));
      localByteArrayOutputStream.write((byte)(paramo.e ^ 0xFFFFFFFF));
      localByteArrayOutputStream.write((byte)(paramo.b >> 16 & 0xFF));
      localByteArrayOutputStream.write((byte)(paramo.b >> 8 & 0xFF));
      localByteArrayOutputStream.write((byte)(int)paramo.a);
      localByteArrayOutputStream.write((byte)(int)(paramo.a >> 16));
      localByteArrayOutputStream.write((byte)(paramo.b & 0xFF));
      localByteArrayOutputStream.write((byte)(int)(paramo.a >> 24));
      paramStringBuilder.append(new HexBinaryAdapter().marshal(localByteArrayOutputStream.toByteArray()));
      paramStringBuilder = 0;
    }
    catch (Exception localException)
    {
      paramStringBuilder = -1;
      a.error(localException.toString());
    }
    return paramStringBuilder;
}

public final long d()
{
    long l = 19831116L;
    try
    {
      l = JNICCCFFF();
    }
    catch (Exception localException)
    {
      a.info(localException.toString());
    }
    catch (Error localError)
    {
      a.error(localError.toString());
    }
    return l;
}
}

coderyzh 发表于 2022-10-19 00:45

代码出处是哪里方便说出来吗

chr_233 发表于 2022-10-20 13:46

上面几个private native 方法是 jni 方法,函数主体在so里,要用ida看
页: [1]
查看完整版本: 求助java代码解释