Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.fastestvideotube.funnyclip.utils;
- import java.io.BufferedReader;
- import java.io.File;
- import java.io.FileInputStream;
- import java.io.FileOutputStream;
- import java.io.IOException;
- import java.io.InputStream;
- import java.io.InputStreamReader;
- import java.io.OutputStreamWriter;
- import java.security.MessageDigest;
- import java.security.NoSuchAlgorithmException;
- import java.util.ArrayList;
- import org.apache.http.HttpResponse;
- import org.apache.http.client.methods.HttpGet;
- import org.apache.http.impl.client.DefaultHttpClient;
- import org.json.JSONArray;
- import org.json.JSONException;
- import org.json.JSONObject;
- import android.app.Activity;
- import android.content.Context;
- import android.net.ConnectivityManager;
- import android.os.Build;
- import android.os.Environment;
- import android.os.Handler;
- import android.provider.Settings;
- import android.provider.Settings.Secure;
- import android.telephony.TelephonyManager;
- import android.view.View;
- import android.view.ViewGroup;
- import android.view.View.MeasureSpec;
- import android.view.inputmethod.InputMethodManager;
- import android.widget.ListAdapter;
- import android.widget.ListView;
- import android.widget.Toast;
- public class MyUtil {
- Activity mcontext;
- public static final boolean isShowAds = true;
- public MyUtil(Activity activity) {
- this.mcontext = activity;
- }
- public void isCloseKeyboard() {
- InputMethodManager inputManager = (InputMethodManager) mcontext
- .getSystemService(mcontext.INPUT_METHOD_SERVICE);
- inputManager.hideSoftInputFromWindow(mcontext.getCurrentFocus()
- .getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
- }
- public boolean isInternet(Context context) {
- ConnectivityManager con_manager = (ConnectivityManager) context
- .getSystemService(Context.CONNECTIVITY_SERVICE);
- if (con_manager.getActiveNetworkInfo() != null
- && con_manager.getActiveNetworkInfo().isAvailable()
- && con_manager.getActiveNetworkInfo().isConnected()) {
- return true;
- } else {
- return false;
- }
- }
- public static String[] split(String url, String regular) {
- String str[] = url.split(regular);
- return str;
- }
- public static String getYoutubeDirectUrl(String paramString)
- {
- try
- {
- String str1 = readStream(retrieveStreamCustom(paramString, "Mozilla/5.0 (iPad; CPU OS 6_0_1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A523 Safari/8536.25"));
- String str2 = str1.substring(str1.indexOf("\\\"fmt_stream_map\\\":"));
- String str3 = str2.substring(0, str2.indexOf("\"}]"));
- String str4 = str3.substring(str3.indexOf("http"));
- String str5 = str4.substring(0, str4.indexOf("\"")).replace("%252", "%2").replace("\\u0026", "&").replace("\\", "");
- return str5;
- }
- catch (Exception localException)
- {
- MyLog.E( "Youtube Eror:" + localException.getMessage());
- }
- return "";
- }
- public static String getYoutubeRespond(String paramString)
- {
- try
- {
- String str1 = paramString;//readStream(retrieveStreamCustom(paramString, "Mozilla/5.0 (iPad; CPU OS 6_0_1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A523 Safari/8536.25"));
- String str2 = str1.substring(str1.indexOf("\\\"fmt_stream_map\\\":"));
- String str3 = str2.substring(0, str2.indexOf("\"}]"));
- String str4 = str3.substring(str3.indexOf("http"));
- String str5 = str4.substring(0, str4.indexOf("\"")).replace("%252", "%2").replace("\\u0026", "&").replace("\\", "");
- return str5;
- }
- catch (Exception localException)
- {
- MyLog.E( "Youtube Eror:" + localException.getMessage());
- }
- return "";
- }
- public static InputStream retrieveStreamCustom(String paramString1, String paramString2)
- {
- DefaultHttpClient localDefaultHttpClient = new DefaultHttpClient();
- HttpGet localHttpGet = new HttpGet(paramString1);
- localHttpGet.setHeader("User-Agent", paramString2);
- try
- {
- HttpResponse localHttpResponse = localDefaultHttpClient.execute(localHttpGet);
- int i = localHttpResponse.getStatusLine().getStatusCode();
- if (i != 200)
- {
- MyLog.E("Error " + i + " for URL " + paramString1);
- return null;
- }
- InputStream localInputStream = localHttpResponse.getEntity().getContent();
- return localInputStream;
- }
- catch (IOException localIOException)
- {
- localHttpGet.abort();
- MyLog.E("Error for URL " + paramString1+ localIOException);
- }
- return null;
- }
- static String readStream(InputStream paramInputStream)
- throws IOException
- {
- InputStreamReader localInputStreamReader = new InputStreamReader(paramInputStream);
- BufferedReader localBufferedReader = new BufferedReader(localInputStreamReader);
- StringBuilder localStringBuilder = new StringBuilder();
- while (true)
- {
- String str = localBufferedReader.readLine();
- if (str == null)
- {
- localBufferedReader.close();
- localInputStreamReader.close();
- paramInputStream.close();
- return localStringBuilder.toString();
- }
- localStringBuilder.append(str);
- }
- }
- public void setListViewHeightBasedOnChildren(ListView listView) {
- ListAdapter listAdapter = listView.getAdapter();
- if (listAdapter == null) {
- // pre-condition
- return;
- }
- int totalHeight = 0;
- int desiredWidth = MeasureSpec.makeMeasureSpec(listView.getWidth(),
- MeasureSpec.AT_MOST);
- for (int i = 0; i < listAdapter.getCount(); i++) {
- View listItem = listAdapter.getView(i, null, listView);
- listItem.measure(desiredWidth, MeasureSpec.UNSPECIFIED);
- totalHeight += listItem.getMeasuredHeight();
- }
- ViewGroup.LayoutParams params = listView.getLayoutParams();
- params.height = totalHeight
- + (listView.getDividerHeight() * (listAdapter.getCount() - 1));
- listView.setLayoutParams(params);
- listView.requestLayout();
- }
- // public static String initPhotoPager(ArrayList<objHaiVL> photo)
- // throws JSONException, UnsupportedEncodingException {
- // JSONArray jArrayFacebookData = new JSONArray();
- // for (objHaiVL obj : photo) {
- // JSONObject jObjectType = new JSONObject();
- // jObjectType.put("Id", obj.Id);
- // jObjectType.put("Caption", obj.Caption);
- // jObjectType.put("CreatedAt", obj.CreatedAt);
- // jObjectType.put("ImageUrl", obj.ImageUrl);
- // jObjectType.put("ThumbnailUrl", obj.ThumbnailUrl);
- // jObjectType.put("CreatedBy",obj.CreatedBy);
- // jObjectType.put("YoutubeId", obj.YoutubeId);
- // jObjectType.put("Views", obj.Views);
- // jObjectType.put("Likes",obj.Likes);
- // jObjectType.put("Comments",obj.Comments);
- // jObjectType.put("IsVideo", obj.IsVideo);
- //
- // jArrayFacebookData.put(jObjectType);
- // }
- // MyLog.E("tao json Filter>>>>>"
- // + jArrayFacebookData.toString());
- // return jArrayFacebookData.toString();
- // }
- // public ArrayList<objCategory> getCategory(String resStr)
- // throws JSONException {
- // ArrayList<objCategory> list = new ArrayList<objCategory>();
- //
- // JSONArray jsonArray = new JSONArray(resStr);
- // if (jsonArray != null) {
- // int size = jsonArray.length();
- // JSONObject obj;
- // for (int i = 0; i < size; i++) {
- // objCategory newfeed = new objCategory();
- // obj = (JSONObject) jsonArray.get(i);
- // if (obj != null) {
- // newfeed.id = obj.getString("id");
- // newfeed.img = obj.getString("img");
- // newfeed.name = obj.getString("name");
- // }
- // list.add(newfeed);
- // }
- // return list;
- // } else
- // return null;
- // }
- //
- // public ArrayList<objVideo> getVideo(String resStr)
- // throws JSONException {
- // ArrayList<objVideo> list = new ArrayList<objVideo>();
- //
- // JSONArray jsonArray = new JSONArray(resStr);
- // if (jsonArray != null) {
- // int size = jsonArray.length();
- // JSONObject obj;
- // for (int i = 0; i < size; i++) {
- // objVideo newfeed = new objVideo();
- // obj = (JSONObject) jsonArray.get(i);
- // if (obj != null) {
- // newfeed.id = obj.getString("id");
- // newfeed.duration = obj.getString("duration");
- // newfeed.imgPath = obj.getString("imgPath");
- // newfeed.title = obj.getString("title");
- // newfeed.v = obj.getString("v");
- // newfeed.videoType = obj.getString("videoType");
- // }
- // list.add(newfeed);
- // }
- // return list;
- // } else
- // return null;
- // }
- //
- // public ArrayList<objVideoDetail> getVideoDetail(String resStr)
- // throws JSONException {
- // ArrayList<objVideoDetail> list = new ArrayList<objVideoDetail>();
- //
- // JSONArray jsonArray = new JSONArray(resStr);
- // if (jsonArray != null) {
- // int size = jsonArray.length();
- // JSONObject obj;
- // for (int i = 0; i < size; i++) {
- // objVideoDetail newfeed = new objVideoDetail();
- // obj = (JSONObject) jsonArray.get(i);
- // if (obj != null) {
- // newfeed.id = obj.getString("id");
- // newfeed.duration = obj.getString("duration");
- // newfeed.imgPath = obj.getString("imgPath");
- // newfeed.title = obj.getString("title");
- // newfeed.v = obj.getString("v");
- // newfeed.videoType = obj.getString("videoType");
- // newfeed.channelId = obj.getString("channelId");
- // newfeed.channelImgPath = obj.getString("channelImgPath");
- // newfeed.channelName = obj.getString("channelName");
- // newfeed.createDate = obj.getString("createDate");
- // newfeed.description = obj.getString("description");
- // newfeed.videCount = obj.getString("videCount");
- //
- // }
- // list.add(newfeed);
- // }
- // return list;
- // } else
- // return null;
- // }
- //
- // public ArrayList<objVideoRelate> getVideoRelate(String resStr)
- // throws JSONException {
- // ArrayList<objVideoRelate> list = new ArrayList<objVideoRelate>();
- //
- // JSONArray jsonArray = new JSONArray(resStr);
- // if (jsonArray != null) {
- // int size = jsonArray.length();
- // JSONObject obj;
- // for (int i = 0; i < size; i++) {
- // objVideoRelate newfeed = new objVideoRelate();
- // obj = (JSONObject) jsonArray.get(i);
- // if (obj != null) {
- // newfeed.id = obj.getString("id");
- // newfeed.duration = obj.getString("duration");
- // newfeed.imgPath = obj.getString("imgPath");
- // newfeed.title = obj.getString("title");
- // newfeed.v = obj.getString("v");
- // newfeed.videoType = obj.getString("videoType");
- // newfeed.createdDate = obj.getString("createdDate");
- // newfeed.viewCount = obj.getString("viewCount");
- // }
- // list.add(newfeed);
- // }
- // return list;
- // } else
- // return null;
- // }
- // public ArrayList<objCategoryPhim> getCategory(String resStr)
- // throws JSONException {
- // ArrayList<objCategoryPhim> list = new ArrayList<objCategoryPhim>();
- //
- // JSONObject jsonObject = new JSONObject(resStr);
- // JSONArray jsonArray = jsonObject.getJSONArray("result");
- // if (jsonArray != null) {
- // int size = jsonArray.length();
- // JSONObject obj;
- // for (int i = 0; i < size; i++) {
- // objCategoryPhim newfeed = new objCategoryPhim();
- // obj = (JSONObject) jsonArray.get(i);
- // if (obj != null) {
- // newfeed.id = obj.getString("id");
- // newfeed.title = obj.getString("img");
- // newfeed.type = obj.getString("name");
- // newfeed.url = obj.getString("url");
- // }
- // list.add(newfeed);
- // }
- // return list;
- // } else
- // return null;
- // }
- // public ArrayList<objCategoryPhim> getCategory1(String resStr)
- // throws JSONException {
- // ArrayList<objCategoryPhim> list = new ArrayList<objCategoryPhim>();
- // JSONObject object = new JSONObject(resStr.toString());
- // JSONArray jsonArray = object.getJSONArray("result");
- // if (jsonArray != null) {
- // int size = jsonArray.length();
- // JSONObject obj;
- // for (int i = 0; i < size; i++) {
- // objCategoryPhim newfeed = new objCategoryPhim();
- // obj = (JSONObject) jsonArray.get(i);
- // if (obj != null) {
- // newfeed.id = obj.getString("id");
- // newfeed.title = obj.getString("title");
- // newfeed.type = obj.getString("type");
- // newfeed.url = obj.getString("url");
- // }
- // list.add(newfeed);
- // }
- // return list;
- // } else
- // return null;
- // }
- // public ArrayList<objCategoryPhim> getCategory2(String resStr)
- // throws JSONException {
- // ArrayList<objCategoryPhim> list = new ArrayList<objCategoryPhim>();
- //
- // JSONArray jsonArray = new JSONArray(resStr);
- // if (jsonArray != null) {
- // int size = jsonArray.length();
- // JSONObject obj;
- // for (int i = 0; i < size; i++) {
- // objCategoryPhim newfeed = new objCategoryPhim();
- // obj = (JSONObject) jsonArray.get(i);
- // if (obj != null) {
- // newfeed.id = obj.getString("id");
- // newfeed.title = obj.getString("title");
- // newfeed.type = obj.getString("type");
- // newfeed.url = obj.getString("url");
- // }
- // list.add(newfeed);
- // }
- // return list;
- // } else
- // return null;
- // }
- // public ArrayList<objTrangChu> getListTrangChu(String resStr)
- // throws JSONException {
- // ArrayList<objTrangChu> list = new ArrayList<objTrangChu>();
- //
- // JSONObject objobject = new JSONObject(resStr);
- // JSONArray jsonArray = objobject.getJSONArray("payload");
- // if (jsonArray != null) {
- // int size = jsonArray.length();
- // JSONObject objTrChu;
- // for (int i = 0; i < size; i++) {
- // objTrangChu newTrangChu = new objTrangChu();
- // ArrayList<objListPhim> listPhim = new ArrayList<objListPhim>();
- // objTrChu = (JSONObject) jsonArray.get(i);
- // if (objTrChu != null) {
- // newTrangChu.label = objTrChu.getString("label").replace(
- // "SS", "");
- // newTrangChu.ref = objTrChu.getString("ref");
- // // MyLog.E("JSON>>>" + newTrangChu.label );
- // JSONArray jsonArrayPhim = objTrChu.getJSONArray("film");
- // if (jsonArrayPhim != null) {
- // int size1 = jsonArrayPhim.length();
- // JSONObject obj;
- // for (int j = 0; j < size1; j++) {
- // objListPhim newfeed = new objListPhim();
- // obj = (JSONObject) jsonArrayPhim.get(j);
- // if (obj != null) {
- //
- // newfeed.id = obj.getString("id");
- // // MyLog.E("JSON>>>id" + newfeed.id );
- // newfeed.category = obj.getString("category");
- // newfeed.daodien = obj.getString("daodien");
- // newfeed.diemimdb = obj.getString("diemimdb");
- // newfeed.dienvienchinh = obj
- // .getString("dienvienchinh");
- // newfeed.filmURL = obj.getString("filmURL");
- // newfeed.hinhanh = obj.getString("hinhanh");
- // newfeed.imgFullURL = obj
- // .getString("imgFullURL");
- // newfeed.imgThumbURL = obj
- // .getString("imgThumbURL");
- // newfeed.kichban = obj.getString("kichban");
- // newfeed.name = obj.getString("name");
- // newfeed.ngayphathanh = obj
- // .getString("ngayphathanh");
- // newfeed.phude = obj.getString("phude");
- // newfeed.quocgia = obj.getString("quocgia");
- // newfeed.theloai = obj.getString("theloai");
- // newfeed.thoiluong = obj.getString("thoiluong");
- // newfeed.views = obj.getString("views");
- // listPhim.add(newfeed);
- // }
- // }
- // newTrangChu.listPhim = listPhim;
- // }
- // list.add(newTrangChu);
- // }
- //
- // }
- // return list;
- // } else
- // return null;
- // }
- // public ArrayList<objListPhim> getListPhim(String resStr)
- // throws JSONException {
- // ArrayList<objListPhim> list = new ArrayList<objListPhim>();
- //
- //// JSONObject objobject = new JSONObject(resStr);
- //// JSONArray jsonArray = objobject.getJSONArray("payload");
- // JSONArray jsonArray = new JSONArray(resStr);
- // if (jsonArray != null) {
- // int size = jsonArray.length();
- // JSONObject obj;
- // for (int i = 0; i < size; i++) {
- // objListPhim newfeed = new objListPhim();
- // obj = (JSONObject) jsonArray.get(i);
- // if (obj != null) {
- // newfeed.VideoId = obj.getString("VideoId");
- // newfeed.Title = obj.getString("Title");
- // newfeed.Description = obj.getString("Description");
- // newfeed.PhotoUrl = obj.getString("PhotoUrl");
- // newfeed.Director = obj.getString("Director");
- // newfeed.Year = obj.getString("Year");
- // newfeed.Length = obj.getString("Length");
- // newfeed.Actor = obj.getString("Actor");
- // newfeed.Chapters = obj.getString("Chapters");
- // newfeed.DetailUrl = obj.getString("DetailUrl");
- // newfeed.TypeID = obj.getString("TypeID");
- // newfeed.ViewNumbers = obj.getString("ViewNumbers");
- //// newfeed.phude = obj.getString("Sort");
- // newfeed.VideoUrl = obj.getString("VideoUrl");
- // newfeed.IsCancelDownload = obj.getString("IsCancelDownload");
- // newfeed.SubTitle = obj.getString("SubTitle");
- // //Active
- // //Note
- // }
- // list.add(newfeed);
- // }
- // return list;
- // } else
- // return null;
- // }
- // public ArrayList<objListPhim> getListPhim(String resStr)
- // throws JSONException {
- // ArrayList<objListPhim> list = new ArrayList<objListPhim>();
- //
- // JSONObject objobject = new JSONObject(resStr);
- // JSONArray jsonArray = objobject.getJSONArray("payload");
- // if (jsonArray != null) {
- // int size = jsonArray.length();
- // JSONObject obj;
- // for (int i = 0; i < size; i++) {
- // objListPhim newfeed = new objListPhim();
- // obj = (JSONObject) jsonArray.get(i);
- // if (obj != null) {
- // newfeed.id = obj.getString("id");
- // newfeed.category = obj.getString("category");
- // newfeed.daodien = obj.getString("daodien");
- // newfeed.diemimdb = obj.getString("diemimdb");
- // newfeed.dienvienchinh = obj.getString("dienvienchinh");
- // newfeed.filmURL = obj.getString("filmURL");
- // newfeed.hinhanh = obj.getString("hinhanh");
- // newfeed.imgFullURL = obj.getString("imgFullURL");
- // newfeed.imgThumbURL = obj.getString("imgThumbURL");
- // newfeed.kichban = obj.getString("kichban");
- // newfeed.name = obj.getString("name");
- // newfeed.ngayphathanh = obj.getString("ngayphathanh");
- // newfeed.phude = obj.getString("phude");
- // newfeed.quocgia = obj.getString("quocgia");
- // newfeed.theloai = obj.getString("theloai");
- // newfeed.thoiluong = obj.getString("thoiluong");
- // newfeed.views = obj.getString("views");
- // }
- // list.add(newfeed);
- // }
- // return list;
- // } else
- // return null;
- // }
- // public objDetailPhim getDetailPhim(String resStr) throws JSONException {
- // objDetailPhim newfeed = new objDetailPhim();
- // JSONObject objPayload = new JSONObject(resStr);
- // if (objPayload != null) {
- // JSONObject objTotal = objPayload.getJSONObject("payload");
- // if (objTotal != null) {
- // JSONObject obj = objTotal.getJSONObject("info");
- // // JSONArray objRelative = objTotal.getJSONArray("relative");
- // if (obj != null) {
- // newfeed.category = obj.getString("category");
- // newfeed.daodien = obj.getString("daodien");
- // newfeed.diemimdb = obj.getString("diemimdb");
- // newfeed.dienvienchinh = obj.getString("dienvienchinh");
- // newfeed.filmDesc = obj.getString("filmDesc");
- // newfeed.hinhanh = obj.getString("hinhanh");
- // newfeed.id = obj.getString("id");
- // newfeed.imgFullURL = obj.getString("imgFullURL");
- // newfeed.kichban = obj.getString("kichban");
- // newfeed.name = obj.getString("name");
- // newfeed.ngayphathanh = obj.getString("ngayphathanh");
- // newfeed.phude = obj.getString("phude");
- // newfeed.quocgia = obj.getString("quocgia");
- // newfeed.suburi = obj.getString("suburi");
- // newfeed.theloai = obj.getString("theloai");
- // newfeed.thoiluong = obj.getString("thoiluong");
- // newfeed.uri = obj.getString("uri");
- // newfeed.views = obj.getString("views");
- //
- // return newfeed;
- // } else
- // return null;
- // } else
- // return null;
- // }
- //
- // else
- // return null;
- // }
- public String saveSubToSdCard(final Context mContext, final String content,
- final String nameSub) {
- String pathSub = "-1";
- // new Handler().postDelayed(new Runnable() {
- //
- // @Override
- // public void run() {
- // // TODO Auto-generated method stub
- try {
- // MyLog.E("MediaType>>>>>" + content + ">>>>");
- File wallpaperDirectory;// = new
- // File(Environment.getExternalStorageDirectory().getAbsolutePath()+
- // "/JQK_PHOTO/");
- Boolean isSDPresent = android.os.Environment
- .getExternalStorageState().equals(
- android.os.Environment.MEDIA_MOUNTED);
- if (isSDPresent) {
- wallpaperDirectory = new File(Environment
- .getExternalStorageDirectory().getAbsolutePath()
- + "/SPHIM/");
- } else {
- File mydir = mContext.getDir("SPHIM", Context.MODE_PRIVATE);
- wallpaperDirectory = new File(mydir, "");
- }
- wallpaperDirectory.mkdirs();
- String file = wallpaperDirectory.getPath() + "/" + "subviet"
- + nameSub.hashCode() + ".srt";
- MyLog.E(file.toString() + ">>>file save");
- File testImageOnSdCard = new File(file);
- FileOutputStream fos = new FileOutputStream(testImageOnSdCard);
- // OutputStreamWriter osw = new OutputStreamWriter(fos,"UTF-16");
- OutputStreamWriter osw = new OutputStreamWriter(fos);
- // ---write the string to the file---
- osw.write(content);
- osw.flush();
- osw.close();
- pathSub = file.toString();
- // ---display file saved message---
- // Toast.makeText(mContext, "Load sub successfully!",
- // Toast.LENGTH_SHORT).show();
- } catch (IOException e) {
- MyLog.E("Can't copy test image onto SD card");
- pathSub = "-1";
- }
- //
- // }
- // }, 100);
- return pathSub;
- }
- // MD5 string
- public char[] hextable = { '0', '1', '2', '3', '4', '5', '6', '7',
- '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
- // public static Boolean done;
- public String md5(String s) {
- MessageDigest digest;
- try {
- digest = MessageDigest.getInstance("MD5");
- digest.update(s.getBytes(), 0, s.length());
- byte[] bytes = digest.digest();
- String hash = "";
- for (int i = 0; i < bytes.length; ++i) {
- int di = (bytes[i] + 256) & 0xFF;
- hash = hash + hextable[(di >> 4) & 0xF] + hextable[di & 0xF];
- }
- return hash;
- } catch (NoSuchAlgorithmException e) {
- }
- return "";
- }
- public String getDeviceId(Context paramContext) {
- String str;
- str = Secure.getString(paramContext.getContentResolver(),
- Secure.ANDROID_ID);
- // TelephonyManager TelephonyMgr = (TelephonyManager)
- // paramContext.getSystemService(paramContext.TELEPHONY_SERVICE);
- // DEVICE_ID = TelephonyMgr.getDeviceId();
- if ("9774d56d682e549c".equals(str))
- str = ((TelephonyManager) paramContext.getSystemService("phone"))
- .getDeviceId();
- if (str == null)
- str = (Build.VERSION.RELEASE + "_" + Build.MANUFACTURER)
- .replaceAll("[ \\?&=]", "");
- return str;
- }
- // public static String getAuthParam(Context paramContext) {
- // Object[] arrayOfObject = new Object[3];
- // arrayOfObject[0] = paramContext.getString(2131492878);
- // arrayOfObject[1] = getDeviceId(paramContext);
- // arrayOfObject[2] = getToken(paramContext);
- // return String.format("os=%s&clid=%s&t=%s", arrayOfObject);
- // }
- public String getToken(Context paramContext) {
- String str;
- String os = "a";
- char key[] = { 'r', 'c', 's', 's' };
- String device = getDeviceId(paramContext);
- str = md5(String.format("%s_%s_%s", os, String.valueOf(key), device));
- return str;
- }
- public String getToken(Context paramContext, String deviceid) {
- String str;
- String os = "a";
- char key[] = { 'r', 'c', 's', 's' };
- // String device = getDeviceId(paramContext);
- str = md5(String.format("%s_%s_%s", os, String.valueOf(key), deviceid));
- return str;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment