鸠摩搜书官方正版 v1.7版本的 MD5 值为:01c9a20d2c415de3233d7f691829edf5

以下内容为反编译后的 v.java 源代码,内容仅作参考


package com.panda.offerwall;

import android.app.Activity;
import android.content.IntentFilter;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.DisplayMetrics;
import android.util.Log;
import android.widget.HorizontalScrollView;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.Toast;
import com.panda.offerwall.data.crypt;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public final class v implements Serializable {

    public Activity f386a;
    public a f;
    public ac g;
    ListView i;
    t j;
    private com.panda.offerwall.a.b k;
    public List b = null;
    private List l = null;
    private z m = new z(this);
    public com.panda.offerwall.d.a c = null;
    public com.panda.offerwall.d.d d = null;
    public HorizontalScrollView e = null;
    private r n = null;
    private Configuration o = null;
    private AutoStartGameReceiver p = null;
    public Map h = new HashMap();

    public v(Activity activity) {
        this.f386a = null;
        this.k = null;
        this.f386a = activity;
        this.k = new com.panda.offerwall.a.b(activity);
    }

    public static void a() {
    }

    private void n() {
        int i = 0;
        while (true) {
            int i2 = i;
            if (i2 >= this.b.size()) {
                return;
            }
            if (getClass().getResourceAsStream("/assets/" + ((String) this.h.get(Integer.valueOf(((com.panda.offerwall.b.a) this.b.get(i2)).a())))) == null) {
                try {
                    if (!com.panda.offerwall.c.c.a(this.f386a.getFilesDir(), (String) this.h.get(Integer.valueOf(((com.panda.offerwall.b.a) this.b.get(i2)).a())))) {
                        System.out.println("下载图片。。。");
                        new Thread(new y(this, ((com.panda.offerwall.b.a) this.b.get(i2)).c())).start();
                    }
                } catch (Exception e) {
                    Log.i("OfferWall", "图片下载失败");
                    e.printStackTrace();
                }
            }
            i = i2 + 1;
        }
    }

    public final void b() {
        DisplayMetrics displayMetrics = new DisplayMetrics();
        this.f386a.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
        int i = displayMetrics.widthPixels;
        int i2 = displayMetrics.heightPixels;
        com.panda.offerwall.c.b.g = i;
        com.panda.offerwall.c.b.h = i2;
        System.out.println(i);
        System.out.println(i2);
        this.o = this.f386a.getResources().getConfiguration();
        int i3 = this.o.orientation;
        com.panda.offerwall.c.b.f = i3;
        if (i3 == 2) {
            com.panda.offerwall.c.b.b = i / 800.0f;
            com.panda.offerwall.c.b.f361a = i2 / 480.0f;
        } else if (com.panda.offerwall.c.b.f == 1) {
            com.panda.offerwall.c.b.b = i / com.panda.offerwall.c.b.d;
            com.panda.offerwall.c.b.f361a = i2 / com.panda.offerwall.c.b.e;
        }
        com.panda.offerwall.c.b.c = displayMetrics.density;
    }

    public final void c() {
        crypt.a().a(this.f386a);
    }

    public final void d() {
        this.j.notifyDataSetChanged();
    }

    public final void e() {
        this.f386a.setContentView(i.c);
        this.i = (ListView) this.f386a.findViewById(h.f372a);
        this.j = new t(this.f386a, this.b, this.l);
        this.i.setAdapter((ListAdapter) this.j);
        this.i.setOnItemClickListener(new l(this, this.b));
    }

    public final void f() {
        long currentTimeMillis = System.currentTimeMillis();
        long j = this.f386a.getSharedPreferences("configUpdate", 0).getLong("UpdateTime", 0L);
        int i = com.panda.offerwall.c.b.x;
        int i2 = (int) ((currentTimeMillis - j) / 3600000);
        String a2 = crypt.a().a(";;id=" + this.k.d("PANDAID"));
        this.k.e("UMENG_CHANNEL");
        if (j > currentTimeMillis) {
            com.panda.offerwall.c.c.a(this.f386a, "configUpdate", "UpdateTime", currentTimeMillis);
            new Thread(new y(this, "http://offerwall.mypanda.cn/cgi-bin/owg", a2)).start();
            System.out.println("更新config.xml文件。。。");
        } else {
            if (i <= 24) {
                i = 24;
            }
            if (i2 >= (i <= 336 ? i : 336)) {
                new Thread(new y(this, "http://offerwall.mypanda.cn/cgi-bin/owg", a2)).start();
                System.out.println("更新config.xml文件。。。");
            }
        }
    }

    public final void g() {
        InputStream resourceAsStream;
        Throwable th;
        this.f386a.getAssets();
        this.l = new ArrayList();
        int i = 0;
        InputStream inputStream = null;
        while (i < this.b.size()) {
            try {
                try {
                    resourceAsStream = this.f386a.openFileInput(com.panda.offerwall.c.c.a(((com.panda.offerwall.b.a) this.b.get(i)).c()));
                    BitmapFactory.Options options = new BitmapFactory.Options();
                    options.inPreferredConfig = Bitmap.Config.RGB_565;
                    this.l.add(BitmapFactory.decodeStream(resourceAsStream, null, options));
                    if (resourceAsStream != null) {
                        try {
                            resourceAsStream.close();
                        } catch (IOException e) {
                            e.printStackTrace();
                        }
                    }
                } catch (Exception e2) {
                    Log.i("OfferWall", "本地图片找不到,加载默认打包的图片");
                    resourceAsStream = getClass().getResourceAsStream("/assets/" + com.panda.offerwall.c.c.a(((com.panda.offerwall.b.a) this.b.get(i)).c()));
                    if (resourceAsStream == null) {
                        try {
                            Log.i("OfferWall", "本地图片找不到,加载统一的默认图片");
                            resourceAsStream = getClass().getResourceAsStream("/assets/local.png");
                        } catch (Throwable th2) {
                            inputStream = resourceAsStream;
                            th = th2;
                            BitmapFactory.Options options2 = new BitmapFactory.Options();
                            options2.inPreferredConfig = Bitmap.Config.RGB_565;
                            this.l.add(BitmapFactory.decodeStream(inputStream, null, options2));
                            if (inputStream != null) {
                            }
                            throw th;
                        }
                    }
                    BitmapFactory.Options options3 = new BitmapFactory.Options();
                    options3.inPreferredConfig = Bitmap.Config.RGB_565;
                    this.l.add(BitmapFactory.decodeStream(resourceAsStream, null, options3));
                    if (resourceAsStream != null) {
                        try {
                            resourceAsStream.close();
                        } catch (IOException e3) {
                            e3.printStackTrace();
                        }
                    }
                }
                i++;
                inputStream = resourceAsStream;
            } catch (Throwable th3) {
                th = th3;
                BitmapFactory.Options options22 = new BitmapFactory.Options();
                options22.inPreferredConfig = Bitmap.Config.RGB_565;
                this.l.add(BitmapFactory.decodeStream(inputStream, null, options22));
                if (inputStream != null) {
                    try {
                        inputStream.close();
                    } catch (IOException e4) {
                        e4.printStackTrace();
                    }
                }
                throw th;
            }
        }
        n();
    }

    public final void h() {
        InputStream inputStream;
        try {
            if (this.f386a.getFilesDir().list(new w(this)).length <= 0) {
                this.f386a.getAssets();
                inputStream = getClass().getResourceAsStream("/assets/config.xml");
            } else {
                inputStream = this.f386a.openFileInput("owg");
            }
        } catch (Exception e) {
            Log.i("OfferWall", "本地没有config.xml文件!");
            Toast.makeText(this.f386a, "配置文件不存在!请先打开网络,重新开始游戏", 0).show();
            e.printStackTrace();
            inputStream = null;
        }
        try {
            this.b = com.panda.offerwall.c.c.a(inputStream);
        } catch (Exception e2) {
            Log.i("OfferWall", "config.xml解析出错!");
            e2.printStackTrace();
            this.f386a.getAssets();
            try {
                this.b = com.panda.offerwall.c.c.a(getClass().getResourceAsStream("/assets/config.xml"));
            } catch (Exception e3) {
                e3.printStackTrace();
            }
        }
        for (int i = 0; i < this.b.size(); i++) {
            if (Integer.parseInt(((com.panda.offerwall.b.a) this.b.get(i)).h()) == 0) {
                this.b.remove(i);
            }
        }
        i();
        for (int i2 = 0; i2 < this.b.size(); i2++) {
            this.h.put(Integer.valueOf(((com.panda.offerwall.b.a) this.b.get(i2)).a()), com.panda.offerwall.c.c.a(((com.panda.offerwall.b.a) this.b.get(i2)).c()));
        }
    }

    public final void i() {
        ArrayList arrayList = new ArrayList();
        int i = 0;
        for (int i2 = 0; i2 < this.b.size(); i2++) {
            int parseInt = Integer.parseInt(((com.panda.offerwall.b.a) this.b.get(i2)).h());
            if (parseInt > 0) {
                i += parseInt;
                arrayList.add(Integer.valueOf(parseInt));
            }
        }
        ArrayList arrayList2 = new ArrayList();
        while (!arrayList.isEmpty()) {
            int a2 = com.panda.offerwall.c.c.a(arrayList, i);
            arrayList2.add((com.panda.offerwall.b.a) this.b.get(a2));
            this.b.remove(a2);
            int intValue = ((Integer) arrayList.get(a2)).intValue();
            arrayList.remove(a2);
            i -= intValue;
        }
        this.b = arrayList2;
    }

    public final void j() {
        this.p = new AutoStartGameReceiver(this);
        IntentFilter intentFilter = new IntentFilter("android.intent.action.PACKAGE_ADDED");
        intentFilter.addDataScheme("package");
        this.f386a.registerReceiver(this.p, intentFilter);
    }

    public final void k() {
        this.f386a.unregisterReceiver(this.p);
    }

    public final void l() {
        File filesDir = this.f386a.getFilesDir();
        for (String str : filesDir.list(new x(this))) {
            com.panda.offerwall.c.c.b(filesDir + "/" + str);
        }
    }

    public final void m() {
        this.j = new t(this.f386a, this.b, this.l);
        this.i.setAdapter((ListAdapter) this.j);
        this.i.setOnItemClickListener(new l(this, this.b));
    }
}