吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 28456|回复: 70
上一主题 下一主题
收起左侧

[Android Tools] java转smali,动手撸了一个(改版界面更新功能更新)

  [复制链接]
跳转到指定楼层
楼主
AcsZeg 发表于 2019-5-22 18:49 回帖奖励
本帖最后由 AcsZeg 于 2019-6-25 09:27 编辑

最近在破解时用到之前下载的java2smali,发现jdk升级后运用别人软件就报错了,所以自己动手写了个,
java2smaliv1.0.2版 功能
当前支持java转smali 支持代码中import android.*

配置好java运行环境
.net 4.0


java2smaliv1.0.3版 功能增加
0.正常功能同上。
1.有人在帖子提到要增加smali转java的 所以加上了 直接调用新版jadx 可以打开apk文件 smali文件 。
(注意:打开apk文件 总所周知jadx分析占用内存很大所以在bat中直接设置9G的内存建议90M以上apk要有9G的内存;打开单个smali文件:没有内存建议)
2.增加了android killer分析后的smali文件转dex的功能 emmm你懂的 整个编译不过时候该菊部编译了。

改名AndroIDACS
0.由于有人说界面太丑 所以学了下界面的 改了点(因为图标啥的都是自己ps的,略微简陋,有学ui的可以教教我),加了代码高亮
1.增加了smali,apk转java自定义内存大小
2.修复了上个版本的关闭进程bug,【预】增加安卓7.0抓包证书导入系统(测试中)。

2019.06.25测试:最高兼容Jdk1.8 如果报错Version56之类的麻烦设置下jdk的专用路径或者将jdk12改成1.8
下载:https://www.lanzouj.com/i4fab9e 密码:acszeg
链接:https://pan.baidu.com/s/14uQMysRn7Kl7V1azu3Qz0A  密码:tlai

4E4E13C0B2D9357D3893F2E082BA838F.jpg (91.5 KB, 下载次数: 64)

v1.0.2

v1.0.2

C343CC4B6498C47BC0791FFA9B182F86.png (23.95 KB, 下载次数: 15)

V2.0.0

V2.0.0

E517EC01E9ACD3DA3E371592709CC064.png (28.92 KB, 下载次数: 10)

E517EC01E9ACD3DA3E371592709CC064.png

免费评分

参与人数 18吾爱币 +19 热心值 +17 收起 理由
dunxp + 1 + 1 才发现有这样的神器
wangding95 + 1 + 1 我很赞同!
涛蜀黍 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
soha1018 + 1 + 1 热心回复!
cikeysb + 1 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
cly + 1 + 1 我很赞同!
葡萄demo + 1 + 1 热心回复!
笙若 + 1 + 1 谢谢@Thanks!
万丈光芒i + 1 + 1 谢谢@Thanks!
CrazyNut + 2 + 1 谢谢 拯救一下被Smali搞自闭的我
独行风云 + 1 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
a48602 + 1 + 1 谢谢@Thanks!
lzc090 + 1 + 1 谢谢@Thanks!
ydiief + 1 + 1 热心回复!
沙鱼 + 1 + 1 谢谢@Thanks!
scandallol26 + 1 我很赞同!
pob777 + 2 + 1 Good
星辰物语呀 + 1 + 1 我很赞同!

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

推荐
DanK 发表于 2019-8-9 09:28

[Java] 纯文本查看 复制代码
package com.cyjh.elfin.floatview;

import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.graphics.Point;
import android.os.Build.VERSION;
import android.os.CountDownTimer;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.view.GestureDetector;
import android.view.GestureDetector.OnGestureListener;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.view.ViewGroup.LayoutParams;
import android.view.WindowManager;
import android.view.WindowManager.LayoutParams;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.cyjh.elfin.AppContext;
import com.cyjh.elfin.dialog.HideFWDialog;
import com.cyjh.elfin.dialog.HideFWDialog.OnHideCancelClickListener;
import com.cyjh.elfin.dialog.HideFWDialog.OnHideOKClickListener;
import com.cyjh.elfin.dialog.ScriptRTDDialog;
import com.cyjh.elfin.dialog.ScriptUIDialog;
import com.cyjh.elfin.log.CommonLog;
import com.cyjh.elfin.util.AppDeviceUtils;
import com.cyjh.elfin.util.NetworkUtils;
import com.cyjh.mq.sdk.MqRunner;
import com.cyjh.share.bean.response.ScriptStartRunResponse;
import com.cyjh.share.mvp.presenter.AppStatisticsPresenter;
import com.cyjh.share.mvp.presenter.AppStatisticsPresenter.OnClickScriptRunCallback;
import com.cyjh.share.util.GsonExUtil;
import com.cyjh.share.util.ToastUtils;

