导航菜单

页面标题

页面副标题

Clean Center v0.5.5 - SysKit.java 源代码

正在查看: Clean Center v0.5.5 应用的 SysKit.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.wxiwei.office.system;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.RoundRectShape;
import android.net.Uri;
import android.os.Environment;
import android.os.StatFs;
import com.tom_roush.pdfbox.pdmodel.documentinterchange.taggedpdf.PDLayoutAttributeObject;
import com.wxiwei.office.common.bookmark.BookmarkManage;
import com.wxiwei.office.common.borders.BordersManage;
import com.wxiwei.office.common.bulletnumber.ListManage;
import com.wxiwei.office.common.hyperlink.HyperlinkManage;
import com.wxiwei.office.common.picture.PictureManage;
import com.wxiwei.office.pg.animate.AnimationManager;
import com.wxiwei.office.pg.model.PGBulletText;
import com.wxiwei.office.system.beans.CalloutView.CalloutManager;
import com.wxiwei.office.wp.control.WPShapeManage;
import java.io.File;

public class SysKit {
    private static ShapeDrawable pageNumberDrawable;
    private AnimationManager animationMgr;
    private BookmarkManage bmKit;
    private BordersManage brKit;
    private CalloutManager calloutMgr;
    private IControl control;
    private ErrorUtil errorKit;
    private HyperlinkManage hmKit;
    private ListManage lmKit;
    private PGBulletText pgLMKit;
    private PictureManage pmKit;
    private WPShapeManage wpSMKit;

    public static boolean isValidateRect(int i, int i2, int i3, int i4, int i5, int i6) {
        return i3 >= 0 && i4 >= 0 && i3 < i && i4 < i2 && i5 >= 0 && i6 >= 0 && i3 + i5 <= i && i4 + i6 <= i2;
    }

    public IControl getControl() {
        return this.control;
    }

    public boolean isDebug() {
        return false;
    }

    public void setControl(IControl iControl) {
        this.control = iControl;
    }

    public SysKit(IControl iControl) {
        this.control = iControl;
    }

    public File getSDPath() {
        if (new File("/mnt/extern_sd").exists() || new File("/mnt/usbhost1").exists()) {
            return new File("/mnt");
        }
        if ("mounted".equals(Environment.getExternalStorageState())) {
            return Environment.getExternalStorageDirectory();
        }
        return null;
    }

    public long getAvailableStore(String str) {
        StatFs statFs = new StatFs(str);
        return statFs.getAvailableBlocks() * statFs.getBlockSize();
    }

    public boolean isVertical(Context context) {
        return context.getResources().getConfiguration().orientation == 1;
    }

    public String charsetEncode(String str, String str2) {
        if ("".equals(str)) {
            return "";
        }
        StringBuffer stringBuffer = new StringBuffer("");
        try {
            byte[] bytes = str.getBytes(str2);
            for (byte b : bytes) {
                String hexString = Integer.toHexString(b & 255);
                if (hexString.length() == 1) {
                    stringBuffer.append(PDLayoutAttributeObject.GLYPH_ORIENTATION_VERTICAL_ZERO_DEGREES).append(hexString);
                } else {
                    stringBuffer.append(hexString);
                }
            }
            char[] charArray = stringBuffer.toString().toCharArray();
            stringBuffer.delete(0, stringBuffer.length());
            for (int i = 0; i < charArray.length; i += 2) {
                stringBuffer.append("%").append(charArray[i]).append(charArray[i + 1]);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return stringBuffer.toString();
    }

    public void internetSearch(String str, Activity activity) {
        activity.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("http://www.google.com.hk/#hl=en&newwindow=1&safe=strict&site=&q=a-a-a-a&oq=a-a-a-a&aq=f&aqi=&aql=&gs_sm=3&gs_upl=1075l1602l0l1935l3l3l0l0l0l0l0l0ll0l0&gs_l=hp.3...1075l1602l0l1935l3l3l0l0l0l0l0l0ll0l0&bav=on.2,or.r_gc.r_pw.,cf.osb&fp=207f1fbbc21b7536&biw=1280&bih=876".replaceAll("a-a-a-a", charsetEncode(str, "utf-8")))));
    }

    public static Drawable getPageNubmerDrawable() {
        if (pageNumberDrawable == null) {
            ShapeDrawable shapeDrawable = new ShapeDrawable(new RoundRectShape(new float[]{6.0f, 6.0f, 6.0f, 6.0f, 6.0f, 6.0f, 6.0f, 6.0f}, null, null));
            pageNumberDrawable = shapeDrawable;
            shapeDrawable.getPaint().setColor(-1996519356);
        }
        return pageNumberDrawable;
    }

    public ErrorUtil getErrorKit() {
        if (this.errorKit == null) {
            this.errorKit = new ErrorUtil(this);
        }
        return this.errorKit;
    }

    public PictureManage getPictureManage() {
        if (this.pmKit == null) {
            this.pmKit = new PictureManage(this.control);
        }
        return this.pmKit;
    }

    public HyperlinkManage getHyperlinkManage() {
        if (this.hmKit == null) {
            this.hmKit = new HyperlinkManage();
        }
        return this.hmKit;
    }

    public ListManage getListManage() {
        if (this.lmKit == null) {
            this.lmKit = new ListManage();
        }
        return this.lmKit;
    }

    public PGBulletText getPGBulletText() {
        if (this.pgLMKit == null) {
            this.pgLMKit = new PGBulletText();
        }
        return this.pgLMKit;
    }

    public BordersManage getBordersManage() {
        if (this.brKit == null) {
            this.brKit = new BordersManage();
        }
        return this.brKit;
    }

    public WPShapeManage getWPShapeManage() {
        if (this.wpSMKit == null) {
            this.wpSMKit = new WPShapeManage();
        }
        return this.wpSMKit;
    }

    public BookmarkManage getBookmarkManage() {
        if (this.bmKit == null) {
            this.bmKit = new BookmarkManage();
        }
        return this.bmKit;
    }

    public AnimationManager getAnimationManager() {
        if (this.animationMgr == null) {
            this.animationMgr = new AnimationManager(this.control);
        }
        return this.animationMgr;
    }

    public CalloutManager getCalloutManager() {
        if (this.calloutMgr == null) {
            this.calloutMgr = new CalloutManager(this.control);
        }
        return this.calloutMgr;
    }

    public void dispose() {
        this.control = null;
        ErrorUtil errorUtil = this.errorKit;
        if (errorUtil != null) {
            errorUtil.dispose();
            this.errorKit = null;
        }
        PictureManage pictureManage = this.pmKit;
        if (pictureManage != null) {
            pictureManage.dispose();
            this.pmKit = null;
        }
        HyperlinkManage hyperlinkManage = this.hmKit;
        if (hyperlinkManage != null) {
            hyperlinkManage.dispose();
            this.hmKit = null;
        }
        ListManage listManage = this.lmKit;
        if (listManage != null) {
            listManage.dispose();
            this.lmKit = null;
        }
        PGBulletText pGBulletText = this.pgLMKit;
        if (pGBulletText != null) {
            pGBulletText.dispose();
            this.pgLMKit = null;
        }
        BordersManage bordersManage = this.brKit;
        if (bordersManage != null) {
            bordersManage.dispose();
            this.brKit = null;
        }
        WPShapeManage wPShapeManage = this.wpSMKit;
        if (wPShapeManage != null) {
            wPShapeManage.dispose();
            this.wpSMKit = null;
        }
        BookmarkManage bookmarkManage = this.bmKit;
        if (bookmarkManage != null) {
            bookmarkManage.dispose();
            this.bmKit = null;
        }
        AnimationManager animationManager = this.animationMgr;
        if (animationManager != null) {
            animationManager.dispose();
            this.animationMgr = null;
        }
        CalloutManager calloutManager = this.calloutMgr;
        if (calloutManager != null) {
            calloutManager.dispose();
            this.calloutMgr = null;
        }
    }
}