提示:这里是收集了和文件分享有关的文章
SDK开发时,里面里面有依赖第三方库时,集成时,也需要外围再重新依赖一次
如果我们直接将依赖的jar文件转成java文件保存进去,这样别人集成时就不需要再去依赖
jar文件里面都是class文件,怎么转java文件
Jad -d D:\Temp\com\ftdi\j2xx\protocol -sjava com\ftdi\j2xx\protocol\*.class
>>>>不同工具打开的class文件长不一样

public void processBulkInData(InBuffer inBuffer) throws D2xxException {
int bufSize = false;// 这个语法明显有问题
short signalEvents = 0;
short signalLineEvents = 0;
boolean signalRxChar = false;
。。。。。。
}

public void processBulkInData(InBuffer inBuffer)
throws D2xxManager.D2xxException
{
int bufSize = 0;
short signalEvents = 0;
short signalLineEvents = 0;
boolean signalRxChar = false;
。。。。。。
}

public void processBulkInData(InBuffer inBuffer)
throws D2xxManager.D2xxException
{
int bufSize;
short signalEvents;
short signalLineEvents;
boolean signalRxChar;
bufSize = 0;
signalEvents = 0;
signalLineEvents = 0;
signalRxChar = false;
bufSize = inBuffer.getLength();
}
>>>>可以看出三种不同打开方式的代码都不一样
import android.support.v4.content.LocalBroadcastManager;
// import androidx.localbroadcastmanager.content.LocalBroadcastManager;
dependencies {
classpath 'androidx.legacy:legacy-support-v4:1.0.0'
}

object MySDKManager {
/**
* 初始化App相关,在使用SDK各组件之前初始化context信息
*/
fun initApp(application: Application): MySDKManager {
XXXSDK.getInstance().initSDK(null, null)
return this
}
/**
* 连接上SDK
*/
val isConnectedSDK: Boolean
get() = XXXSDK.getInstance().isConnectedSDK
/**
* 开始连接 SDK
*/
fun connectSDK(): Boolean {
return XXXSDK.getInstance().connectSDK()
}
/**
* 断开 SDK
*/
fun disconnectSDK() {
XXXSDK.getInstance().disconnectSDK()
}
}

public object MySDKManager {
public final val isConnectedSDK: kotlin.Boolean /* compiled code */
public final fun connectSDK(): kotlin.Boolean { /* compiled code */ }
public final fun disconnectSDK(): kotlin.Unit { /* compiled code */ }
public final fun initApp(application: android.app.Application): com.xxx.xxx.MySDKManager { /* compiled code */ }
}

public final class MySDKManager{
@NotNull
public static final MySDKManager INSTANCE = new MySDKManager();
@NotNull
public final MySDKManager initApp(@NotNull Application application){
Intrinsics.checkNotNullParameter(application, "application");d.e().a(null, null);
return this;
}
public final boolean isConnectedSDK(){
return d.e().f();
}
public final boolean connectSDK(){
return d.e().a();
}
public final void disconnectSDK(){
d.e().c();
}
}

class MyClient {
private var mVideoView: XXXVideoSurface? = null//
private var mConnectHelper: ConnectHelper? = null// 连接
/**
* 初始化View
*/
fun initView(videoView: XXXVideoSurface?): MyClient {
mVideoView = videoView
mVideoView?.init()
return this
}
/**
* 打开连接
*/
fun openConnection(): MyClient {
mConnectHelper = ConnectHelper()
mConnectHelper?.initConnection()
return this
}
/**
* 关闭连接
*/
fun closeConnected(): MyClient {
mConnectHelper?.closeConnected()
mConnectHelper = null
return this
}
}

public final class MyClient public constructor() {
private final var mConnectHelper: com.xxx.xxx.ConnectHelper? /* compiled code */
private final var mVideoView: XXXVideoSurface? /* compiled code */
public final fun closeConnected(): com.xxx.xxx.MyClient { /* compiled code */ }
public final fun initView(videoView: XXXVideoSurface?): com.xxx.xxx.MyClient { /* compiled code */ }
public final fun openConnection(): com.xxx.xxx.MyClient { /* compiled code */ }
}

public final class MyClient {
@Nullable
private XXXVideoSurface a;
@Nullable
private ConnectHelper b;
@NotNull
public final MyClient initView(@Nullable XXXVideoSurface videoView) {
this.a = videoView;
if (videoView != null) {
videoView.init();
}
return this;
}
@NotNull
public final MyClient openConnection() {
ConnectHelper tmp3_0 = new com/xxx/xxx/ConnectHelper;
ConnectHelper localConnectHelper;
(localConnectHelper = tmp3_0).<init>();this.b = localConnectHelper;
if (tmp3_0 != null) {
localConnectHelper.initConnection();
}
return this;
}
@NotNull
public final MyClient closeConnected() {
ConnectHelper localConnectHelper;
if ((localConnectHelper = this.b) != null) {
localConnectHelper.closeConnected();
}
this.b = null;
return this;
}
}

class MyClient {
private var mVideoView: XXXVideoSurface? = null//
private var mConnectHelper: ConnectHelper? = null// 连接
/**
* 初始化View
*/
fun initView(videoView: XXXVideoSurface?): MyClient {
mVideoView = videoView
mVideoView?.init()
return this
}
/**
* 打开连接
*/
fun openConnection(): MyClient {
mConnectHelper = ConnectHelper()
mConnectHelper?.initConnection()
Thread(Runnable { Log.e("Thread","Thread start") }).start() // 重点
return this
}
/**
* 关闭连接
*/
fun closeConnected(): MyClient {
mConnectHelper?.closeConnected()
mConnectHelper = null
return this
}
}

public final class MyClient public constructor() {
private final var mConnectHelper: com.xxx.xxx.ConnectHelper? /* compiled code */
private final var mVideoView: XXXVideoSurface? /* compiled code */
public final fun closeConnected(): com.xxx.xxx.MyClient { /* compiled code */ }
public final fun initView(videoView: XXXVideoSurface?): com.xxx.xxx.MyClient { /* compiled code */ }
public final fun openConnection(): com.xxx.xxx.MyClient { /* compiled code */ }
}

// INTERNAL ERROR //

public final class MyClient {
@Nullable
private XXXVideoSurface a;
@Nullable
private ConnectHelper b;
private static final void a() {
Log.e("Thread", "Thread start");
}
@NotNull
public final MyClient initView(@Nullable final XXXVideoSurface videoView) {
this.a = videoView;
if (videoView != null) {
videoView.init();
}
return this;
}
@NotNull
public final MyClient openConnection() {
final ConnectHelper b;
final ConnectHelper connectHelper = b = new ConnectHelper();
this.b = b;
if (connectHelper != null) {
b.initConnection();
}
new Thread(MyClient::a).start();
return this;
}
@NotNull
public final MyClient closeConnected() {
final ConnectHelper b;
if ((b = this.b) != null) {
b.closeConnected();
}
this.b = null;
return this;
}
}
提示:这里是参考的相关文章
| 博主分享的所有文章内容,部分参考网上教程,引用大神高论,部分亲身实践,记下笔录,内容可能存在诸多不实之处,还望海涵,本内容仅供学习研究使用,切勿用于商业用途,若您是部分内容的作者,不喜欢此内容被分享出来,可联系博主说明相关情况通知删除,感谢您的理解与支持! |
|---|
转载请注明出处:
https://blog.csdn.net/ljb568838953/article/details/126834000