public class ElfinFloatView
  extends LinearLayout
  implements View.OnClickListener
{
  private static final int ELFIN_ORIENTATION_DOWN = 3;
  private static final int ELFIN_ORIENTATION_LEFT = 4;
  private static final int ELFIN_ORIENTATION_RIGHT = 2;
  private static final int ELFIN_ORIENTATION_UP = 1;
  private static final int LIMIT_ANGLE = 60;
  private static final int LIMIT_COUNT = 2;
  private static final int TIME_ADSORPTION = 2000;
  private static final int TIME_INTERVAL = 1000;
  private static final int TIME_TRANSLUCENT = 5000;
  private CommonLog commonLog = new CommonLog();
  private boolean isPreventRepeatedClick = false;
  private AppContext mAppContext;
  private Context mContext;
  private CountDownTimer mCountDownTimer = new CountDownTimer(7000L, 1000L)
  {
    public void onFinish()
    {
      int[] arrayOfInt = new int[2];
      ElfinFloatView.this.mImageViewElfin.getLocationOnScreen(arrayOfInt);
      if (arrayOfInt[0] >= (AppDeviceUtils.getResolution(ElfinFloatView.this.getContext()).x - ElfinFloatView.this.mDownX) / 2.0F)
      {
        if (ElfinFloatView.this.mAppContext.STATE_SCRIPT == 2)
        {
          ElfinFloatView.this.mImageViewElfin.setImageResource(2130837667);
          return;
        }
        ElfinFloatView.this.mImageViewElfin.setImageResource(2130837656);
        return;
      }
      if (ElfinFloatView.this.mAppContext.STATE_SCRIPT == 2)
      {
        ElfinFloatView.this.mImageViewElfin.setImageResource(2130837669);
        return;
      }
      ElfinFloatView.this.mImageViewElfin.setImageResource(2130837660);
    }
    
    public void onTick(long paramAnonymousLong)
    {
      if ((paramAnonymousLong <= 3000L) && (paramAnonymousLong > 2000L))
      {
        ElfinFloatView.this.mImageViewElfin.setAlpha(0.5F);
        ElfinFloatView.this.changeToolBarState(false);
      }
    }
  };
  private DeleteFloatView mDeleteFloatView;
  private float mDownX;
  private float mDownY;
  private MyHandler mHandler;
  private ImageView mImageViewElfin;
  public ImageView mImgRunAndStop;
  private float mLastX;
  private float mLastY;
  private LinearLayout mLinearLayoutElfin;
  private LinearLayout mLinearLayoutInfo;
  private LinearLayout mLinearLayoutRun;
  private LinearLayout mLinearLayoutSetting;
  private LinearLayout mLinearLayoutTools;
  private int mLockState;
  private float mRawCurrentX;
  private float mRawCurrentY;
  private ScriptRTDDialog mScriptRTDDialog;
  private ScriptUIDialog mScriptUIDialog;
  public TextView mTvRunScript;
  private WindowManager mWindowManager;
  private WindowManager.LayoutParams mWindowManagerParams;
  private HideFWDialog.OnHideCancelClickListener onHideCancelClickListener = new HideFWDialog.OnHideCancelClickListener()
  {
    public void onClick(View paramAnonymousView)
    {
      ElfinFloatView.this.moveToEdge();
    }
  };
  private HideFWDialog.OnHideOKClickListener onHideOKClickListener = new HideFWDialog.OnHideOKClickListener()
  {
    public void onClick(View paramAnonymousView)
    {
      ElfinFloatView.this.toggleElfinVisbility();
    }
  };
  private final View.OnTouchListener onTouchListener = new View.OnTouchListener()
  {
    private static final int MIN_MOVEMENT = 5;
    private GestureDetector gestureDetector = new GestureDetector(ElfinFloatView.this.getContext(), this.gestureListener);
    private ElfinFloatView.ElfinGestureListener gestureListener = new ElfinFloatView.ElfinGestureListener(ElfinFloatView.this, null);
    
    public float getDistance(float paramAnonymousFloat1, float paramAnonymousFloat2, float paramAnonymousFloat3, float paramAnonymousFloat4)
    {
      return (float)Math.sqrt(Math.pow(paramAnonymousFloat1 - paramAnonymousFloat3, 2.0D) + Math.pow(paramAnonymousFloat2 - paramAnonymousFloat4, 2.0D));
    }
    
    public boolean onTouch(View paramAnonymousView, MotionEvent paramAnonymousMotionEvent)
    {
      if (this.gestureDetector.onTouchEvent(paramAnonymousMotionEvent)) {
        return true;
      }
      switch (paramAnonymousMotionEvent.getAction())
      {
      default: 
        return false;
      case 2: 
        if (ElfinFloatView.this.mLinearLayoutTools.getVisibility() == 0) {
          return true;
        }
        ElfinFloatView.access$1102(ElfinFloatView.this, ElfinFloatView.this.mRawCurrentX);
        ElfinFloatView.access$1202(ElfinFloatView.this, ElfinFloatView.this.mRawCurrentY);
        ElfinFloatView.access$702(ElfinFloatView.this, paramAnonymousMotionEvent.getRawX());
        ElfinFloatView.access$802(ElfinFloatView.this, paramAnonymousMotionEvent.getRawY() - AppDeviceUtils.getStatusBarHeight(ElfinFloatView.this.getContext()));
        if (getDistance(ElfinFloatView.this.mLastX, ElfinFloatView.this.mLastY, ElfinFloatView.this.mRawCurrentX, ElfinFloatView.this.mRawCurrentY) <= 5.0F) {
          return true;
        }
        double d = Math.toDegrees(Math.atan2(ElfinFloatView.this.mRawCurrentY - ElfinFloatView.this.mLastY, ElfinFloatView.this.mRawCurrentX - ElfinFloatView.this.mLastX));
        if ((d < -60.0D) && (d > -120.0D)) {}
        do
        {
          i = 1;
          break;
          if ((d >= -60.0D) && (d <= 60.0D))
          {
            i = 2;
            break;
          }
          if ((d > 60.0D) && (d < 120.0D))
          {
            i = 3;
            break;
          }
        } while ((d < 120.0D) && (d > -120.0D));
        int i = 4;
        ElfinFloatView.this.updateFloatViewDirection(i);
        ElfinFloatView.this.updateFloatViewPosition((int)(ElfinFloatView.this.mRawCurrentX - ElfinFloatView.this.mDownX), (int)(ElfinFloatView.this.mRawCurrentY - ElfinFloatView.this.mDownY));
        if (ElfinFloatView.this.mDeleteFloatView.getVisibility() == 8) {
          ElfinFloatView.this.mDeleteFloatView.setVisibility(0);
        }
        if (ElfinFloatView.this.isHide())
        {
          ElfinFloatView.this.mDeleteFloatView.setHide();
          return true;
        }
        ElfinFloatView.this.mDeleteFloatView.setNormal();
        return true;
      case 1: 
        ElfinFloatView.access$702(ElfinFloatView.this, paramAnonymousMotionEvent.getRawX());
        ElfinFloatView.access$802(ElfinFloatView.this, paramAnonymousMotionEvent.getRawY() - AppDeviceUtils.getStatusBarHeight(ElfinFloatView.this.getContext()));
        if (ElfinFloatView.this.isHide())
        {
          paramAnonymousView = new HideFWDialog(ElfinFloatView.this.getContext());
          paramAnonymousView.setOnHideOKClickListener(ElfinFloatView.this.onHideOKClickListener);
          paramAnonymousView.setOnHideCancelClickListener(ElfinFloatView.this.onHideCancelClickListener);
          paramAnonymousView.setOnCancelListener(new DialogInterface.OnCancelListener()
          {
            public void onCancel(DialogInterface paramAnonymous2DialogInterface)
            {
              ElfinFloatView.this.moveToEdge();
            }
          });
          paramAnonymousView.show();
          return false;
        }
        if (ElfinFloatView.this.mLinearLayoutTools.getVisibility() == 8) {
          ElfinFloatView.this.moveToEdge();
        }
        ElfinFloatView.this.mDeleteFloatView.setVisibility(8);
        ElfinFloatView.this.mCountDownTimer.start();
        return false;
      }
      ElfinFloatView.this.resetElfinState();
      ElfinFloatView.access$702(ElfinFloatView.this, paramAnonymousMotionEvent.getRawX());
      ElfinFloatView.access$802(ElfinFloatView.this, paramAnonymousMotionEvent.getRawY() - AppDeviceUtils.getStatusBarHeight(ElfinFloatView.this.getContext()));
      ElfinFloatView.access$102(ElfinFloatView.this, paramAnonymousMotionEvent.getX());
      ElfinFloatView.access$902(ElfinFloatView.this, paramAnonymousMotionEvent.getY());
      return false;
    }
  };
  
  public ElfinFloatView(Context paramContext, DeleteFloatView paramDeleteFloatView)
  {
    super(paramContext);
    this.mAppContext = ((AppContext)paramContext);
    initView();
    initWindow();
    this.mDeleteFloatView = paramDeleteFloatView;
    this.mCountDownTimer.start();
  }
  
  private void initElfinImageView()
  {
    this.mImageViewElfin = ((ImageView)findViewById(2131755300));
    if (this.mAppContext.STATE_SCRIPT == 2)
    {
      this.mImageViewElfin.setImageResource(2130837662);
      this.mTvRunScript.setText(getContext().getString(2131296412));
      this.mImgRunAndStop.setImageResource(2130837678);
    }
    else
    {
      this.mImageViewElfin.setImageResource(2130837649);
      this.mTvRunScript.setText(getContext().getString(2131296410));
      this.mImgRunAndStop.setImageResource(2130837676);
    }
    this.mImageViewElfin.setOnClickListener(null);
    this.mImageViewElfin.setOnTouchListener(this.onTouchListener);
  }
  
  private void initView()
  {
    LayoutInflater.from(getContext()).inflate(2130968659, this);
    this.mLinearLayoutElfin = ((LinearLayout)findViewById(2131755291));
    this.mLinearLayoutTools = ((LinearLayout)findViewById(2131755292));
    this.mLinearLayoutRun = ((LinearLayout)findViewById(2131755293));
    this.mLinearLayoutInfo = ((LinearLayout)findViewById(2131755296));
    this.mLinearLayoutSetting = ((LinearLayout)findViewById(2131755298));
    this.mTvRunScript = ((TextView)findViewById(2131755295));
    this.mImgRunAndStop = ((ImageView)findViewById(2131755294));
    this.mLinearLayoutRun.setOnClickListener(this);
    this.mLinearLayoutInfo.setOnClickListener(this);
    this.mLinearLayoutSetting.setOnClickListener(this);
    initElfinImageView();
  }
  
  private void initWindow()
  {
    this.mWindowManager = ((WindowManager)getContext().getSystemService("window"));
    this.mWindowManagerParams = new WindowManager.LayoutParams();
    if (Build.VERSION.SDK_INT >= 26) {
      this.mWindowManagerParams.type = 2038;
    } else if ((Build.VERSION.SDK_INT >= 19) && (Build.VERSION.SDK_INT < 24)) {
      this.mWindowManagerParams.type = 2005;
    } else {
      this.mWindowManagerParams.type = 2002;
    }
    this.mWindowManagerParams.format = 1;
    this.mWindowManagerParams.flags = 40;
    this.mWindowManagerParams.gravity = 51;
    this.mWindowManagerParams.x = (AppDeviceUtils.getResolution(getContext()).x - this.mLinearLayoutElfin.getLayoutParams().width);
    this.mWindowManagerParams.y = (AppDeviceUtils.getResolution(getContext()).y / 4);
    this.mRawCurrentY = (AppDeviceUtils.getResolution(getContext()).y / 4);
    this.mWindowManagerParams.width = this.mLinearLayoutElfin.getLayoutParams().width;
    this.mWindowManagerParams.height = this.mLinearLayoutElfin.getLayoutParams().height;
  }
  
  private boolean isHide()
  {
    int[] arrayOfInt1 = new int[2];
    this.mImageViewElfin.getLocationOnScreen(arrayOfInt1);
    int[] arrayOfInt2 = new int[2];
    this.mDeleteFloatView.getLocationOnScreen(arrayOfInt2);
    return (arrayOfInt1[0] > arrayOfInt2[0]) && (arrayOfInt1[0] < arrayOfInt2[0] + this.mDeleteFloatView.geTextViewtWidth()) && (arrayOfInt1[1] > arrayOfInt2[1]);
  }
  
  private void moveToEdge()
  {
    if (this.mDeleteFloatView.getVisibility() == 0)
    {
      this.mDeleteFloatView.setVisibility(8);
      this.mDeleteFloatView.setNormal();
    }
    int[] arrayOfInt = new int[2];
    this.mImageViewElfin.getLocationOnScreen(arrayOfInt);
    if (arrayOfInt[0] >= (AppDeviceUtils.getResolution(getContext()).x - this.mDownX) / 2.0F)
    {
      updateFloatViewPosition(AppDeviceUtils.getResolution(getContext()).x, (int)(this.mRawCurrentY - this.mDownY));
      this.mLinearLayoutElfin.removeView(this.mLinearLayoutTools);
      this.mLinearLayoutElfin.addView(this.mLinearLayoutTools, 0);
    }
    else
    {
      updateFloatViewPosition(0, (int)(this.mRawCurrentY - this.mDownY));
      this.mLinearLayoutElfin.removeView(this.mLinearLayoutTools);
      this.mLinearLayoutElfin.addView(this.mLinearLayoutTools, 1);
    }
    if (this.mAppContext.STATE_SCRIPT == 2)
    {
      this.mImageViewElfin.setImageResource(2130837662);
      return;
    }
    this.mImageViewElfin.setImageResource(2130837649);
  }
  
  private void resetElfinState()
  {
    this.mCountDownTimer.cancel();
    this.mImageViewElfin.setAlpha(1.0F);
  }
  
  private void updateFloatViewDirection(int paramInt)
  {
    switch (paramInt)
    {
    default: 
      return;
    case 4: 
      if (this.mAppContext.STATE_SCRIPT == 2)
      {
        this.mImageViewElfin.setImageResource(2130837668);
        return;
      }
      this.mImageViewElfin.setImageResource(2130837657);
      return;
    case 3: 
      if (this.mAppContext.STATE_SCRIPT == 2)
      {
        this.mImageViewElfin.setImageResource(2130837666);
        return;
      }
      this.mImageViewElfin.setImageResource(2130837653);
      return;
    case 2: 
      if (this.mAppContext.STATE_SCRIPT == 2)
      {
        this.mImageViewElfin.setImageResource(2130837670);
        return;
      }
      this.mImageViewElfin.setImageResource(2130837661);
      return;
    }
    if (this.mAppContext.STATE_SCRIPT == 2)
    {
      this.mImageViewElfin.setImageResource(2130837662);
      return;
    }
    this.mImageViewElfin.setImageResource(2130837649);
  }
  
  public void changeToolBarState(boolean paramBoolean)
  {
    updateFloatViewDirection(1);
    if (paramBoolean)
    {
      if (this.mLinearLayoutTools.getVisibility() == 8) {
        this.mLinearLayoutTools.setVisibility(0);
      }
    }
    else if (this.mLinearLayoutTools.getVisibility() == 0) {
      this.mLinearLayoutTools.setVisibility(8);
    }
  }
  
  public WindowManager.LayoutParams getLayoutParams()
  {
    return this.mWindowManagerParams;
  }
  
  public Context getmContext()
  {
    return this.mContext;
  }
  
  public void onClick(View paramView)
  {
    resetElfinState();
    int i = paramView.getId();
    if (i != 2131755293)
    {
      if (i != 2131755296)
      {
        if (i == 2131755298)
        {
          this.mScriptUIDialog = new ScriptUIDialog(getContext());
          this.mScriptUIDialog.mContext = this.mContext;
          this.mScriptUIDialog.show();
        }
      }
      else
      {
        this.mScriptRTDDialog = new ScriptRTDDialog(getContext());
        this.mScriptRTDDialog.show();
      }
    }
    else
    {
      if (this.isPreventRepeatedClick) {
        return;
      }
      this.isPreventRepeatedClick = true;
      if (MqRunner.getInstance().isScriptStarted())
      {
        MqRunner.getInstance().stop();
        this.isPreventRepeatedClick = false;
      }
      else
      {
        if (!NetworkUtils.isAvailable(paramView.getContext()))
        {
          ToastUtils.showToastLong(getContext(), getContext().getString(2131296450));
          this.isPreventRepeatedClick = false;
          return;
        }
        AppStatisticsPresenter.getStatisticsPresenter().setClickScriptRunCallback(new AppStatisticsPresenter.OnClickScriptRunCallback()
        {
          public void onCallbackFail()
          {
            ElfinFloatView.access$302(ElfinFloatView.this, false);
          }
          
          public void onCallbackSuc(Object paramAnonymousObject)
          {
            paramAnonymousObject = (String)paramAnonymousObject;
            if (!TextUtils.isEmpty(paramAnonymousObject))
            {
              paramAnonymousObject = (ScriptStartRunResponse)GsonExUtil.parsData(paramAnonymousObject, ScriptStartRunResponse.class);
              if ((paramAnonymousObject != null) && (paramAnonymousObject.Code == 200))
              {
                if (ElfinFloatView.this.mAppContext.STATE_SCRIPT == 1) {
                  ElfinFloatView.this.mAppContext.runScript();
                }
              }
              else if (paramAnonymousObject != null) {
                ToastUtils.showToastLong(AppContext.getInstance(), paramAnonymousObject.Message);
              } else {
                ToastUtils.showToastLong(AppContext.getInstance(), 2131296429);
              }
            }
            else
            {
              ToastUtils.showToastLong(AppContext.getInstance(), 2131296428);
            }
            AppStatisticsPresenter.getStatisticsPresenter().cleanCallback();
            ElfinFloatView.access$302(ElfinFloatView.this, false);
          }
        }).loadScriptStartRunStatistics(AppContext.getInstance(), "", "PreStart");
      }
      if (this.mHandler == null) {
        this.mHandler = new MyHandler(null);
      }
      this.mHandler.removeCallbacksAndMessages(null);
      this.mHandler.postDelayed(new Runnable()
      {
        public void run()
        {
          ElfinFloatView.access$302(ElfinFloatView.this, false);
        }
      }, 3000L);
    }
    this.mCountDownTimer.start();
  }
  
  protected void onDetachedFromWindow()
  {
    if (this.mHandler != null) {
      this.mHandler.removeCallbacksAndMessages(null);
    }
    super.onDetachedFromWindow();
  }
  
  public void posContorlbar(float paramFloat, int paramInt)
  {
    CommonLog localCommonLog = this.commonLog;
    StringBuilder localStringBuilder = new StringBuilder();
    localStringBuilder.append("postion>>>");
    localStringBuilder.append(paramFloat);
    localCommonLog.e(localStringBuilder.toString());
    this.mLockState = paramInt;
    if (this.mLockState != 0) {
      this.mImageViewElfin.setOnTouchListener(null);
    }
    if (this.mDeleteFloatView.getVisibility() == 0)
    {
      this.mDeleteFloatView.setVisibility(8);
      this.mDeleteFloatView.setNormal();
    }
    updateFloatViewPosition(AppDeviceUtils.getResolution(getContext()).x, (int)(AppDeviceUtils.getResolution(getContext()).y * paramFloat - getHeight()));
    this.mLinearLayoutElfin.removeView(this.mLinearLayoutTools);
    this.mLinearLayoutElfin.addView(this.mLinearLayoutTools, 0);
    if (this.mAppContext.STATE_SCRIPT == 2)
    {
      this.mImageViewElfin.setImageResource(2130837662);
      return;
    }
    this.mImageViewElfin.setImageResource(2130837649);
  }
  
  public void rotateScreen()
  {
    resetElfinState();
    this.mCountDownTimer.start();
    updateFloatViewDirection(1);
    this.mWindowManagerParams.x = (AppDeviceUtils.getResolution(getContext()).x - this.mLinearLayoutElfin.getLayoutParams().width);
    this.mWindowManagerParams.y = (AppDeviceUtils.getResolution(getContext()).y / 4);
    this.mWindowManager.updateViewLayout(this, this.mWindowManagerParams);
    this.mDeleteFloatView.rotateScreen();
  }
  
  public void setImageViewElfinTouchListener()
  {
    this.mImageViewElfin.setOnTouchListener(this.onTouchListener);
  }
  
  public void setmContext(Context paramContext)
  {
    this.mContext = paramContext;
  }
  
  public void toggleElfinVisbility()
  {
    resetElfinState();
    if (getVisibility() == 0)
    {
      changeToolBarState(false);
      this.mDeleteFloatView.setVisibility(8);
      setVisibility(8);
      return;
    }
    this.mCountDownTimer.start();
    updateFloatViewPosition(AppDeviceUtils.getResolution(getContext()).x, AppDeviceUtils.getResolution(getContext()).y / 4);
    setVisibility(0);
  }
  
  public void upadateElfinImages()
  {
    if (this.mAppContext.STATE_SCRIPT == 2) {
      this.mImageViewElfin.setImageResource(2130837662);
    } else {
      this.mImageViewElfin.setImageResource(2130837649);
    }
    resetElfinState();
    this.mCountDownTimer.start();
  }
  
  public void updateFloatViewPosition(int paramInt1, int paramInt2)
  {
    this.mWindowManagerParams.x = paramInt1;
    this.mWindowManagerParams.y = paramInt2;
    this.mWindowManager.updateViewLayout(this, this.mWindowManagerParams);
  }
  
  private class ElfinGestureListener
    implements GestureDetector.OnGestureListener
  {
    private ElfinGestureListener() {}
    
    public boolean onDown(MotionEvent paramMotionEvent)
    {
      return false;
    }
    
    public boolean onFling(MotionEvent paramMotionEvent1, MotionEvent paramMotionEvent2, float paramFloat1, float paramFloat2)
    {
      return false;
    }
    
    public void onLongPress(MotionEvent paramMotionEvent) {}
    
    public boolean onScroll(MotionEvent paramMotionEvent1, MotionEvent paramMotionEvent2, float paramFloat1, float paramFloat2)
    {
      return false;
    }
    
    public void onShowPress(MotionEvent paramMotionEvent) {}
    
    public boolean onSingleTapUp(MotionEvent paramMotionEvent)
    {
      if (ElfinFloatView.this.mDeleteFloatView.getVisibility() == 0) {
        ElfinFloatView.this.mDeleteFloatView.setVisibility(8);
      }
      if (ElfinFloatView.this.mLinearLayoutTools.getVisibility() == 0) {
        ElfinFloatView.this.changeToolBarState(false);
      } else {
        ElfinFloatView.this.changeToolBarState(true);
      }
      ElfinFloatView.this.mCountDownTimer.start();
      return true;
    }
  }
  
  private static class MyHandler
    extends Handler
  {
    public void handleMessage(Message paramMessage)
    {
      super.handleMessage(paramMessage);
    }
  }
}
推荐
syskey 发表于 2020-3-17 20:23
本帖最后由 syskey 于 2020-3-17 20:25 编辑

不是JAVA类?什么意思


[Java] 纯文本查看 复制代码
import android.annotation.SuppressLint;import android.app.Application;
import android.annotation.SuppressLint;
import android.app.Application;
import android.content.Context;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import com.blankj.utilcode.util.Utils;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.Enumeration;

public final class fa
{
  public static String a(String[] paramArrayOfString)
  {
    return randomMac()
  }
  public String randomMac()
  {
    Random random = new Random();
    String[] mac = {
            String.format("%02x", 0x52),
            String.format("%02x", 0x54),
            String.format("%02x", 0x00),
            String.format("%02x", random.nextInt(0xff)),
            String.format("%02x", random.nextInt(0xff)),
            String.format("%02x", random.nextInt(0xff))
    };
    return String.join(“:”, mac);
    }
  public static InetAddress a()
  {
    try
    {
      while (true)
      {
        Enumeration localEnumeration1 = NetworkInterface.getNetworkInterfaces();
        while (true)
          if (localEnumeration1.hasMoreElements())
          {
            NetworkInterface localNetworkInterface = (NetworkInterface)localEnumeration1.nextElement();
            if (!localNetworkInterface.isUp())
              continue;
            Enumeration localEnumeration2 = localNetworkInterface.getInetAddresses();
            if (!localEnumeration2.hasMoreElements())
              continue;
            InetAddress localInetAddress = (InetAddress)localEnumeration2.nextElement();
            if (localInetAddress.isLoopbackAddress())
              break;
            int i = localInetAddress.getHostAddress().indexOf(':');
            if (i >= 0)
              break;
            return localInetAddress;
          }
      }
    }
    catch (SocketException localSocketException)
    {
      localSocketException.printStackTrace();
    }
    return null;
  }

  public static void a(boolean paramBoolean)
  {
    WifiManager localWifiManager = (WifiManager)Utils.b().getSystemService("wifi");
    if (localWifiManager == null)
      return;
    if (paramBoolean == localWifiManager.isWifiEnabled())
      return;
    localWifiManager.setWifiEnabled(paramBoolean);
  }

  public static boolean a(String paramString, String[] paramArrayOfString)
  {
    if ((paramArrayOfString != null) && (paramArrayOfString.length != 0))
    {
      int i = paramArrayOfString.length;
      for (int j = 0; j < i; j++)
        if (paramString.equals(paramArrayOfString[j]))
          return false;
      return true;
    }
    return true ^ "02:00:00:00:00:00".equals(paramString);
  }

  public static String b()
  {
    String str = a(null);
    if (str.equals(""))
    {
      if (g())
        return str;
      a(true);
      a(false);
      return a(null);
    }
    return str;
  }

  public static String c()
  {
    ka.a locala1 = ka.a("getprop wifi.interface", false);
    if (locala1.a == 0)
    {
      String str1 = locala1.b;
      if (str1 != null)
      {
        StringBuilder localStringBuilder = new StringBuilder();
        localStringBuilder.append("cat /sys/class/net/");
        localStringBuilder.append(str1);
        localStringBuilder.append("/address");
        ka.a locala2 = ka.a(localStringBuilder.toString(), false);
        if (locala2.a == 0)
        {
          String str2 = locala2.b;
          if ((str2 != null) && (str2.length() > 0))
            return str2;
        }
      }
    }
    return "02:00:00:00:00:00";
  }

  public static String d()
  {
    try
    {
      InetAddress localInetAddress = a();
      if (localInetAddress != null)
      {
        NetworkInterface localNetworkInterface = NetworkInterface.getByInetAddress(localInetAddress);
        if (localNetworkInterface != null)
        {
          byte[] arrayOfByte = localNetworkInterface.getHardwareAddress();
          if ((arrayOfByte != null) && (arrayOfByte.length > 0))
          {
            StringBuilder localStringBuilder = new StringBuilder();
            int i = arrayOfByte.length;
            for (int j = 0; j < i; j++)
            {
              byte b = arrayOfByte[j];
              Object[] arrayOfObject = new Object[1];
              arrayOfObject[0] = Byte.valueOf(b);
              localStringBuilder.append(String.format("%02x:", arrayOfObject));
            }
            String str = localStringBuilder.substring(0, localStringBuilder.length() - 1);
            return str;
          }
        }
      }
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
    return "02:00:00:00:00:00";
  }

  public static String e()
  {
    try
    {
      Enumeration localEnumeration = NetworkInterface.getNetworkInterfaces();
      while (localEnumeration.hasMoreElements())
      {
        NetworkInterface localNetworkInterface = (NetworkInterface)localEnumeration.nextElement();
        if ((localNetworkInterface == null) || (!localNetworkInterface.getName().equalsIgnoreCase("wlan0")))
          continue;
        byte[] arrayOfByte = localNetworkInterface.getHardwareAddress();
        if ((arrayOfByte == null) || (arrayOfByte.length <= 0))
          continue;
        StringBuilder localStringBuilder = new StringBuilder();
        int i = arrayOfByte.length;
        for (int j = 0; j < i; j++)
        {
          byte b = arrayOfByte[j];
          Object[] arrayOfObject = new Object[1];
          arrayOfObject[0] = Byte.valueOf(b);
          localStringBuilder.append(String.format("%02x:", arrayOfObject));
        }
        String str = localStringBuilder.substring(0, localStringBuilder.length() - 1);
        return str;
      }
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
    return "02:00:00:00:00:00";
  }

  @SuppressLint({"MissingPermission", "HardwareIds"})
  public static String f()
  {
    try
    {
      WifiManager localWifiManager = (WifiManager)Utils.b().getApplicationContext().getSystemService("wifi");
      if (localWifiManager != null)
      {
        WifiInfo localWifiInfo = localWifiManager.getConnectionInfo();
        if (localWifiInfo != null)
        {
          String str = localWifiInfo.getMacAddress();
          return str;
        }
      }
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
    return "02:00:00:00:00:00";
  }

  public static boolean g()
  {
    WifiManager localWifiManager = (WifiManager)Utils.b().getSystemService("wifi");
    if (localWifiManager == null)
      return false;
    return localWifiManager.isWifiEnabled();
  }
}
沙发
不苦小和尚 发表于 2019-5-22 19:20
3#
 楼主| AcsZeg 发表于 2019-5-22 20:06 |楼主
不苦小和尚 发表于 2019-5-22 19:20
厉害,这个都会呀,可以做个.small还原了

下个版本加上 smali To dex 让修改apk的可以直接替换
4#
huge33 发表于 2019-5-22 20:20
感谢楼主分享!!!!
5#
skingwa 发表于 2019-5-22 22:04
这是大牛~~~
6#
naffan 发表于 2019-5-22 23:02
转换成smali能用来做些什么?
7#
 楼主| AcsZeg 发表于 2019-5-22 23:18 |楼主
naffan 发表于 2019-5-22 23:02
转换成smali能用来做些什么?

在别人代码插入自己代码
8#
TopGreat 发表于 2019-5-23 05:01
是使用dex2jar还是baksmali呢?
9#
龙性 发表于 2019-5-23 07:28
能共享出来源码吗?
10#
kennith121 发表于 2019-5-23 09:13
好厉害 !!!点赞
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-12-23 04:32

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表