Java Challenge 2021

Multi function video downloader java growth mission

I construct this utility in java for my school submision mission.


There may be solely java programe code i will provide you with android utility supply code within the submit finish.

On this peoject i’ve many folder however i offer you solely java code under right here.


Challenge Construction


  • All in One Video Downloader
    • .thought
    • app
    • libs
    • src
    • appupdater
    • construct
    • gradle
    • androidTest
    • important
    • property
    • java
      • com
      • flowincode
      • allinonevideodownloader
        • adapters
        • extraFeatures
        • facebookstorysaver
        • fragments
        • inappbilling
        • Interface
        • fashions
        • reciver
        • restapiclientsstuff
        • service
        • statussaver
        • duties
        • tiktok_methods
        • utils

We used Kotlin (.kt) Language for Important Exercise

MainActivity.kt


@file:Suppress("DEPRECATION")

package deal com.infusiblecoder.allinonevideodownloader

import android.app.AlertDialog
import android.app.Dialog
import android.app.ProgressDialog
import android.content material.Context
import android.content material.Intent
import android.content material.SharedPreferences
import android.content material.pm.PackageManager
import android.graphics.Typeface
import android.internet.Uri
import android.os.Construct
import android.os.Bundle
import android.util.Log
import android.view.*
import android.widget.Button
import android.widget.LinearLayout
import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.core.app.ActivityCompat
import androidx.core.content material.ContextCompat
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
import androidx.viewpager.widget.ViewPager
import com.android.billingclient.api.*
import com.android.billingclient.api.BillingClient.BillingResponseCode
import com.github.javiersantos.appupdater.AppUpdaterUtils
import com.github.javiersantos.appupdater.enums.AppUpdaterError
import com.google.android.gms.advertisements.MobileAds
import com.google.android.materials.tabs.TabLayout
import com.infusiblecoder.allinonevideodownloader.extraFeatures.ExtraFeaturesFragment
import com.infusiblecoder.allinonevideodownloader.fragments.obtain
import com.infusiblecoder.allinonevideodownloader.statussaver.StatusSaverMainFragment
import com.infusiblecoder.allinonevideodownloader.duties.downloadVideo
import com.infusiblecoder.allinonevideodownloader.utils.AdsManager
import com.infusiblecoder.allinonevideodownloader.utils.Constants
import com.infusiblecoder.allinonevideodownloader.utils.LocaleHelper
import com.infusiblecoder.allinonevideodownloader.utils.SharedPrefsForInstagram.context
import com.infusiblecoder.allinonevideodownloader.utils.iUtils
import com.infusiblecoder.allinonevideodownloader.utils.iUtils.writeUpdateLogFile
import com.ironsource.mediationsdk.IronSource
import ir.heydarii.appupdater.AppUpdaterDialog
import ir.heydarii.appupdater.pojo.Retailer
import ir.heydarii.appupdater.pojo.UpdaterStoreList
import java.util.*


@Suppress("DEPRECATION")
class MainActivity : AppCompatActivity() {

var myString: String? = ""
val REQUEST_PERMISSION_CODE = 1001
val REQUEST_PERMISSION = android.Manifest.permission.WRITE_EXTERNAL_STORAGE
non-public var tabLayout: TabLayout? = null
var viewPager: ViewPager? = null
var fbAdView: com.fb.advertisements.AdView? = null
lateinit var progressDralogGenaratinglink: ProgressDialog


non-public var billingClient: BillingClient? = null
non-public var skuDetails: SkuDetails? = null


override enjoyable onCreate(savedInstanceState: Bundle?) {
tremendous.onCreate(savedInstanceState)
requestWindowFeature(Window.FEATURE_NO_TITLE)
window.setFlags(
WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN
)

setContentView(R.format.activity_main)
MobileAds.initialize(this)


// setupBillingClient()
IronSource.init(
this,
sources.getString(R.string.ironsource_app_id),
IronSource.AD_UNIT.INTERSTITIAL
)


setUpBillingClient1()
//0,2

progressDralogGenaratinglink = ProgressDialog(this)
progressDralogGenaratinglink.setMessage(sources.getString(R.string.genarating_download_link))
progressDralogGenaratinglink.setCancelable(false)


val adContainer = findViewById(R.id.banner_container)


val random = Random()
var num = random.nextInt(2)

Log.e("myhdasbdhf ", num.toString())


// Get intent, motion and MIME sort

val motion = intent.motion
var sort = intent.sort

if (Intent.ACTION_SEND == motion && sort != null) {
if ("textual content/plain" == sort) {
handleSendText(intent) // Deal with textual content being despatched


}
}


// val isAvailable = BillingProcessor.isIabServiceAvailable(this)
// if (!isAvailable) {
// Toast.makeText(this, "Billing Service Not Avaliable", Toast.LENGTH_SHORT).present()
// }



if (Constants.show_Ads) {

val prefs: SharedPreferences = getSharedPreferences(
"whatsapp_pref",
Context.MODE_PRIVATE
)

val pp =
prefs.getString("inappads", "nnn") //"No identify outlined" is the default worth.


if (pp.equals("nnn")) {


AdsManager.loadBannerAd(this, adContainer)

} else {
adContainer.visibility = View.GONE
}
}







if (!isNeedGrantPermission()) {
setlayout()
}


}



enjoyable getMyData(): String? {
return myString
}


enjoyable setmydata(mysa: String) {
this.myString = mysa
}


override enjoyable onStart() {
tremendous.onStart()

strive {
if (iUtils.isNetworkConnected([email protected])) {

val appUpdaterUtils: AppUpdaterUtils = AppUpdaterUtils(this)
.withListener(object : AppUpdaterUtils.UpdateListener {
override enjoyable onSuccess(
replace: com.github.javiersantos.appupdater.objects.Replace?,
isUpdateAvailable: Boolean?
) {

println("appupdater error bb " + isUpdateAvailable)
println("appupdater error uuu " + replace!!.latestVersion)

if (isUpdateAvailable!!) {

if (Construct.VERSION.SDK_INT >= 30 && !iUtils.checkUpdateLogFileIfExists()) {

launchUpdateDialogAndroid11()


} else {
launchUpdateDialog(replace.latestVersion)

}


} else {
if (Construct.VERSION.SDK_INT >= 30 && !iUtils.checkUpdateLogFileIfExists()) {

launchUpdateDialogAndroid11()


}
}


}

override enjoyable onFailed(error: AppUpdaterError?) {


}


})
appUpdaterUtils.begin()


}
} catch (e: Exception) {

}


}


non-public enjoyable launchUpdateDialog(onlineVersion: String) {
strive {
AlertDialog.Builder(context)
.setTitle(getString(R.string.updqteavaliable))
.setCancelable(false)
.setMessage(
getString(R.string.replace) + " " + onlineVersion + " " + getString(R.string.updateisavaliabledownload) + getString(
R.string.app_name
)
)
.setPositiveButton(
sources.getString(R.string.update_now)
)
{ dialog, _ ->
dialog.dismiss()
// startActivity(
// Intent(
// Intent.ACTION_VIEW,
// Uri.parse("https://play.google.com/retailer/apps/particulars?id=$packageName")
// )
// )

strive {
val listing = ArrayList()
val typeface = Typeface.createFromAsset(property, "sintony-regular.otf")
//Todo remark the under line if you wish to replace apk from outdoors the playstore
listing.add(
UpdaterStoreList(
Retailer.DIRECT_URL,
getString(R.string.clicktodownload),
R.drawable.ic_appicon,
Constants.App_Extrnal_Download_Url,
BuildConfig.APPLICATION_ID
)
)


//Todo uncomment the under line if you wish to replace apk from the playstore

// listing.add(UpdaterStoreList(Retailer.GOOGLE_PLAY, "Obtain From Google Play", packageName = BuildConfig.APPLICATION_ID))

AppUpdaterDialog
.getInstance(
getString(R.string.updqteavaliable),
getString(R.string.replace) + " " + onlineVersion + " " + getString(R.string.updateisavaliabledownload),
listing,
true,
typeface
)
.present(supportFragmentManager, "TAG")
} catch (e: Exception) {

}

}.setNegativeButton(
sources.getString(R.string.cancel)
)
{ dialog, _ ->
dialog.dismiss()

}
.setIcon(R.drawable.ic_appicon)
.present()

} catch (e: java.lang.Exception) {

println("appupdater error rrrr " + e)
e.printStackTrace()
}
}


non-public enjoyable launchUpdateDialogAndroid11() {
strive {
AlertDialog.Builder(context)
.setTitle(getString(R.string.updqteavaliable))
.setCancelable(false)
.setMessage(
getString(R.string.android11usermessage)
)

.setPositiveButton(
sources.getString(R.string.update_now)
)
{ dialog, _ ->
dialog.dismiss()
strive {


val listing = ArrayList()
val typeface = Typeface.createFromAsset(property, "sintony-regular.otf")
listing.add(
UpdaterStoreList(
Retailer.DIRECT_URL,
getString(R.string.clicktodownload),
R.drawable.ic_appicon,
Constants.App_Extrnal_Download_Url,
BuildConfig.APPLICATION_ID
)
)
AppUpdaterDialog
.getInstance(
getString(R.string.updqteavaliable),
"",
listing,
true,
typeface
)
.present(supportFragmentManager, "TAG")


writeUpdateLogFile();

} catch (e: Exception) {

}

}.setNegativeButton(
sources.getString(R.string.cancel)
)
{ dialog, _ ->
dialog.dismiss()

}
.setIcon(R.drawable.ic_appicon)
.present()

} catch (e: java.lang.Exception) {

println("appupdater error rrrr " + e)
e.printStackTrace()
}
}


enjoyable handleSendText(intent: Intent) {

strive {

this.intent = null
var url = intent.getStringExtra(Intent.EXTRA_TEXT)



if (url.equals("") && iUtils.checkURL(url)) {
iUtils.ShowToast(
[email protected],
[email protected]?.getString(R.string.enter_valid)
)
return

}

if (url?.comprises("myjosh.in")!!) {


Log.e("downloadFileName", url.substring(url.indexOf("http")) + "")

url = url.substring(url.indexOf("http"))
url = url.substring(
url.indexOf("http://share.myjosh.in/"),
url.indexOf("Obtain Josh for extra movies like this!")
)


downloadVideo.Begin(this, url.trim(), false)
Log.e("downloadFileName12", url.trim())


} else if (url.comprises("chingari")) {


url = url.substring(
url.indexOf("https://chingari.io/"),
url.indexOf("For extra such entertaining")
)


downloadVideo.Begin(this, url.trim(), false)
Log.e("downloadFileName12", url.trim())
} else if (url.comprises("bemate")) {


url = url.substring(
url.indexOf("https"),
url.size
)


downloadVideo.Begin(this, url.trim(), false)
Log.e("downloadFileName12", url.trim())
} else if (url.comprises("instagram.com")) {


val bundle = Bundle()
bundle.putString("myinstaurl", url)
val fragobj = obtain()
fragobj.arguments = bundle

this.setmydata(url)


Log.e("downloadFileName12", url)
} else if (url.comprises("sck.io") || url.comprises("snackvideo")) {
var myurl = url

strive {
if (myurl.size > 30) {
myurl = myurl.substring(
myurl.indexOf("http"),
myurl.indexOf("Click on this")
)
}
} catch (e: Exception) {

}

downloadVideo.Begin(this, myurl?.trim(), false)
Log.e("downloadFileName12", myurl!!.toString())
} else {
url = url.substring(
url.indexOf("https"),
url.size
)


// downloadVideo.Begin(this, url.trim() ?: url, false)

val myurl = url
url = ""
val bundle = Bundle()
bundle.putString("myinstaurl", myurl)
val fragobj = obtain()
fragobj.arguments = bundle

this.setmydata(myurl)


// Log.e("downloadFileName12", url)
//
//
// Log.e("downloadFileName", (url.substring(url.indexOf("http")).trim() ?: url) + "")
}
} catch (e: Exception) {

}
}


enjoyable setlayout() {
viewPager = findViewById(R.id.viewpager)
setupViewPager(viewPager!!)

tabLayout = findViewById(R.id.tabs)
tabLayout!!.setupWithViewPager(viewPager)
setupTabIcons()


}

enjoyable setupTabIcons() {
tabLayout?.getTabAt(0)?.setIcon(R.drawable.ic_download_color_24dp)
// tabLayout?.getTabAt(1)?.setIcon(R.drawable.ic_gallery_color_24dp)
tabLayout?.getTabAt(1)?.setIcon(R.drawable.statuspic)
tabLayout?.getTabAt(2)?.setIcon(R.drawable.ic_puzzle)

}


non-public enjoyable setupViewPager(viewPager: ViewPager) {
val adapter = ViewPagerAdapter(supportFragmentManager)
adapter.addFragment(obtain(), getString(R.string.download_fragment))
// adapter.addFragment(DummyFragment(), getString(R.string.gallery_fragment))
adapter.addFragment(StatusSaverMainFragment(), getString(R.string.StatusSaver))
adapter.addFragment(ExtraFeaturesFragment(), getString(R.string.extrafeatures))
viewPager.adapter = adapter
}

non-public enjoyable isNeedGrantPermission(): Boolean {
strive {
if (iUtils.hasMarsallow()) {
if (ContextCompat.checkSelfPermission(
this,
REQUEST_PERMISSION
) != PackageManager.PERMISSION_GRANTED
) {
if (ActivityCompat.shouldShowRequestPermissionRationale(
[email protected],
REQUEST_PERMISSION
)
) {
val msg =
String.format(
getString(R.string.format_request_permision),
getString(R.string.app_name)
)

val localBuilder = AlertDialog.Builder([email protected])
localBuilder.setTitle(getString(R.string.permission_title))
localBuilder
.setMessage(msg).setNeutralButton(
getString(R.string.grant_option)
) { _, _ ->
ActivityCompat.requestPermissions(
[email protected],
arrayOf(REQUEST_PERMISSION),
REQUEST_PERMISSION_CODE
)
}
.setNegativeButton(
getString(R.string.cancel_option)
) { paramAnonymousDialogInterface, _ ->
paramAnonymousDialogInterface.dismiss()
end()
}
localBuilder.present()

} else {
ActivityCompat.requestPermissions(
this,
arrayOf(REQUEST_PERMISSION),
REQUEST_PERMISSION_CODE
)
}
return true
}
}
} catch (e: Exception) {
e.printStackTrace()
}

return false

}

override enjoyable onRequestPermissionsResult(
requestCode: Int,
permissions: Array,
grantResults: IntArray
) {
tremendous.onRequestPermissionsResult(requestCode, permissions, grantResults)
strive {
if (requestCode == REQUEST_PERMISSION_CODE) {
if (grantResults != null && grantResults.dimension > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
//
setlayout()
} else {
iUtils.ShowToast([email protected], getString(R.string.info_permission_denied))

end()
}
}
} catch (e: Exception) {
e.printStackTrace()
iUtils.ShowToast([email protected], getString(R.string.info_permission_denied))
end()
}

}

inner inside class ViewPagerAdapter(supervisor: FragmentManager) :
FragmentPagerAdapter(supervisor) {
non-public val mFragmentList = ArrayList()
non-public val mFragmentTitleList = ArrayList()

override enjoyable getItem(place: Int): Fragment {

return mFragmentList[position]

}

override enjoyable getCount(): Int {
return mFragmentList.dimension
}

enjoyable addFragment(fragment: Fragment, title: String) {
mFragmentList.add(fragment)
mFragmentTitleList.add(title)
}

override enjoyable getPageTitle(place: Int): CharSequence {
return mFragmentTitleList[position]
}
}

override enjoyable onCreateOptionsMenu(menu: Menu): Boolean {
// Inflate the menu; this provides objects to the motion bar whether it is current.


menuInflater.inflate(R.menu.important, menu)

val prefs: SharedPreferences = getSharedPreferences(
"whatsapp_pref",
Context.MODE_PRIVATE
)
val identify = prefs.getString("whatsapp", "important") //"No identify outlined" is the default worth.
val pp = prefs.getString("inappads", "nnn") //"No identify outlined" is the default worth.

//
// if (identify == "important") {
// menu.findItem(R.id.action_shwbusinesswhatsapp).isVisible = true
//
// menu.findItem(R.id.action_shwmainwhatsapp).isVisible = false
//
// } else if (identify == "bus") {
// menu.findItem(R.id.action_shwbusinesswhatsapp).isVisible = false
//
// menu.findItem(R.id.action_shwmainwhatsapp).isVisible = true
//
// }


if (pp.equals("nnn")) {

menu.findItem(R.id.action_removeads).isVisible = true

} else if (pp.equals("ppp")) {

menu.findItem(R.id.action_removeads).isVisible = false

}



return true
}

override enjoyable onOptionsItemSelected(merchandise: MenuItem): Boolean {
return when (merchandise.itemId) {

R.id.action_privacy -> {

// AlertDialog.Builder(this)
// .setTitle(getString(R.string.privateness))
// .setMessage(R.string.privacy_message)
// .setPositiveButton(
// android.R.string.sure
// ) { dialog, _ -> dialog.dismiss() }
// .setIcon(R.drawable.ic_info_black_24dp)
// .present()

val browserIntent =
Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.privacy_policy_url)))
startActivity(browserIntent)

true
}

R.id.action_downloadtiktok -> {

val intent = Intent(this, TikTokDownloadWebview::class.java)
startActivity(intent)


true
}


R.id.action_rate -> {


AlertDialog.Builder(this)
.setTitle(getString(R.string.RateAppTitle))
.setMessage(getString(R.string.RateApp))
.setCancelable(false)
.setPositiveButton(
getString(R.string.rate_dialog)
) { _, _ ->
val appPackageName = packageName
strive {
startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse("market://particulars?id=$appPackageName")
)
)
} catch (anfe: android.content material.ActivityNotFoundException) {
startActivity(
Intent(
Intent.ACTION_VIEW,
Uri.parse("https://play.google.com/retailer/apps/particulars?id=$appPackageName")
)
)
}
}
.setNegativeButton(getString(R.string.later_btn), null).present()

true
}


R.id.ic_whatapp -> {

val launchIntent = packageManager.getLaunchIntentForPackage("com.whatsapp")
if (launchIntent != null) {

startActivity(launchIntent)
// end()
} else {

iUtils.ShowToast(
this,
this.sources.getString(R.string.appnotinstalled)
)
}
true
}


R.id.action_language -> {

val dialog = Dialog(this)
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
dialog.setCancelable(true)
dialog.setContentView(R.format.dialog_change_language)

val l_english = dialog.findViewById(R.id.l_english) as TextView
l_english.setOnClickListener {

LocaleHelper.setLocale(utility, "en")
window.decorView.layoutDirection = View.LAYOUT_DIRECTION_RTL


val editor: SharedPreferences.Editor = getSharedPreferences(
"lang_pref",
Context.MODE_PRIVATE
).edit()
editor.putString("lang", "en")

editor.apply()


recreate()
dialog.dismiss()
}

val l_arabic = dialog.findViewById(R.id.l_arabic) as TextView
l_arabic.setOnClickListener {
LocaleHelper.setLocale(utility, "ar")
window.decorView.layoutDirection = View.LAYOUT_DIRECTION_LTR

val editor: SharedPreferences.Editor = getSharedPreferences(
"lang_pref",
Context.MODE_PRIVATE
).edit()
editor.putString("lang", "ar")

editor.apply()


recreate()
dialog.dismiss()

}
val l_urdu = dialog.findViewById(R.id.l_urdu) as TextView
l_urdu.setOnClickListener {
LocaleHelper.setLocale(utility, "ur")
window.decorView.layoutDirection = View.LAYOUT_DIRECTION_LTR


val editor: SharedPreferences.Editor = getSharedPreferences(
"lang_pref",
Context.MODE_PRIVATE
).edit()
editor.putString("lang", "ur")

editor.apply()


recreate()
dialog.dismiss()
}


val l_german = dialog.findViewById(R.id.l_german) as TextView
l_german.setOnClickListener {
LocaleHelper.setLocale(utility, "de")
window.decorView.layoutDirection = View.LAYOUT_DIRECTION_RTL
val editor: SharedPreferences.Editor = getSharedPreferences(
"lang_pref",
Context.MODE_PRIVATE
).edit()
editor.putString("lang", "de")

editor.apply()


recreate()
dialog.dismiss()
}


val l_turkey = dialog.findViewById(R.id.l_turkey) as TextView
l_turkey.setOnClickListener {
LocaleHelper.setLocale(utility, "tr")
window.decorView.layoutDirection = View.LAYOUT_DIRECTION_RTL
val editor: SharedPreferences.Editor = getSharedPreferences(
"lang_pref",
Context.MODE_PRIVATE
).edit()
editor.putString("lang", "tr")

editor.apply()


recreate()
dialog.dismiss()
}


val l_portougese = dialog.findViewById(R.id.l_portougese) as TextView
l_portougese.setOnClickListener {
LocaleHelper.setLocale(utility, "pt")
window.decorView.layoutDirection = View.LAYOUT_DIRECTION_RTL
val editor: SharedPreferences.Editor = getSharedPreferences(
"lang_pref",
Context.MODE_PRIVATE
).edit()
editor.putString("lang", "pt")

editor.apply()


recreate()
dialog.dismiss()
}


val l_chinese = dialog.findViewById(R.id.l_chinese) as TextView
l_chinese.setOnClickListener {
LocaleHelper.setLocale(utility, "zh")
window.decorView.layoutDirection = View.LAYOUT_DIRECTION_RTL
val editor: SharedPreferences.Editor = getSharedPreferences(
"lang_pref",
Context.MODE_PRIVATE
).edit()
editor.putString("lang", "zh")

editor.apply()


recreate()
dialog.dismiss()
}


val l_hindi = dialog.findViewById(R.id.l_hindi) as TextView
l_hindi.setOnClickListener {
LocaleHelper.setLocale(utility, "hello")
window.decorView.layoutDirection = View.LAYOUT_DIRECTION_RTL
val editor: SharedPreferences.Editor = getSharedPreferences(
"lang_pref",
Context.MODE_PRIVATE
).edit()
editor.putString("lang", "hello")

editor.apply()


recreate()
dialog.dismiss()
}




dialog.present()

true
}

// R.id.action_shwbusinesswhatsapp -> {
//
//
// val editor: SharedPreferences.Editor = getSharedPreferences(
// "whatsapp_pref",
// Context.MODE_PRIVATE
// ).edit()
// editor.putString("whatsapp", "bus")
//
// editor.apply()
//
// if (Construct.VERSION.SDK_INT >= 11) {
// recreate()
// } else {
// val intent = intent
// intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION)
// end()
// overridePendingTransition(0, 0)
// startActivity(intent)
// overridePendingTransition(0, 0)
// }
//
//
//
// true
// }
//
//
// R.id.action_shwmainwhatsapp -> {
//
//
// val editor: SharedPreferences.Editor = getSharedPreferences(
// "whatsapp_pref",
// Context.MODE_PRIVATE
// ).edit()
// editor.putString("whatsapp", "important")
//
// editor.apply()
//
//
// if (Construct.VERSION.SDK_INT >= 11) {
// recreate()
// } else {
// val intent = intent
// intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION)
// end()
// overridePendingTransition(0, 0)
// startActivity(intent)
// overridePendingTransition(0, 0)
// }
//
//
//
// true
// }


R.id.action_removeads -> {


//TODO advertisements
// bp!!.buy([email protected] this, getString(R.string.productidcode));
// querySkuDetails()


skuDetails?.let {
val billingFlowParams = BillingFlowParams.newBuilder()
.setSkuDetails(it)
.construct()
billingClient?.launchBillingFlow(this, billingFlowParams)?.responseCode
} ?: noSKUMessage()



true
}


else -> tremendous.onOptionsItemSelected(merchandise)
}
}


override enjoyable onBackPressed() {

val dialog = Dialog(this)
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
dialog.setCancelable(false)
dialog.setContentView(R.format.custom_dialog_ad_exit)
val yesBtn = dialog.findViewById(R.id.btn_exitdialog_yes) as Button
val noBtn = dialog.findViewById(R.id.btn_exitdialog_no) as Button

//TODO ENABLE EXIT DIALOG AD BY UNCOMMENTING IT
// val adviewnew = dialog.findViewById(R.id.adView_dia) as AdView
// val adRequest = AdRequest.Builder().construct()
// adviewnew.loadAd(adRequest)


yesBtn.setOnClickListener {
System.exit(0)
}
noBtn.setOnClickListener { dialog.dismiss() }
dialog.present()

}


override enjoyable onActivityResult(requestCode: Int, resultCode: Int, information: Intent?) {
tremendous.onActivityResult(requestCode, resultCode, information)
println("proddddd11111222 $resultCode __" + information)

if (requestCode == 200 && resultCode == RESULT_OK) {

println("proddddd11111 $resultCode __" + information)

}
//
//
//
// if (!bp!!.handleActivityResult(requestCode, resultCode, information)) {
// tremendous.onActivityResult(requestCode, resultCode, information)
// }


strive {
} catch (ex: Exception) {
ex.printStackTrace()
}
}


non-public enjoyable noSKUMessage() {
Toast.makeText(
[email protected], "No SKU Discovered", Toast.LENGTH_SHORT
).present()

}

non-public enjoyable setUpBillingClient1() {
billingClient = BillingClient.newBuilder(this)
.setListener(purchaseUpdateListener)
.enablePendingPurchases()
.construct()


startConnection()
}

non-public enjoyable startConnection() {
billingClient?.startConnection(object : BillingClientStateListener {
override enjoyable onBillingSetupFinished(billingResult: BillingResult) {
if (billingResult.responseCode == BillingClient.BillingResponseCode.OK) {
// The BillingClient is prepared. You'll be able to question purchases right here.
Log.v("TAG_INAPP", "Setup Billing Executed")
queryAvaliableProducts()
}
}

override enjoyable onBillingServiceDisconnected() {
// Attempt to restart the connection on the subsequent request to
// Google Play by calling the startConnection() methodology.
}
})
}

non-public enjoyable queryAvaliableProducts() {
val skuList = ArrayList()
skuList.add(getString(R.string.productidcode))
val params = SkuDetailsParams.newBuilder()
params.setSkusList(skuList).setType(BillingClient.SkuType.INAPP)

billingClient?.querySkuDetailsAsync(params.construct()) { billingResult, skuDetailsList ->
// Course of the consequence.
if (billingResult.responseCode == BillingClient.BillingResponseCode.OK && !skuDetailsList.isNullOrEmpty()) {
for (skuDetails in skuDetailsList) {
Log.v("TAG_INAPP", "skuDetailsList : ${skuDetailsList}")
//This listing ought to comprise the merchandise added above
updateUI(skuDetails)
}
}
}
}

non-public enjoyable updateUI(skuDetails: SkuDetails?) {
skuDetails?.let {
this.skuDetails = it
// txt_product_name?.textual content = skuDetails.title
// txt_product_description?.textual content = skuDetails.description
showUIElements()
}
}

non-public enjoyable showUIElements() {
// txt_product_name?.visibility = View.VISIBLE
// txt_product_description?.visibility = View.VISIBLE
// txt_product_buy?.visibility = View.VISIBLE
}

non-public val purchaseUpdateListener =
PurchasesUpdatedListener { billingResult, purchases ->
Log.v("TAG_INAPP", "billingResult responseCode : ${billingResult.responseCode}")

if (billingResult.responseCode == BillingResponseCode.OK && purchases != null) {
for (buy in purchases) {
// handlePurchase(buy)


//handleConsumedPurchases(buy)

handleNonConcumablePurchase(buy)
}
} else if (billingResult.responseCode == BillingResponseCode.USER_CANCELED) {
// Deal with an error attributable to a consumer cancelling the acquisition movement.
} else if (billingResult.responseCode == BillingResponseCode.ITEM_UNAVAILABLE) {
Toast.makeText(
[email protected], "ITEM_UNAVAILABLE", Toast.LENGTH_SHORT
).present()
} else if (billingResult.responseCode == BillingResponseCode.ITEM_ALREADY_OWNED) {


AlertDialog.Builder(context)
.setTitle(getString(R.string.itemowned))
.setMessage(getString(R.string.adsareremoved))
.setIcon(R.drawable.ic_appicon)
.present()


Toast.makeText(
[email protected], getString(R.string.itemowned), Toast.LENGTH_SHORT
).present()

val editor: SharedPreferences.Editor = getSharedPreferences(
"whatsapp_pref",
Context.MODE_PRIVATE
).edit()
editor.putString("inappads", "ppp")

editor.apply()
} else {

Toast.makeText(
[email protected], "Error has occured", Toast.LENGTH_SHORT
).present()

}
}

non-public enjoyable handleConsumedPurchases(buy: Buy) {
Log.d("TAG_INAPP", "handleConsumablePurchasesAsync foreach it's $buy")


if (buy.skus.equals(getString(R.string.productidcode))) {

val params =
ConsumeParams.newBuilder().setPurchaseToken(buy.purchaseToken).construct()
billingClient?.consumeAsync(params) { billingResult, _ ->
when (billingResult.responseCode) {
BillingClient.BillingResponseCode.OK -> {

AlertDialog.Builder(context)
.setTitle(getString(R.string.purchasedone))
.setMessage(getString(R.string.adsareremoved))
.setIcon(R.drawable.ic_appicon)
.present()

Toast.makeText(
[email protected], getString(R.string.purchasedone), Toast.LENGTH_SHORT
).present()

val editor: SharedPreferences.Editor = getSharedPreferences(
"whatsapp_pref",
Context.MODE_PRIVATE
).edit()
editor.putString("inappads", "ppp")

editor.apply()

// Replace the suitable tables/databases to grant consumer the objects
Log.d(
"TAG_INAPP",
" Replace the suitable tables/databases to grant consumer the objects"
)
}
else -> {
Log.w("TAG_INAPP", billingResult.debugMessage)
}
}
}


}


}

non-public enjoyable handleNonConcumablePurchase(buy: Buy) {
Log.v("TAG_INAPP", "handlePurchase : ${buy}")

if (buy.skus.equals(getString(R.string.productidcode))) {


if (buy.purchaseState == Buy.PurchaseState.PURCHASED) {
if (!buy.isAcknowledged) {
val acknowledgePurchaseParams = AcknowledgePurchaseParams.newBuilder()
.setPurchaseToken(buy.purchaseToken).construct()
billingClient?.acknowledgePurchase(acknowledgePurchaseParams) { billingResult ->
val billingResponseCode = billingResult.responseCode
val billingDebugMessage = billingResult.debugMessage

Log.v("TAG_INAPP", "response code: $billingResponseCode")
Log.v("TAG_INAPP", "debugMessage : $billingDebugMessage")
AlertDialog.Builder(context)
.setTitle(getString(R.string.purchasedone))
.setMessage(getString(R.string.adsareremoved))
.setIcon(R.drawable.ic_appicon)
.present()

Toast.makeText(
[email protected], getString(R.string.purchasedone), Toast.LENGTH_SHORT
).present()

val editor: SharedPreferences.Editor = getSharedPreferences(
"whatsapp_pref",
Context.MODE_PRIVATE
).edit()
editor.putString("inappads", "ppp")

editor.apply()

}
}
}
}
}


override enjoyable attachBaseContext(base: Context) {
tremendous.attachBaseContext(LocaleHelper.onAttach(base))
}


}


AllSupportedApps.java


package deal com.infusiblecoder.allinonevideodownloader;

import android.content material.Context;
import android.os.Construct;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.bumptech.glide.Glide;
import com.infusiblecoder.allinonevideodownloader.databinding.ActivityAllSupportedBinding;
import com.infusiblecoder.allinonevideodownloader.fashions.RecDisplayAllWebsites_Model;
import com.infusiblecoder.allinonevideodownloader.utils.Constants;
import com.infusiblecoder.allinonevideodownloader.utils.LocaleHelper;

import org.json.JSONArray;
import org.json.JSONObject;

import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;

public class AllSupportedApps extends AppCompatActivity {

ArrayList recDisplayAllWebsitesModelArrayList;
ArrayList recDisplayAllWebsitesModelArrayList_otherwebsites;
non-public ActivityAllSupportedBinding binding;


@RequiresApi(api = Construct.VERSION_CODES.KITKAT)
@Override
protected void onCreate(Bundle savedInstanceState) {
tremendous.onCreate(savedInstanceState);
binding = ActivityAllSupportedBinding.inflate(getLayoutInflater());
View view = binding.getRoot();
setContentView(view);

getSupportActionBar().setTitle(getResources().getString(R.string.listandstatus));
recDisplayAllWebsitesModelArrayList = new ArrayList<>();
recDisplayAllWebsitesModelArrayList_otherwebsites = new ArrayList<>();


strive {
JSONArray jsonArray = new JSONArray(loadWebsiteJSONFromAsset());

for (int i = 0; i < jsonArray.size(); i++) {

JSONObject jsonObjectdata = jsonArray.getJSONObject(i);


System.out.println("dsakdjasdjasd " + jsonObjectdata.getString("website_name"));


if (i < 8) {

if (!Constants.showyoutube && jsonObjectdata.getString("website_name").comprises("Youtube")) {
proceed;
}

// if (!Constants.showyoutube) {
// proceed;
//// break;
//
// }
recDisplayAllWebsitesModelArrayList
.add(new RecDisplayAllWebsites_Model(jsonObjectdata.getString("website_pic_url"), jsonObjectdata.getString("website_name"), jsonObjectdata.getString("website_status"), jsonObjectdata.getString("show_status")));


} else {

recDisplayAllWebsitesModelArrayList_otherwebsites
.add(new RecDisplayAllWebsites_Model(jsonObjectdata.getString("website_pic_url"), jsonObjectdata.getString("website_name"), jsonObjectdata.getString("website_status"), jsonObjectdata.getString("show_status")));
}

//}


}


} catch (Exception e) {
System.out.println("dsakdjasdjasd " + e.getMessage());
}


RecDisplayAllWebsitesAdapter recDisplayAllWebsitesAdapter = new RecDisplayAllWebsitesAdapter(this, recDisplayAllWebsitesModelArrayList);

binding.recviewSocialnetwork.setAdapter(recDisplayAllWebsitesAdapter);
binding.recviewSocialnetwork.setLayoutManager(new GridLayoutManager(this, 4));


RecDisplayAllWebsitesAdapter recDisplayAllWebsitesAdapter_otherwesites = new RecDisplayAllWebsitesAdapter(this, recDisplayAllWebsitesModelArrayList_otherwebsites);

binding.recviewOthernetwork.setAdapter(recDisplayAllWebsitesAdapter_otherwesites);
binding.recviewOthernetwork.setLayoutManager(new GridLayoutManager(this, 4));


}


@RequiresApi(api = Construct.VERSION_CODES.KITKAT)
public String loadWebsiteJSONFromAsset() {
String json = null;
strive {
InputStream is = getAssets().open("supported_websites.json");
int dimension = is.out there();
byte[] buffer = new byte[size];
is.learn(buffer);
is.shut();
json = new String(buffer, StandardCharsets.UTF_8);
} catch (IOException ex) {
ex.printStackTrace();
return null;
}
return json;
}


class RecDisplayAllWebsitesAdapter extends RecyclerView.Adapter {

Context context;
ArrayList recDisplayAllWebsitesModelArrayList;

public RecDisplayAllWebsitesAdapter(Context context, ArrayList recDisplayAllWebsitesModelArrayList) {
this.context = context;
this.recDisplayAllWebsitesModelArrayList = recDisplayAllWebsitesModelArrayList;
}

@NonNull
@Override
public RecDisplayAllWebsitesViewHolder onCreateViewHolder(@NonNull ViewGroup mum or dad, int viewType) {
return new RecDisplayAllWebsitesViewHolder(LayoutInflater.from(context).inflate(R.format.recdisplayallwebsites_item, null, false));
}

@Override
public void onBindViewHolder(@NonNull RecDisplayAllWebsitesViewHolder holder, int place) {

if (recDisplayAllWebsitesModelArrayList.get(place).getWebsitesshowtatue().equals("true")) {
Glide.with(context)
.load(recDisplayAllWebsitesModelArrayList
.get(place)
.getWebsiteurl())
.into(holder.imgRecDisplayAllWebsites);

holder.txtviewRecDisplayAllWebsites.setText(recDisplayAllWebsitesModelArrayList.get(place).getWebsitename());

if (recDisplayAllWebsitesModelArrayList.get(place).getWebsitestatue().equals("false")) {
holder.statusimg.setVisibility(View.VISIBLE);
} else {
holder.statusimg.setVisibility(View.INVISIBLE);

}
}
}

@Override
public int getItemCount() {
return recDisplayAllWebsitesModelArrayList.dimension();
}

class RecDisplayAllWebsitesViewHolder extends RecyclerView.ViewHolder {

non-public ultimate ImageView imgRecDisplayAllWebsites;
non-public ultimate ImageView statusimg;
non-public ultimate TextView txtviewRecDisplayAllWebsites;

public RecDisplayAllWebsitesViewHolder(View view) {
tremendous(view);
imgRecDisplayAllWebsites = view.findViewById(R.id.img_RecDisplayAllWebsites);
txtviewRecDisplayAllWebsites = view.findViewById(R.id.txtview_RecDisplayAllWebsites);
statusimg = view.findViewById(R.id.statusimg);

}


}

}

@Override
protected void attachBaseContext(Context newBase) {
newBase = LocaleHelper.onAttach(newBase);
tremendous.attachBaseContext(newBase);
}
}


AppController.java


package deal com.infusiblecoder.allinonevideodownloader;

import android.app.Software;
import android.content material.Context;
import android.content material.SharedPreferences;
import android.content material.res.Configuration;

import androidx.multidex.MultiDexApplication;

import com.fb.advertisements.AudienceNetworkAds;
import com.google.android.gms.advertisements.MobileAds;
import com.google.android.gms.advertisements.initialization.InitializationStatus;
import com.google.android.gms.advertisements.initialization.OnInitializationCompleteListener;
import com.infusiblecoder.allinonevideodownloader.utils.AppOpenManager;
import com.infusiblecoder.allinonevideodownloader.utils.LocaleHelper;
import com.ironsource.mediationsdk.IronSource;
import com.onesignal.OneSignal;


import java.util.ArrayList;
import java.util.Listing;
import java.util.Locale;

public class Appcontroller extends MultiDexApplication {

AppOpenManager appOpenManager;

@Override
protected void attachBaseContext(Context base) {
tremendous.attachBaseContext(LocaleHelper.onAttach(base));
}


@Override
public void onCreate() {
tremendous.onCreate();

MobileAds.initialize(
this,
new OnInitializationCompleteListener() {
@Override
public void onInitializationComplete(InitializationStatus initializationStatus) {
}
});


appOpenManager = new AppOpenManager(this);


OneSignal.setLogLevel(OneSignal.LOG_LEVEL.VERBOSE, OneSignal.LOG_LEVEL.NONE);

// OneSignal Initialization
OneSignal.initWithContext(this);
OneSignal.setAppId(getString(R.string.onsignalappid));

AudienceNetworkAds.initialize(this);

SharedPreferences prefs = getSharedPreferences("lang_pref", MODE_PRIVATE);
// System.out.println("qqqqqqqqqqqqqqqqq = "+Locale.getDefault().getLanguage());

String lang = prefs.getString("lang", Locale.getDefault().getLanguage());//"No identify outlined" is the default worth.

//
// Listing locales = new ArrayList<>();
// locales.add(Locale.ENGLISH);
// locales.add(new Locale("ar", "ARABIC"));
// locales.add(new Locale("ur", "URDU"));
// locales.add(new Locale("tr", "Turkish"));
// locales.add(new Locale("hello", "Hindi"));
LocaleHelper.setLocale(getApplicationContext(), lang);

}
}


BulkDownloader_ProfileActivity.java


package deal com.infusiblecoder.allinonevideodownloader;

import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import androidx.annotation.Preserve;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.androidnetworking.AndroidNetworking;
import com.androidnetworking.frequent.Precedence;
import com.androidnetworking.error.ANError;
import com.androidnetworking.interfaces.JSONObjectRequestListener;
import com.bumptech.glide.Glide;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.infusiblecoder.allinonevideodownloader.adapters.ListAllProfilePostsInstagramUserAdapter;
import com.infusiblecoder.allinonevideodownloader.databinding.ActivityBulkDownloaderProfileBinding;
import com.infusiblecoder.allinonevideodownloader.fashions.bulkdownloader.EdgeInfo;
import com.infusiblecoder.allinonevideodownloader.fashions.bulkdownloader.UserProfileDataModelBottomPart;
import com.infusiblecoder.allinonevideodownloader.utils.SharedPrefsForInstagram;

import org.json.JSONObject;

import java.util.ArrayList;
import java.util.Listing;
import java.util.Map;

import static com.infusiblecoder.allinonevideodownloader.R.string.youneedloginfirest;

@Preserve
public class BulkDownloader_ProfileActivity extends AppCompatActivity {

non-public String myUserName;
non-public String myUserPKID;
non-public ActivityBulkDownloaderProfileBinding binding;
public static String INSTAGRAM_endcursorval = "";
non-public Listing storyModelInstaItemList;

ListAllProfilePostsInstagramUserAdapter listAllProfilePostsInstagramUserAdapter;

@Override
protected void onCreate(Bundle savedInstanceState) {
tremendous.onCreate(savedInstanceState);
binding = ActivityBulkDownloaderProfileBinding.inflate(getLayoutInflater());
View view = binding.getRoot();
setContentView(view);
storyModelInstaItemList = new ArrayList<>();


listAllProfilePostsInstagramUserAdapter = new ListAllProfilePostsInstagramUserAdapter(BulkDownloader_ProfileActivity.this, storyModelInstaItemList);
binding.recyclerviewProfileLong.setLayoutManager(new GridLayoutManager(BulkDownloader_ProfileActivity.this, 3));
binding.recyclerviewProfileLong.setAdapter(listAllProfilePostsInstagramUserAdapter);

if (getIntent() != null) {
myUserName = getIntent().getStringExtra("username");
myUserPKID = getIntent().getStringExtra("pkid");
loadAllprofileData(myUserName, myUserPKID);
}


binding.recyclerviewProfileLong.addOnScrollListener(new RecyclerView.OnScrollListener() {

@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
tremendous.onScrolled(recyclerView, dx, dy);

}

@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
tremendous.onScrollStateChanged(recyclerView, newState);

if (!recyclerView.canScrollVertically(1) && newState == RecyclerView.SCROLL_STATE_IDLE) {
binding.floatingloadmore.setVisibility(View.VISIBLE);

Toast.makeText(BulkDownloader_ProfileActivity.this, R.string.taptoloadmore, Toast.LENGTH_SHORT).present();

}
}
});


binding.floatingloadmore.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
binding.floatingloadmore.setVisibility(View.GONE);
loadAllPostsData();


}
});
}


void loadAllprofileData(String username, String pkid) {

SharedPrefsForInstagram sharedPrefsFor = new SharedPrefsForInstagram(BulkDownloader_ProfileActivity.this);
Map map = sharedPrefsFor.getPreference(SharedPrefsForInstagram.PREFERENCE);
if (map != null) {
String cookie = "ds_user_id=" + map.get(SharedPrefsForInstagram.PREFERENCE_USERID) + "; sessionid=" + map.get(SharedPrefsForInstagram.PREFERENCE_SESSIONID);


AndroidNetworking.get("https://www.instagram.com/{username}/?__a=1")
.addPathParameter("username", username)
.setPriority(Precedence.LOW)
.addHeaders("Cookie", cookie)
.addHeaders(
"Person-Agent",
""Instagram 9.5.2 (iPhone7,2; iPhone OS 9_3_3; en_US; en-US; scale=2.00; 750x1334) AppleWebKit/420+""
)
.construct()
.getAsJSONObject(new JSONObjectRequestListener() {
@Override
public void onResponse(JSONObject response) {

// binding.dfsadasdas.setText(response.toString());
System.out.println("hvjksdhfhdkd userpkid 00 " + pkid + " username " + username);
// System.out.println("hvjksdhfhdkd usernamedata click on idis" + response.toString());
//4162923872
//3401888503

strive {


JSONObject userdata = response.getJSONObject("graphql").getJSONObject("consumer");
binding.profileFollowersNumberTextview.setText(userdata.getJSONObject("edge_followed_by").getString("depend"));
binding.profileFollowingNumberTextview.setText(userdata.getJSONObject("edge_follow").getString("depend"));
binding.profilePostNumberTextview.setText(userdata.getJSONObject("edge_owner_to_timeline_media").getString("depend"));
binding.profileLongIdTextview.setText(userdata.getString("username"));
// ObjectMapper om = new ObjectMapper();
// UserProfileTopData root = om.readValue(response.toString(), UserProfileTopData.class);
// System.out.println("hvjksdhfhdkd adopted by " + root.getGraphql().getUser().getEdge_followed_by().getCount());

// binding.profileLongIdTextview.setText(root.getGraphql().getUser().getUsername());
// binding.profileFollowersNumberTextview.setText(root.getGraphql().getUser().getEdge_followed_by().getCount() + "");
// binding.profileFollowingNumberTextview.setText(root.getGraphql().getUser().getEdge_follow().getCount() + "");
// binding.profilePostNumberTextview.setText(root.getGraphql().getUser().getEdge_owner_to_timeline_media().getCount() + "");

if (userdata.getBoolean("is_verified")) {
binding.profileLongApprovedImageview.setVisibility(View.VISIBLE);
} else {
binding.profileLongApprovedImageview.setVisibility(View.GONE);

}

if (userdata.getBoolean("is_private")) {
binding.rowSearchPrivateImageviewPrivate.setVisibility(View.VISIBLE);
} else {
binding.rowSearchPrivateImageviewPrivate.setVisibility(View.GONE);

}

Glide.with(BulkDownloader_ProfileActivity.this).load(userdata.getString("profile_pic_url")).into(binding.profileLongCircle);

// System.out.println("hvjksdhfhdkd endcursoris= " + root.getLogging_page_id());
// System.out.println("hvjksdhfhdkd endcursoris img = " + root.getGraphql().getUser().getProfile_pic_url());


} catch (Exception e) {

System.out.println("hvjksdhfhdkd eeee errr 00 " + e.getMessage());


e.printStackTrace();
}


}

@Override
public void onError(ANError anError) {
System.out.println("hvjksdhfhdkd eeee" + anError.getResponse());

}
});
loadAllPostsData();


} else {
Toast.makeText(this, youneedloginfirest, Toast.LENGTH_LONG).present();
}


}


void loadAllPostsData() {
binding.profileLongProgress.setVisibility(View.VISIBLE);
SharedPrefsForInstagram sharedPrefsFor = new SharedPrefsForInstagram(BulkDownloader_ProfileActivity.this);
Map map = sharedPrefsFor.getPreference(SharedPrefsForInstagram.PREFERENCE);
if (map != null) {
String cookie = "ds_user_id=" + map.get(SharedPrefsForInstagram.PREFERENCE_USERID) + "; sessionid=" + map.get(SharedPrefsForInstagram.PREFERENCE_SESSIONID);

AndroidNetworking.get("https://instagram.com/graphql/question/?query_id=17888483320059182&id={userid}&first=20&after={end_cursor}")
.addPathParameter("userid", myUserPKID)
.addPathParameter("end_cursor", INSTAGRAM_endcursorval)//QVFCX1U4TzBuSXhyZTNyMzBZSmpXYVljazN2UHo1NEhqYko5NDF1R0FMSWU3U25hcVVPcjdkVnVuT3cxb2drZ2VRbFFuVXV4eGIzRGZ3RFM0QkJwOW1wMg==
.setPriority(Precedence.LOW)
.addHeaders("Cookie", cookie)
.addHeaders(
"Person-Agent",
""Instagram 9.5.2 (iPhone7,2; iPhone OS 9_3_3; en_US; en-US; scale=2.00; 750x1334) AppleWebKit/420+""
)
.construct()
.getAsJSONObject(new JSONObjectRequestListener() {
@Override
public void onResponse(JSONObject response) {
binding.profileLongProgress.setVisibility(View.GONE);


System.out.println("hvjksdhfhdkd profiledataaaaa " + response.toString());
System.out.println("hvjksdhfhdkd userpkid " + myUserPKID + " username");
// System.out.println("hvjksdhfhdkd mannequin click on idis" + response.toString());
//4162923872
//3401888503
// binding.dfsadasdas.setText(response.toString());

strive {
ObjectMapper om = new ObjectMapper();
UserProfileDataModelBottomPart root = om.readValue(response.toString(), UserProfileDataModelBottomPart.class);

storyModelInstaItemList.addAll(root.getData().getUser().getEdge_owner_to_timeline_media().getEdges());


INSTAGRAM_endcursorval = root.getData().getUser().getEdge_owner_to_timeline_media().getPage_info().getEnd_cursor();


} catch (Exception e) {
System.out.println("hvjksdhfhdkd eeee errrrrrrr" + e.getMessage());
}
listAllProfilePostsInstagramUserAdapter.notifyDataSetChanged();

}

@Override
public void onError(ANError anError) {
binding.profileLongProgress.setVisibility(View.GONE);

System.out.println("hvjksdhfhdkd eeee" + anError.getResponse());

}
});

} else {
binding.profileLongProgress.setVisibility(View.GONE);

Toast.makeText(this, youneedloginfirest, Toast.LENGTH_LONG).present();
}

}


@Override
public void onBackPressed() {
INSTAGRAM_endcursorval = "";
//startActivity(new Intent(BulkDownloader_ProfileActivity.this,InstagramBulkDownloader.class));
end();
}
}


FullImageActivity.java


package deal com.infusiblecoder.allinonevideodownloader;

import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.DataSource;
import com.bumptech.glide.load.engine.GlideException;
import com.bumptech.glide.request.RequestListener;
import com.bumptech.glide.request.goal.Goal;
import com.infusiblecoder.allinonevideodownloader.databinding.ActivityFullViewBinding;


public class FullImageActivity extends AppCompatActivity {

non-public ActivityFullViewBinding binding;

@Override
protected void onCreate(Bundle savedInstanceState) {
tremendous.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
binding = ActivityFullViewBinding.inflate(getLayoutInflater());
View view = binding.getRoot();
setContentView(view);
initViews();

if (getIntent().getStringExtra("myimgfile") != null && getIntent().getStringExtra("isfbimage") != null) {
String filepath = getIntent().getStringExtra("myimgfile");
String is = getIntent().getStringExtra("isfbimage");
if (is.equals("true")) {
showImage(filepath);
} else {
Glide.with(this)
.load(filepath)
.into(binding.imageviewFullimg);
}
} else if (getIntent().getStringExtra("myimgfile") != null) {
String filepath = getIntent().getStringExtra("myimgfile");
Glide.with(this)
.load(filepath)
.into(binding.imageviewFullimg);

}


}


public void showImage(String str) {
Glide.with(this).asBitmap().load(str).addListener(new RequestListener() {
public boolean onLoadFailed(GlideException glideException, Object obj, Goal goal, boolean z) {
Toast.makeText(FullImageActivity.this, "Cant get picture", Toast.LENGTH_SHORT).present();
return false;
}

@Override
public boolean onResourceReady(Bitmap useful resource, Object mannequin, Goal goal, DataSource dataSource, boolean isFirstResource) {

FullImageActivity.this.runOnUiThread(new Runnable() {
public void run() {
binding.imageviewFullimg.setImageBitmap(useful resource);
}
});
return false;
}


}).submit();
}

public void initViews() {
binding.imgclose.setOnClickListener(v -> {
onBackPressed();
});
}

@Override
public boolean onOptionsItemSelected(MenuItem merchandise) {
if (merchandise.getItemId() == android.R.id.dwelling) {
onBackPressed();
}
return tremendous.onOptionsItemSelected(merchandise);
}


}


GalleryActivity.java


package deal com.infusiblecoder.allinonevideodownloader;

import android.content material.Context;
import android.content material.SharedPreferences;
import android.os.Bundle;
import android.view.View;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.viewpager.widget.ViewPager;

import com.google.android.materials.tabs.TabLayout;
import com.infusiblecoder.allinonevideodownloader.fragments.AudiogalleryGallery;
import com.infusiblecoder.allinonevideodownloader.fragments.GalleryFragmentMainGallery;
import com.infusiblecoder.allinonevideodownloader.fragments.InstagalleryImagesGallery;
import com.infusiblecoder.allinonevideodownloader.fragments.StatusSaverGallery;
import com.infusiblecoder.allinonevideodownloader.utils.AdsManager;
import com.infusiblecoder.allinonevideodownloader.utils.Constants;

import org.jetbrains.annotations.NotNull;

public class GalleryActivity extends AppCompatActivity {

TabLayout tabLayout;
ViewPager viewPager;
non-public String nn;

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
tremendous.onCreate(savedInstanceState);
setContentView(R.format.activity_gallery);


tabLayout = (TabLayout) findViewById(R.id.tabsgallery);
viewPager = (ViewPager) findViewById(R.id.viewpagergallery);


tabLayout.addTab(tabLayout.newTab().setText(getString(R.string.gallery_fragment_statussaver)).setIcon(R.drawable.ic_gallery_color_24dp));
tabLayout.addTab(tabLayout.newTab().setText(getString(R.string.StatusSaver_gallery)).setIcon(R.drawable.statuspic));
tabLayout.addTab(tabLayout.newTab().setText(getString(R.string.instaimage)).setIcon(R.drawable.ic_image));
tabLayout.addTab(tabLayout.newTab().setText(getString(R.string.audios)).setIcon(R.drawable.ic_music_note_24dp));
tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);

ultimate MyAdapter adapter = new MyAdapter(this, getSupportFragmentManager(), tabLayout.getTabCount());
viewPager.setAdapter(adapter);

viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));

tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override
public void onTabSelected(TabLayout.Tab tab) {
viewPager.setCurrentItem(tab.getPosition());
}

@Override
public void onTabUnselected(TabLayout.Tab tab) {

}

@Override
public void onTabReselected(TabLayout.Tab tab) {

}
});


SharedPreferences prefs = getSharedPreferences("whatsapp_pref",
Context.MODE_PRIVATE);
nn = prefs.getString("inappads", "nnn");//"No identify outlined" is the default worth.


if (Constants.show_Ads) {
if (nn.equals("nnn")) {
AdsManager.loadInterstitialAd(this);

AdsManager.loadBannerAd(this, findViewById(R.id.banner_container));
} else {

findViewById(R.id.banner_container).setVisibility(View.GONE);
}
}

}


public class MyAdapter extends FragmentPagerAdapter {

non-public Context myContext;
int totalTabs;

public MyAdapter(Context context, FragmentManager fm, int totalTabs) {
tremendous(fm, FragmentPagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
myContext = context;
this.totalTabs = totalTabs;
}


@NotNull
@Override
public Fragment getItem(int place) {
change (place) {
case 0:
return new GalleryFragmentMainGallery();
case 1:
return new StatusSaverGallery();
case 2:
return new InstagalleryImagesGallery();
case 3:
return new AudiogalleryGallery();
default:
return null;
}
}


@Override
public int getCount() {
return totalTabs;
}
}
}


GetLinkThroughWebview.java




package deal com.infusiblecoder.allinonevideodownloader;

import android.annotation.SuppressLint;
import android.app.ProgressDialog;
import android.content material.Intent;
import android.os.AsyncTask;
import android.os.Construct;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.webkit.CookieManager;
import android.webkit.JavascriptInterface;
import android.webkit.ValueCallback;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.FrameLayout;

import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;

import com.infusiblecoder.allinonevideodownloader.databinding.ActivityGetLinkThroughWebviewBinding;
import com.infusiblecoder.allinonevideodownloader.fashions.DlApismodels.VideoModel;
import com.infusiblecoder.allinonevideodownloader.duties.downloadFile;
import com.infusiblecoder.allinonevideodownloader.utils.iUtils;

import org.json.JSONObject;
import org.jsoup.nodes.Doc;
import org.jsoup.choose.Parts;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.internet.HttpURLConnection;
import java.internet.URL;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.TreeSet;
import java.util.regex.Matcher;
import java.util.regex.Sample;

import static com.infusiblecoder.allinonevideodownloader.duties.downloadVideo.fromService;
import static com.infusiblecoder.allinonevideodownloader.duties.downloadVideo.pd;

public class GetLinkThroughWebview extends AppCompatActivity {
String url = "";
ProgressDialog progressDialog;
boolean isOnetime = false;
non-public ArrayList videoModelArrayList = new ArrayList<>();
non-public ActivityGetLinkThroughWebviewBinding binding;
Handler handler;
Runnable runnable;

@SuppressLint("JavascriptInterface")
@Override
protected void onCreate(Bundle savedInstanceState) {
tremendous.onCreate(savedInstanceState);
binding = ActivityGetLinkThroughWebviewBinding.inflate(getLayoutInflater());
View view = binding.getRoot();
setContentView(view);

progressDialog = new ProgressDialog(GetLinkThroughWebview.this);
progressDialog.setMessage(getString(R.string.nodeifittakeslonger));
progressDialog.present();

url = "https://audiomack.com/lightskinkeisha/tune/fdh";
handler = new Handler();

// url = "https://audiomack.com/embed/tune/lightskinkeisha/fdh?background=1";


if (getIntent().hasExtra("myurlis")) {
url = getIntent().getStringExtra("myurlis");


if (url.comprises("audiomack")) {

String[] urlarray = url.break up("/");
System.out.println("size ksdjjfsdfsd 6" + urlarray[5]);
System.out.println("size ksdjjfsdfsd 5" + urlarray[3]);
url = "https://audiomack.com/embed/tune/" + urlarray[3] + "/" + urlarray[5] + "?background=1";

System.out.println("size ksdjjfsdfsd 77 =" + url);
}


} else {
url = "https://audiomack.com/embed/tune/lightskinkeisha/fdh?background=1";
}


if (android.os.Construct.VERSION.SDK_INT >= 21) {
CookieManager.getInstance().setAcceptThirdPartyCookies(binding.browser, true);
} else {
CookieManager.getInstance().setAcceptCookie(true);
}
binding.browser.addJavascriptInterface(new MyJavaScriptInterface(), "HTMLOUT");
binding.browser.getSettings().setJavaScriptEnabled(true);
binding.browser.getSettings().getAllowFileAccess();
// binding.browser.getSettings().setUserAgentString("Mozilla/5.0 (Linux; Android 10;TXY567) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/8399.0.9993.96 Cell Safari/599.36");

binding.browser.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {


runnable = new Runnable() {
@Override
public void run() {


if (url.comprises("audiomack")) {

binding.browser.loadUrl("javascript:window.HTMLOUT.showHTML('" + url + "',''+doc.getElementsByTagName('audio')[0].getAttribute("src"));");
} else if (url.comprises("zili")) {

binding.browser.loadUrl("javascript:window.HTMLOUT.showHTML('" + url + "',''+doc.getElementsByTagName('video')[0].getAttribute("src"));");

} else if (url.comprises("bemate")) {

binding.browser.loadUrl("javascript:window.HTMLOUT.showHTML('" + url + "',''+doc.getElementsByTagName('video')[0].getAttribute("src"));");

} else if (url.comprises("xhamster")) {

binding.browser.loadUrl("javascript:window.HTMLOUT.showHTML('" + url + "',''+doc.getElementsByTagName('video')[0].getAttribute("src"));");

} else if (url.comprises("byte.co")) {

binding.browser.loadUrl("javascript:window.HTMLOUT.showHTML('" + url + "',''+doc.getElementsByTagName('video')[1].getAttribute("src"));");

} else if (url.comprises("vidlit")) {

binding.browser.loadUrl("javascript:window.HTMLOUT.showHTML('" + url + "',''+doc.getElementsByTagName('supply')[0].getAttribute("src"));");

} else if (url.comprises("veer.television")) {

binding.browser.loadUrl("javascript:window.HTMLOUT.showHTML('" + url + "',''+doc.getElementsByTagName('video')[0].getAttribute("src"));");

} else if (url.comprises("fthis.gr")) {

binding.browser.loadUrl("javascript:window.HTMLOUT.showHTML('" + url + "',''+doc.getElementsByTagName('supply')[0].getAttribute("src"));");

} else if (url.comprises("fw.television") || url.comprises("firework.television")) {

binding.browser.loadUrl("javascript:window.HTMLOUT.showHTML('" + url + "',''+doc.getElementsByTagName('supply')[0].getAttribute("src"));");

} else if (url.comprises("rumble")) {

binding.browser.loadUrl("javascript:window.HTMLOUT.showHTML('" + url + "',''+doc.getElementsByTagName('video')[0].getAttribute("src"));");

} else if (url.comprises("traileraddict")) {

binding.browser.loadUrl("javascript:window.HTMLOUT.showHTML('" + url + "',''+doc.getElementsByTagName('video')[0].getAttribute("src"));");

} else if (url.comprises("zingmp3")) {

binding.browser.loadUrl("javascript:window.HTMLOUT.showHTML('" + url + "',''+doc.getElementsByTagName('audio')[0].getAttribute("src"));");

} else {
progressDialog.dismiss();
handler.removeCallbacks(this);

iUtils.ShowToast(GetLinkThroughWebview.this, getResources().getString(R.string.somthing));


Intent intent = new Intent();
setResult(2, intent);
end();
}

handler.postDelayed(this, 1000);

}
};

handler.postDelayed(runnable, 1000);

}
});

binding.browser.loadUrl(url);


}


public class ParseM3u8 extends AsyncTask> {
String DailyMotionUrl;
non-public Doc doc;
non-public FrameLayout dwn_lyt;
non-public ultimate JSONObject emp = null;
non-public Parts scriptElements;

ParseM3u8(String str) {
this.DailyMotionUrl = str;
}

@RequiresApi(api = Construct.VERSION_CODES.KITKAT)
protected ArrayList doInBackground(Object... objArr) {
String str = "TAG";
ArrayList arrayList = new ArrayList();
strive {
HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(this.DailyMotionUrl).openConnection();
httpURLConnection.setConnectTimeout(60000);
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream(), StandardCharsets.UTF_8));
HashMap hashMap = null;
Sample compile = Sample.compile("d+");
whereas (true) {
String readLine = bufferedReader.readLine();
if (readLine == null) {
break;
} else if (readLine.equals("#EXTM3U")) {
hashMap = new HashMap();
} else if (readLine.comprises("#EXT-X-STREAM-INF")) {
Matcher matcher = compile.matcher(readLine);
matcher.discover();
if (hashMap != null) {
hashMap.put(readLine, Integer.valueOf(Integer.parseInt(matcher.group(0))));
VideoModel videoModel = new VideoModel();
if (readLine.comprises("PROGRESSIVE-URI")) {
String[] break up = readLine.break up(",");
String[] split2 = break up[3].break up("=");
String str2 = break up[0];
break up = break up[5].break up("=");
//videoModel.setName(Uri.parse(break up[1].substring(1)).getLastPathSegment());
videoModel.setQuality(split2[1].exchange(""", ""));
videoModel.setUrl(break up[1].substring(1));
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("PROGRESSIVE-URI: ");
stringBuilder.append(break up[1].substring(1));
Log.e(str, stringBuilder.toString());
videoModel.setSize(String.valueOf(iUtils.getRemoteFileSize(break up[1].substring(1))));
arrayList.add(videoModel);
}
}
}
}
bufferedReader.shut();
} catch (Exception objArr2) {
StringBuilder stringBuilder2 = new StringBuilder();
stringBuilder2.append("doInBackground: ");
stringBuilder2.append(objArr2.getMessage());
objArr2.printStackTrace();
}
return arrayList;
}


public ArrayList removeDuplicates(ArrayList arrayList) {
TreeSet treeSet = new TreeSet(new Comparator() {
public int examine(VideoModel videoModel, VideoModel videoModel2) {
return videoModel.getQuality().equalsIgnoreCase(videoModel2.getQuality()) ? 0 : 1;
}
});
treeSet.addAll(arrayList);
return new ArrayList<>(treeSet);
}


protected void onPostExecute(ArrayList arrayList) {
tremendous.onPostExecute(arrayList);
if (arrayList != null) {


}
GetLinkThroughWebview.this.videoModelArrayList = this.removeDuplicates(arrayList);
}
}


@RequiresApi(api = Construct.VERSION_CODES.KITKAT)
public void onPausing() {
if (binding.browser != null) {
binding.browser.evaluateJavascript("javascript:doc.querySelector('video').pause();", new ValueCallback() {
public void onReceiveValue(Object obj) {
}
});
}
}

@RequiresApi(api = Construct.VERSION_CODES.KITKAT)
public void onResuming() {
if (binding.browser != null) {
binding.browser.evaluateJavascript("javascript:doc.querySelector('video').play();", new ValueCallback() {
public void onReceiveValue(Object obj) {
}
});
}
}

@Override
protected void onDestroy() {
tremendous.onDestroy();
if (handler != null && runnable != null) {
handler.removeCallbacks(runnable);
}

}

class MyJavaScriptInterface {
@SuppressWarnings("unused")
@JavascriptInterface
public void showHTML(ultimate String myurl, ultimate String html) {
progressDialog.dismiss();

System.out.println("myhtml res =" + html);
if (!isOnetime) {
isOnetime = true;

handler.removeCallbacks(runnable);

if (myurl.comprises("audiomack")) {

new downloadFile().Downloading(GetLinkThroughWebview.this, html, "Audiomack_" + System.currentTimeMillis(), ".mp3");

} else if (myurl.comprises("zili")) {

new downloadFile().Downloading(GetLinkThroughWebview.this, html, "Zilivideo_" + System.currentTimeMillis(), ".mp4");

} else if (myurl.comprises("bemate")) {

new downloadFile().Downloading(GetLinkThroughWebview.this, html, "Bemate_" + System.currentTimeMillis(), ".mp4");

} else if (myurl.comprises("xhamster")) {

new downloadFile().Downloading(GetLinkThroughWebview.this, html, "xhamster_" + System.currentTimeMillis(), ".mp4");

} else if (myurl.comprises("byte.co")) {

new downloadFile().Downloading(GetLinkThroughWebview.this, html, "Byte_" + System.currentTimeMillis(), ".mp4");

} else if (myurl.comprises("vidlit")) {

new downloadFile().Downloading(GetLinkThroughWebview.this, html, "Vidlit_" + System.currentTimeMillis(), ".mp4");

} else if (myurl.comprises("veer.television")) {

String jj = html.exchange("&", "&");

new downloadFile().Downloading(GetLinkThroughWebview.this, jj, "Veer_" + System.currentTimeMillis(), ".mp4");
} else if (myurl.comprises("fthis.gr")) {

new downloadFile().Downloading(GetLinkThroughWebview.this, html, "Fthis_" + System.currentTimeMillis(), ".mp4");

} else if (myurl.comprises("fw.television") || myurl.comprises("firework.television")) {

new downloadFile().Downloading(GetLinkThroughWebview.this, html, "Firework_" + System.currentTimeMillis(), ".mp4");

} else if (myurl.comprises("traileraddict")) {

new downloadFile().Downloading(GetLinkThroughWebview.this, html, "Traileraddict_" + System.currentTimeMillis(), ".mp4");

} else if (myurl.comprises("rumble")) {

String jj = html.exchange("&", "&");

new downloadFile().Downloading(GetLinkThroughWebview.this, jj, "Rumble_" + System.currentTimeMillis(), ".mp4");
} else if (myurl.comprises("zingmp3")) {


new downloadFile().Downloading(GetLinkThroughWebview.this, "https:" + html, "Zingmp3_" + System.currentTimeMillis(), ".mp3");
} else {

progressDialog.dismiss();


iUtils.ShowToast(GetLinkThroughWebview.this, getResources().getString(R.string.somthing));


Intent intent = new Intent();
setResult(2, intent);
end();

}

System.out.println("htmlissss vid_url=" + html + " url=" + myurl);


Intent intent = new Intent();
intent.putExtra("MESSAGE", html);
setResult(2, intent);
end();
}

}
}


}


GetTiktokLinkThroughWebview




package deal com.infusiblecoder.allinonevideodownloader;

import android.annotation.SuppressLint;
import android.app.ProgressDialog;
import android.content material.Intent;
import android.os.Construct;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.webkit.CookieManager;
import android.webkit.JavascriptInterface;
import android.webkit.ValueCallback;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;

import com.infusiblecoder.allinonevideodownloader.databinding.ActivityGetLinkThroughWebviewBinding;
import com.infusiblecoder.allinonevideodownloader.fashions.DlApismodels.VideoModel;
import com.infusiblecoder.allinonevideodownloader.utils.iUtils;

import java.util.ArrayList;

import static com.infusiblecoder.allinonevideodownloader.duties.downloadVideo.fromService;
import static com.infusiblecoder.allinonevideodownloader.duties.downloadVideo.pd;

public class GetTiktokLinkThroughWebview extends AppCompatActivity {
String url = "";
ProgressDialog progressDialog;
boolean isOnetime = false;
non-public ArrayList videoModelArrayList = new ArrayList<>();
non-public ActivityGetLinkThroughWebviewBinding binding;

@SuppressLint("JavascriptInterface")
@Override
protected void onCreate(Bundle savedInstanceState) {
tremendous.onCreate(savedInstanceState);
binding = ActivityGetLinkThroughWebviewBinding.inflate(getLayoutInflater());
View view = binding.getRoot();
setContentView(view);

progressDialog = new ProgressDialog(GetTiktokLinkThroughWebview.this);
progressDialog.setMessage("Loading.... Observe if it takes longer then 1 min shut the app and retry");
progressDialog.present();

url = "https://audiomack.com/lightskinkeisha/tune/fdh";


// url = "https://audiomack.com/embed/tune/lightskinkeisha/fdh?background=1";

if (getIntent().hasExtra("myurlis")) {
url = getIntent().getStringExtra("myurlis");

} else {
url = "https://audiomack.com/embed/tune/lightskinkeisha/fdh?background=1";
}


if (Construct.VERSION.SDK_INT >= 21) {
CookieManager.getInstance().setAcceptThirdPartyCookies(binding.browser, true);
} else {
CookieManager.getInstance().setAcceptCookie(true);
}

binding.browser.addJavascriptInterface(new MyJavaScriptInterface(), "HTMLOUT");
binding.browser.getSettings().setJavaScriptEnabled(true);
// binding.browser.clearFormData();
// binding.browser.getSettings().setSaveFormData(true);
// binding.browser.getSettings().setAppCacheMaxSize(5242880);
// binding.browser.getSettings().setAllowFileAccess(true);
// binding.browser.getSettings().setAppCacheEnabled(true);
// binding.browser.getSettings().getAllowFileAccess();
// binding.browser.getSettings().setDefaultTextEncodingName("UTF-8");
// binding.browser.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
// binding.browser.getSettings().setDatabaseEnabled(true);
// binding.browser.getSettings().setBuiltInZoomControls(false);
// binding.browser.getSettings().setSupportZoom(false);
// binding.browser.getSettings().setUseWideViewPort(true);
// binding.browser.getSettings().setDomStorageEnabled(true);
// binding.browser.getSettings().setAllowFileAccess(true);
// binding.browser.getSettings().setLoadWithOverviewMode(true);
// binding.browser.getSettings().setLoadsImagesAutomatically(true);
// binding.browser.getSettings().setBlockNetworkImage(false);
// binding.browser.getSettings().setBlockNetworkLoads(false);
// binding.browser.getSettings().setLoadWithOverviewMode(true);


// this.config = {
// baseURL: 'https://api2.musical.ly/',
// host: 'api2.musical.ly',
// userAgent: `com.zhiliaoapp.musically/${reqParams.manifest_version_code}`
// + ` (Linux; U; Android ${reqParams.os_version}; ${reqParams.language}_${reqParams.area};`
// + ` ${reqParams.device_type}; Construct/NHG47Q; Cronet/58.0.2991.0)`,
// ...apiConfig,
// } as API.TikTokAPIConfig;


// binding.browser.getSettings().setUserAgentString("Mozilla/5.0 (Linux; Android 10;TXY567) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/8399.0.9993.96 Cell Safari/599.36");
// binding.browser.getSettings().setUserAgentString("Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Construct/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Cell Safari/537.36 (suitable; Googlebot/2.1; +http://www.google.com/bot.html)");

binding.browser.getSettings().setUserAgentString("com.zhiliaoapp.musically/2018052132 (Linux; U; Android 8.0.0; en_US; Pixel 2; Construct/ABCXYZ; Cronet/58.0.2991.0)");
// binding.browser.getSettings().setUserAgentString("com.zhiliaoapp.musically/2018052132 (Linux; Android 10;TXY567; en_US; SM-J700F; Construct/MMB29K; Cronet/58.0.2991.0)");

binding.browser.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {

new Handler().postDelayed(new Runnable() {
@Override
public void run() {


if (url.comprises("tiktok")) {

// binding.browser.loadUrl("javascript:window.HTMLOUT.showHTML('" + url + "',''+doc.getElementById('RENDER_DATA').textContent);");
binding.browser.loadUrl("javascript:window.HTMLOUT.showHTML('" + url + "',''+doc.getElementsByTagName('html')[0].textContent+'');");
//binding.browser.loadUrl("javascript:window.HTMLOUT.showHTML('" + url + "',''+doc.getElementsByTagName('video')[0].getAttribute("src"));");
// binding.browser.loadUrl("javascript:window.HTMLOUT.showHTML('" + url + "',''+doc.querySelectorAll("script[id='__NEXT_DATA__']")[0].innerHTML));");

} else {
progressDialog.dismiss();

if (!fromService) {
pd.dismiss();
iUtils.ShowToast(GetTiktokLinkThroughWebview.this, getResources().getString(R.string.somthing));
}

Intent intent = new Intent();
setResult(2, intent);
end();
}

}
}, 1000);

}
});

binding.browser.loadUrl(url);


}


@RequiresApi(api = Construct.VERSION_CODES.KITKAT)
public void onPausing() {


if (binding.browser != null) {
binding.browser.evaluateJavascript("javascript:doc.querySelector('video').pause();", new ValueCallback() {
public void onReceiveValue(Object obj) {
}
});
}
}

@RequiresApi(api = Construct.VERSION_CODES.KITKAT)
public void onResuming() {
if (binding.browser != null) {
binding.browser.evaluateJavascript("javascript:doc.querySelector('video').play();", new ValueCallback() {
public void onReceiveValue(Object obj) {
}
});
}
}


class MyJavaScriptInterface {
@SuppressWarnings("unused")
@JavascriptInterface
public void showHTML(ultimate String myurl, ultimate String html) {
progressDialog.dismiss();

System.out.println("myhtml res uu =" + myurl);
System.out.println("myhtml res =" + html);


if (!isOnetime) {
isOnetime = true;


if (myurl.comprises("tiktok")) {

strive {
// String afterDecode = URLDecoder.decode(html, "UTF-8");
//
//
// JSONObject jsonObject = new JSONObject(afterDecode);
//
// String video_id = jsonObject
// .getJSONObject("rpcRes")
// .getJSONObject("res")
// .getJSONObject("ItemInfo")
// .getJSONObject("ItemStruct")
// .getJSONObject("Video")
// .getJSONObject("PlayAddr")
// .getString("Uri");
//
//
// String ddurl = "https://api2-16-h2.musical.ly/aweme/v1/play/?video_id=" + video_id + "&vr_type=0&is_play_url=1&supply=PackSourceEnum_PUBLISH&media_type=4&ratio=default&improve_bitrate=1";
//
// System.out.println("wojfdjhfdjh 111 " + ddurl);


// new downloadFile().Downloading(GetTiktokLinkThroughWebview.this, html, "Tiktok_" + System.currentTimeMillis(), ".mp4");

} catch (Exception e) {
e.printStackTrace();
}


// new downloadFile().Downloading(GetTiktokLinkThroughWebview.this, html, "Audiomack_" + System.currentTimeMillis(), ".mp3");

} else {

progressDialog.dismiss();

if (!fromService) {
pd.dismiss();
iUtils.ShowToast(GetTiktokLinkThroughWebview.this, getResources().getString(R.string.somthing));
}

// Intent intent = new Intent();
// setResult(2, intent);
// end();

}

System.out.println("htmlissss vid_url=" + html + " url=" + myurl);


// Intent intent = new Intent();
// intent.putExtra("MESSAGE", html);
// setResult(2, intent);
// end();
}

}
}


// public class HttpHelper {
// public static ultimate OkHttpClient a = new Builder().connectTimeout(20, TimeUnit.SECONDS).writeTimeout(20, TimeUnit.SECONDS).readTimeout(20, TimeUnit.SECONDS).retryOnConnectionFailure(true).proxy(Proxy.NO_PROXY).construct();
// public static ultimate Request.Builder b = new Request.Builder().addHeader("Connection", "shut").addHeader("Person-Agent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36");
//
// static {
// System.loadLibrary("native-lib");
// }
//
// public static void a(String str, Context context, Callback callback) {
// StringBuilder stringBuilder;
// String stringBuilder2;
// Object a;
// Exception e;
// MediaType parse;
// String str2;
// TreeMap treeMap;
// Excluder excluder;
// ww0 com_video_downloader_no_watermark_tiktok_ui_view_ww0;
// bw0 com_video_downloader_no_watermark_tiktok_ui_view_bw0;
// HashMap hashMap;
// HashMap hashMap2;
// Assortment assortment;
// Assortment arrayList;
// Assortment collection2;
// Assortment arrayList2;
// boolean z;
// boolean z2;
// boolean z3;
// boolean z4;
// int i;
// Listing listing;
// Listing arrayList3;
// iw0 com_video_downloader_no_watermark_tiktok_ui_view_iw0;
// String str3 = "params";
// String str4 = "videoUrl";
// String str5 = "headStr";
// String str6 = "utf-8";
// StringBuilder stringBuilder3 = new StringBuilder();
// stringBuilder3.append("app_language=AS");
// stringBuilder3.append("&language=AS");
// stringBuilder3.append("®ion=AS");
// stringBuilder3.append("&sys_region=AS");
// stringBuilder3.append("&carrier_region=&carrier_region_v2=");
// int dSTSavings = (TimeZone.getDefault().getDSTSavings() / 1000) + (TimeZone.getDefault().getRawOffset() / 1000);
// stringBuilder3.append("&timezone_offset=");
// stringBuilder3.append(dSTSavings);
// stringBuilder3.append("&timezone_name=");
// stringBuilder3.append(Uri.encode(TimeZone.getDefault().getID()));
// stringBuilder3.append("&mcc_mnc=&retry_type=no_retry&is_my_cn=1&fp=&pass-region=1&pass-route=1&ac=wifi&channel=googleplay&help=1180&iid=6800628374143469314&app_name=trill&version_code=494&device_platform=android&ab_version=4.9.3&help=1180&ssmix=a&manifest_version_code=494&update_version_code=4940");
// int i2 = Sources.getSystem().getDisplayMetrics().heightPixels;
// dSTSavings = Sources.getSystem().getDisplayMetrics().widthPixels;
// stringBuilder3.append("&decision=");
// stringBuilder3.append(dSTSavings);
// stringBuilder3.append("*");
// stringBuilder3.append(i2);
// DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
// stringBuilder3.append("&dpi=");
// stringBuilder3.append(displayMetrics.densityDpi);
// stringBuilder3.append("&openudid=");
// stringBuilder3.append(Safe.getString(context.getContentResolver(), "android_id"));
// stringBuilder3.append("&device_type=");
// stringBuilder3.append(Uri.encode(Construct.MODEL));
// stringBuilder3.append("&os_version=");
// stringBuilder3.append(VERSION.RELEASE);
// stringBuilder3.append("&os_api=");
// stringBuilder3.append(VERSION.SDK_INT);
// stringBuilder3.append("&device_brand=");
// stringBuilder3.append(Construct.BRAND);
// strive {
// stringBuilder = new StringBuilder();
// stringBuilder.append("com.ss.android.ugc.trill/494 ");
// stringBuilder.append(WebSettings.getDefaultUserAgent(context));
// stringBuilder2 = stringBuilder.toString();
// } catch (Throwable th) {
// th.printStackTrace();
// stringBuilder2 = "com.ss.android.ugc.trill/494 Mozilla/5.0 (Linux; Android 10; HRY-AL00a Construct/HONORHRY-AL00a; wv) AppleWebKit/537.36 (KHTML, like Gecko) Model/4.0 Chrome/80.0.3987.99 Cell Safari/537.36";
// }
// HashMap hashMap3 = new HashMap();
// strive {
// hashMap3.put(str5, URLEncoder.encode(stringBuilder2, str6));
// hashMap3.put(str3, URLEncoder.encode(stringBuilder3.toString(), str6));
// hashMap3.put(str4, URLEncoder.encode(str, str6));
// } catch (UnsupportedEncodingException e2) {
// e2.printStackTrace();
// }
// stringBuilder = new StringBuilder();
// stringBuilder.append(System.currentTimeMillis());
// str6 = "";
// stringBuilder.append(str6);
// hashMap3.put("userId", stringBuilder.toString());
// stringBuilder = new StringBuilder();
// stringBuilder.append(System.currentTimeMillis());
// stringBuilder.append(str6);
// hashMap3.put("timestamp", stringBuilder.toString());
// stringBuilder = new StringBuilder();
// TreeMap treeMap2 = new TreeMap(hashMap3);
// Excluder excluder2 = Excluder.f;
// ww0 com_video_downloader_no_watermark_tiktok_ui_view_ww02 = ww0.a;
// bw0 com_video_downloader_no_watermark_tiktok_ui_view_bw02 = bw0.a;
// HashMap hashMap4 = r7;
// HashMap hashMap5 = new HashMap();
// Assortment collection3 = r7;
// Assortment arrayList4 = new ArrayList();
// Assortment collection4 = r11;
// Assortment arrayList5 = new ArrayList();
// boolean z5 = false;
// boolean z6 = false;
// boolean z7 = false;
// int i3 = 2;
// Listing list2 = r12;
// Listing arrayList6 = new ArrayList((arrayList5.dimension() + arrayList4.dimension()) + 3);
// arrayList6.addAll(arrayList4);
// Collections.reverse(arrayList6);
// arrayList4 = new ArrayList(arrayList5);
// Collections.reverse(arrayList4);
// arrayList6.addAll(arrayList4);
// String str7 = str6;
// iw0 com_video_downloader_no_watermark_tiktok_ui_view_iw02 = r7;
// iw0 com_video_downloader_no_watermark_tiktok_ui_view_iw03 = new iw0(excluder2, com_video_downloader_no_watermark_tiktok_ui_view_bw02, hashMap4, false, false, false, false, z7, z5, z6, com_video_downloader_no_watermark_tiktok_ui_view_ww02, null, 2, i3, collection3, collection4, list2);
// stringBuilder.append(com_video_downloader_no_watermark_tiktok_ui_view_iw02.f(treeMap2));
// stringBuilder.append(getSafeKey(context));
// strive {
// a = qu0.a(MessageDigest.getInstance("SHA-256").digest(stringBuilder.toString().getBytes("UTF-8")));
// } catch (NoSuchAlgorithmException e3) {
// e = e3;
// e.printStackTrace();
// a = str7;
// hashMap3.put("signal", a);
// parse = MediaType.parse("utility/json");
// getURL(context);
// for (Entry entry : hashMap3.entrySet()) {
// if (str4.equals(entry.getKey())) {
// str2 = (String) entry.getKey();
// str2 = (String) entry.getValue();
// b.header((String) entry.getKey(), String.valueOf(entry.getValue()));
// }
// }
// treeMap = new TreeMap();
// treeMap.put(str5, hashMap3.get(str5));
// treeMap.put(str3, hashMap3.get(str3));
// treeMap.put(str4, hashMap3.get(str4));
// excluder = Excluder.f;
// com_video_downloader_no_watermark_tiktok_ui_view_ww0 = ww0.a;
// com_video_downloader_no_watermark_tiktok_ui_view_bw0 = bw0.a;
// hashMap = hashMap2;
// hashMap2 = new HashMap();
// assortment = arrayList;
// arrayList = new ArrayList();
// collection2 = arrayList2;
// arrayList2 = new ArrayList();
// z = false;
// z2 = false;
// z7 = false;
// z3 = false;
// z4 = false;
// i = 2;
// listing = arrayList3;
// arrayList3 = new ArrayList((arrayList2.dimension() + arrayList.dimension()) + 3);
// arrayList3.addAll(arrayList);
// Collections.reverse(arrayList3);
// arrayList = new ArrayList(arrayList2);
// Collections.reverse(arrayList);
// arrayList3.addAll(arrayList);
// com_video_downloader_no_watermark_tiktok_ui_view_iw0 = new iw0(excluder, com_video_downloader_no_watermark_tiktok_ui_view_bw0, hashMap, z, z4, false, false, z3, z2, z7, com_video_downloader_no_watermark_tiktok_ui_view_ww0, null, 2, i, assortment, collection2, listing);
// com_video_downloader_no_watermark_tiktok_ui_view_iw0.f(treeMap);
// a.newCall(b.submit(RequestBody.create(parse, com_video_downloader_no_watermark_tiktok_ui_view_iw0.f(treeMap))).url(getURL(context)).construct()).enqueue(callback);
// } catch (UnsupportedEncodingException e4) {
// e = e4;
// e.printStackTrace();
// a = str7;
// hashMap3.put("signal", a);
// parse = MediaType.parse("utility/json");
// getURL(context);
// for (Entry entry2 : hashMap3.entrySet()) {
// if (str4.equals(entry2.getKey())) {
// str2 = (String) entry2.getKey();
// str2 = (String) entry2.getValue();
// b.header((String) entry2.getKey(), String.valueOf(entry2.getValue()));
// }
// }
// treeMap = new TreeMap();
// treeMap.put(str5, hashMap3.get(str5));
// treeMap.put(str3, hashMap3.get(str3));
// treeMap.put(str4, hashMap3.get(str4));
// excluder = Excluder.f;
// com_video_downloader_no_watermark_tiktok_ui_view_ww0 = ww0.a;
// com_video_downloader_no_watermark_tiktok_ui_view_bw0 = bw0.a;
// hashMap = hashMap2;
// hashMap2 = new HashMap();
// assortment = arrayList;
// arrayList = new ArrayList();
// collection2 = arrayList2;
// arrayList2 = new ArrayList();
// z = false;
// z2 = false;
// z7 = false;
// z3 = false;
// z4 = false;
// i = 2;
// listing = arrayList3;
// arrayList3 = new ArrayList((arrayList2.dimension() + arrayList.dimension()) + 3);
// arrayList3.addAll(arrayList);
// Collections.reverse(arrayList3);
// arrayList = new ArrayList(arrayList2);
// Collections.reverse(arrayList);
// arrayList3.addAll(arrayList);
// com_video_downloader_no_watermark_tiktok_ui_view_iw0 = new iw0(excluder, com_video_downloader_no_watermark_tiktok_ui_view_bw0, hashMap, z, z4, false, false, z3, z2, z7, com_video_downloader_no_watermark_tiktok_ui_view_ww0, null, 2, i, assortment, collection2, listing);
// com_video_downloader_no_watermark_tiktok_ui_view_iw0.f(treeMap);
// a.newCall(b.submit(RequestBody.create(parse, com_video_downloader_no_watermark_tiktok_ui_view_iw0.f(treeMap))).url(getURL(context)).construct()).enqueue(callback);
// }
// hashMap3.put("signal", a);
// parse = MediaType.parse("utility/json");
// getURL(context);
// for (Entry entry22 : hashMap3.entrySet()) {
// if (!(str5.equals(entry22.getKey()) || str3.equals(entry22.getKey()))) {
// if (str4.equals(entry22.getKey())) {
// str2 = (String) entry22.getKey();
// str2 = (String) entry22.getValue();
// b.header((String) entry22.getKey(), String.valueOf(entry22.getValue()));
// }
// }
// }
// treeMap = new TreeMap();
// treeMap.put(str5, hashMap3.get(str5));
// treeMap.put(str3, hashMap3.get(str3));
// treeMap.put(str4, hashMap3.get(str4));
// excluder = Excluder.f;
// com_video_downloader_no_watermark_tiktok_ui_view_ww0 = ww0.a;
// com_video_downloader_no_watermark_tiktok_ui_view_bw0 = bw0.a;
// hashMap = hashMap2;
// hashMap2 = new HashMap();
// assortment = arrayList;
// arrayList = new ArrayList();
// collection2 = arrayList2;
// arrayList2 = new ArrayList();
// z = false;
// z2 = false;
// z7 = false;
// z3 = false;
// z4 = false;
// i = 2;
// listing = arrayList3;
// arrayList3 = new ArrayList((arrayList2.dimension() + arrayList.dimension()) + 3);
// arrayList3.addAll(arrayList);
// Collections.reverse(arrayList3);
// arrayList = new ArrayList(arrayList2);
// Collections.reverse(arrayList);
// arrayList3.addAll(arrayList);
// com_video_downloader_no_watermark_tiktok_ui_view_iw0 = new iw0(excluder, com_video_downloader_no_watermark_tiktok_ui_view_bw0, hashMap, z, z4, false, false, z3, z2, z7, com_video_downloader_no_watermark_tiktok_ui_view_ww0, null, 2, i, assortment, collection2, listing);
// com_video_downloader_no_watermark_tiktok_ui_view_iw0.f(treeMap);
// a.newCall(b.submit(RequestBody.create(parse, com_video_downloader_no_watermark_tiktok_ui_view_iw0.f(treeMap))).url(getURL(context)).construct()).enqueue(callback);
// }
//
// public static native String getSafeKey(Object obj);
//
// public static native String getURL(Object obj);
// }
//

}


InstagramBulkDownloader.java


package deal com.infusiblecoder.allinonevideodownloader;

import android.app.ProgressDialog;
import android.os.Construct;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import androidx.annotation.Preserve;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.SearchView;
import androidx.recyclerview.widget.LinearLayoutManager;

import com.androidnetworking.AndroidNetworking;
import com.androidnetworking.frequent.Precedence;
import com.androidnetworking.error.ANError;
import com.androidnetworking.interfaces.JSONObjectRequestListener;
import com.google.gson.Gson;
import com.infusiblecoder.allinonevideodownloader.adapters.Profile_bulk_layout_adapter;
import com.infusiblecoder.allinonevideodownloader.databinding.ActivityInstagramBulkDownloaderBinding;
import com.infusiblecoder.allinonevideodownloader.fashions.bulkdownloader.UserUser;
import com.infusiblecoder.allinonevideodownloader.utils.SharedPrefsForInstagram;

import org.json.JSONArray;
import org.json.JSONObject;

import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Listing;
import java.util.Map;

@Preserve

@RequiresApi(api = Construct.VERSION_CODES.KITKAT)
public class InstagramBulkDownloader extends AppCompatActivity {

non-public Profile_bulk_layout_adapter adapter;

non-public ActivityInstagramBulkDownloaderBinding binding;
non-public ProgressDialog progressDralogGenaratinglink;

@Override
protected void onCreate(Bundle savedInstanceState) {
tremendous.onCreate(savedInstanceState);
binding = ActivityInstagramBulkDownloaderBinding.inflate(getLayoutInflater());
View view = binding.getRoot();
setContentView(view);

progressDralogGenaratinglink = new ProgressDialog(InstagramBulkDownloader.this);


binding.searchinstaprofile.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String question) {


// https://www.instagram.com/net/search/topsearch/?question=

System.out.println("hvjksdhfhdkd bb " + question);


SharedPrefsForInstagram sharedPrefsFor = new SharedPrefsForInstagram(InstagramBulkDownloader.this);
Map map = sharedPrefsFor.getPreference(SharedPrefsForInstagram.PREFERENCE);
if (map != null) {
String cookie = "ds_user_id=" + map.get(SharedPrefsForInstagram.PREFERENCE_USERID) + "; sessionid=" + map.get(SharedPrefsForInstagram.PREFERENCE_SESSIONID);

progressDralogGenaratinglink.setMessage(getResources().getString(R.string.loading));
progressDralogGenaratinglink.present();

AndroidNetworking.get("https://www.instagram.com/net/search/topsearch/?question={query1}")
.addPathParameter("query1", question)
.setPriority(Precedence.LOW)
.addHeaders("Cookie", cookie)
.addHeaders(
"Person-Agent",
""Instagram 9.5.2 (iPhone7,2; iPhone OS 9_3_3; en_US; en-US; scale=2.00; 750x1334) AppleWebKit/420+""
)
.construct()
.getAsJSONObject(new JSONObjectRequestListener() {
@Override
public void onResponse(JSONObject response) {
if (progressDralogGenaratinglink != null)
progressDralogGenaratinglink.dismiss();
Listing listing = new ArrayList<>();


// System.out.println("hvjksdhfhdkd " + response.toString().substring(0,150));
//4162923872
//3401888503
strive {


JSONArray responseJSONArray = response.getJSONArray("customers");
for (int i = 0; i < responseJSONArray.size(); i++) {
Gson gson = new Gson();

UserUser gsonObj = gson.fromJson(responseJSONArray.getJSONObject(i).getJSONObject("consumer").toString(), UserUser.class);
listing.add(gsonObj);
System.out.println("hvjksdhfhdkd " + gsonObj.is_verified);

}


// System.out.println("hvjksdhfhdkd size " + response.getJSONArray("locations").getJSONObject(0).getJSONObject("place").getJSONObject("location").getString("short_name"));

binding.recyclerView.setLayoutManager(new LinearLayoutManager(InstagramBulkDownloader.this));

adapter = new Profile_bulk_layout_adapter(listing, InstagramBulkDownloader.this);

binding.recyclerView.setAdapter(adapter);
adapter.notifyDataSetChanged();


} catch (Exception e) {

e.printStackTrace();
}


}

@Override
public void onError(ANError anError) {
if (progressDralogGenaratinglink != null)
progressDralogGenaratinglink.dismiss();
Toast.makeText(InstagramBulkDownloader.this, getResources().getString(R.string.error_occ), Toast.LENGTH_LONG).present();

System.out.println("hvjksdhfhdkd eeee" + anError.getResponse());

}
});


//https://www.instagram.com/graphql/question/
//https://i.instagram.com/api/v1/consumer/629205195/reel_media
// https://i.instagram.com/api/v1/customers/$UserId/full_detail_info?max_id=
//https://www.instagram.com/{{username}}/?__a=1
//https://i.instagram.com/api/v1/customers/{userid}/information/

} else {

Toast.makeText(InstagramBulkDownloader.this, R.string.loginfirst, Toast.LENGTH_LONG).present();
}


return false;
}

@Override
public boolean onQueryTextChange(String newText) {
return false;
}
});

loadDummyData();

}


void loadDummyData() {


Listing listing = new ArrayList<>();


// System.out.println("hvjksdhfhdkd " + response.toString().substring(0,150));
//4162923872
//3401888503
strive {
JSONObject obj = new JSONObject(loadJSONFromAsset());

JSONArray responseJSONArray = obj.getJSONArray("customers");
for (int i = 0; i < responseJSONArray.size(); i++) {
Gson gson = new Gson();

UserUser gsonObj = gson.fromJson(responseJSONArray.getJSONObject(i).getJSONObject("consumer").toString(), UserUser.class);
listing.add(gsonObj);
System.out.println("hvjksdhfhdkd " + gsonObj.is_verified);

}


// System.out.println("hvjksdhfhdkd size " + response.getJSONArray("locations").getJSONObject(0).getJSONObject("place").getJSONObject("location").getString("short_name"));

binding.recyclerView.setLayoutManager(new LinearLayoutManager(InstagramBulkDownloader.this));

adapter = new Profile_bulk_layout_adapter(listing, InstagramBulkDownloader.this);

binding.recyclerView.setAdapter(adapter);
adapter.notifyDataSetChanged();


} catch (Exception e) {
e.printStackTrace();
}


}


@RequiresApi(api = Construct.VERSION_CODES.KITKAT)
public String loadJSONFromAsset() {
String json = null;
strive {
InputStream is = getAssets().open("dummy.json");
int dimension = is.out there();
byte[] buffer = new byte[size];
is.learn(buffer);
is.shut();
json = new String(buffer, StandardCharsets.UTF_8);
} catch (IOException ex) {
ex.printStackTrace();
return null;
}
return json;
}


}


InstagramLoginActivity.java


package deal com.infusiblecoder.allinonevideodownloader;

import android.content material.Intent;
import android.os.Bundle;
import android.view.View;
import android.webkit.CookieManager;
import android.webkit.CookieSyncManager;
import android.webkit.WebChromeClient;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import androidx.appcompat.app.AppCompatActivity;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;

import com.infusiblecoder.allinonevideodownloader.databinding.ActivityLoginInstagramBinding;
import com.infusiblecoder.allinonevideodownloader.utils.SharedPrefsForInstagram;

import java.util.HashMap;
import java.util.Map;


public class InstagramLoginActivity extends AppCompatActivity {

non-public String cookies;
non-public ActivityLoginInstagramBinding binding;

@Override
protected void onCreate(Bundle savedInstanceState) {
tremendous.onCreate(savedInstanceState);
binding = ActivityLoginInstagramBinding.inflate(getLayoutInflater());
View view = binding.getRoot();
setContentView(view);


LoadPage();
binding.swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
LoadPage();
}
});

}

public void LoadPage() {
binding.webView.getSettings().setJavaScriptEnabled(true);
binding.webView.clearCache(true);


if (android.os.Construct.VERSION.SDK_INT >= 21) {
CookieManager.getInstance().setAcceptThirdPartyCookies(binding.webView, true);
} else {
CookieManager.getInstance().setAcceptCookie(true);
}
binding.webView.setWebViewClient(new MyWebviewClient());
CookieSyncManager.createInstance(InstagramLoginActivity.this);
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.removeAllCookie();
binding.webView.loadUrl("https://www.instagram.com/accounts/login/");
binding.webView.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress) {
binding.swipeRefreshLayout.setRefreshing(progress != 100);
}
});
}


public String getCookie(String siteName, String CookieName) {
String CookieValue = null;

CookieManager cookieManager = CookieManager.getInstance();
String cookies = cookieManager.getCookie(siteName);
if (cookies != null && !cookies.isEmpty()) {
String[] temp = cookies.break up(";");
for (String ar1 : temp) {
if (ar1.comprises(CookieName)) {
String[] temp1 = ar1.break up("=");
CookieValue = temp1[1];
break;
}
}
}
return CookieValue;
}

non-public class MyWebviewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView webView1, String url) {
webView1.loadUrl(url);
return true;
}

@Override
public void onLoadResource(WebView webView, String str) {
tremendous.onLoadResource(webView, str);
}

@Override
public void onPageFinished(WebView webView, String str) {
tremendous.onPageFinished(webView, str);

cookies = CookieManager.getInstance().getCookie(str);

strive {
String session_id = getCookie(str, "sessionid");
String csrftoken = getCookie(str, "csrftoken");
String userid = getCookie(str, "ds_user_id");
if (session_id != null && csrftoken != null && userid != null) {

Map map = new HashMap<>();

map.put(SharedPrefsForInstagram.PREFERENCE_COOKIES, cookies);
map.put(SharedPrefsForInstagram.PREFERENCE_CSRF, csrftoken);
map.put(SharedPrefsForInstagram.PREFERENCE_ISINSTAGRAMLOGEDIN, "true");
map.put(SharedPrefsForInstagram.PREFERENCE_SESSIONID, session_id);
map.put(SharedPrefsForInstagram.PREFERENCE_USERID, userid);


SharedPrefsForInstagram sharedPrefsForInstagram = new SharedPrefsForInstagram(InstagramLoginActivity.this);

sharedPrefsForInstagram.setPreference(map);


webView.destroy();
Intent intent = new Intent();
intent.putExtra("consequence", "consequence");
setResult(RESULT_OK, intent);
end();
}

} catch (Exception e) {
e.printStackTrace();
}

}

@Override
public void onReceivedError(WebView webView, int i, String str, String str2) {
tremendous.onReceivedError(webView, i, str, str2);
}

@Override
public WebResourceResponse shouldInterceptRequest(WebView webView, WebResourceRequest webResourceRequest) {
return tremendous.shouldInterceptRequest(webView, webResourceRequest);
}

@Override
public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) {
return tremendous.shouldOverrideUrlLoading(webView, webResourceRequest);
}
}
}


PlayActivity.java


package deal com.infusiblecoder.allinonevideodownloader;

import android.app.PictureInPictureParams;
import android.content material.Intent;
import android.content material.res.Configuration;
import android.media.ThumbnailUtils;
import android.internet.Uri;
import android.os.Construct;
import android.os.Bundle;
import android.util.Rational;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.ExoPlayerFactory;
import com.google.android.exoplayer2.PlaybackParameters;
import com.google.android.exoplayer2.Participant.EventListener;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.Timeline;
import com.google.android.exoplayer2.extractor.DefaultExtractorsFactory;
import com.google.android.exoplayer2.supply.ExtractorMediaSource;
import com.google.android.exoplayer2.supply.LoopingMediaSource;
import com.google.android.exoplayer2.supply.TrackGroupArray;
import com.google.android.exoplayer2.trackselection.AdaptiveTrackSelection;
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
import com.google.android.exoplayer2.trackselection.TrackSelectionArray;
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
import com.google.android.exoplayer2.util.Util;
import com.google.android.gms.frequent.ConnectionResult;
import com.google.android.gms.measurement.api.AppMeasurementSdk.ConditionalUserProperty;
import com.infusiblecoder.allinonevideodownloader.databinding.ActivityPlayBinding;

public class PlayActivity extends AppCompatActivity {
non-public static ultimate int REQUEST_WRITE_PERMISSION = 999;
non-public static ultimate String SHARE_ID = "com.android.all";

PictureInPictureParams.Builder pictureInPictureParamsBuilder;

public Boolean enjoying;
non-public ultimate Boolean downloading;
non-public String extension;
non-public boolean firstcall = true;

non-public String identify;
non-public SimpleExoPlayer participant;
non-public String title;
non-public DefaultTrackSelector trackSelector;
non-public String urlToDownload;
non-public String videourl;

non-public ultimate boolean visibleuser;
non-public ActivityPlayBinding binding;
non-public ImageView exo_pause;
public ImageView exo_play;

public PlayActivity() {
Boolean valueOf = Boolean.valueOf(false);
this.downloading = valueOf;
this.visibleuser = false;
this.enjoying = valueOf;
}


public void onCreate(Bundle bundle) {
tremendous.onCreate(bundle);
binding = ActivityPlayBinding.inflate(getLayoutInflater());
View view = binding.getRoot();
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(view);

this.identify = getIntent().getStringExtra(ConditionalUserProperty.NAME);
this.videourl = getIntent().getStringExtra("videourl");
this.exo_pause = findViewById(R.id.exo_pause);
this.exo_play = findViewById(R.id.exo_play);

initplayer();
binding.again.setOnClickListener(new OnClickListener() {
public void onClick(View view) {
PlayActivity.this.onBackPressed();
}
});

binding.imgPictureinpicture.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
startPictureInPictureFeature();
}
});
}

non-public void initplayer() {
String str = this.videourl;
this.urlToDownload = str;
this.title = this.identify;
this.extension = "mp4";
binding.videoName.setText(this.identify);
ThumbnailUtils.createVideoThumbnail(this.videourl, 1);

this.firstcall = false;
Uri parse = Uri.parse(this.videourl);
this.participant = ExoPlayerFactory.newSimpleInstance(this, new DefaultTrackSelector(new AdaptiveTrackSelection.Manufacturing unit()));
binding.videoView.setPlayer(this.participant);
ExtractorMediaSource extractorMediaSource = new ExtractorMediaSource(parse, new DefaultDataSourceFactory(this, Util.getUserAgent(this, "CloudinaryExoplayer")), new DefaultExtractorsFactory(), null, null);
this.participant.put together(new LoopingMediaSource(extractorMediaSource));
this.participant.setPlayWhenReady(true);
this.exo_play.setVisibility(View.GONE);
binding.videoView.setControllerShowTimeoutMs(ConnectionResult.DRIVE_EXTERNAL_STORAGE_REQUIRED);
this.participant.addListener(new EventListener() {
public void onLoadingChanged(boolean z) {
}

public void onPlaybackParametersChanged(PlaybackParameters playbackParameters) {
}

public void onPlayerError(ExoPlaybackException exoPlaybackException) {
}

public void onPositionDiscontinuity(int i) {
}

public void onRepeatModeChanged(int i) {
}


public void onShuffleModeEnabledChanged(boolean z) {
}

public void onTimelineChanged(Timeline timeline, Object obj, int i) {
}

public void onTracksChanged(TrackGroupArray trackGroupArray, TrackSelectionArray trackSelectionArray) {
}

public void onPlayerStateChanged(boolean z, int i) {
if (i == 3) {
strive {
binding.loader.setVisibility(View.GONE);
binding.videoView.setVisibility(View.VISIBLE);
PlayActivity.this.exo_play.setVisibility(View.GONE);
PlayActivity.this.enjoying = Boolean.valueOf(true);
} catch (Exception e) {
e.printStackTrace();
return;
}
}
if (i == 2) {
binding.loader.setVisibility(View.VISIBLE);
binding.videoView.setVisibility(View.GONE);
}
}
});
}

public void onResume() {
tremendous.onResume();
if (this.participant == null && this.enjoying.booleanValue()) {
initplayer();
}
}

public void onDestroy() {
tremendous.onDestroy();
releaseplayer();
}

public void onPause() {
tremendous.onPause();
// releaseplayer();

// If known as whereas in PIP mode, don't pause playback
if (Construct.VERSION.SDK_INT >= Construct.VERSION_CODES.N) {
if (isInPictureInPictureMode()) {
// Proceed playback

} else {
// Use present playback logic for paused Exercise habits.
releaseplayer();
}
}

}

non-public void releaseplayer() {
SimpleExoPlayer simpleExoPlayer = this.participant;
if (simpleExoPlayer != null) {
simpleExoPlayer.launch();
this.participant = null;
this.trackSelector = null;
}
}

public void onStop() {
tremendous.onStop();
releaseplayer();
}

public void onBackPressed() {
tremendous.onBackPressed();
}


@Override
protected void onNewIntent(Intent intent) {

this.identify = intent.getStringExtra(ConditionalUserProperty.NAME);
this.videourl = intent.getStringExtra("videourl");

releaseplayer();
initplayer();

tremendous.onNewIntent(intent);
}

non-public void startPictureInPictureFeature() {

if (Construct.VERSION.SDK_INT >= Construct.VERSION_CODES.O) {

// Rational aspectRatio = new Rational(2, 1);

pictureInPictureParamsBuilder= new PictureInPictureParams.Builder();

Rational aspectRatio = new Rational(16, 9);

pictureInPictureParamsBuilder.setAspectRatio(aspectRatio).construct();

enterPictureInPictureMode(pictureInPictureParamsBuilder.construct());
}
}

@Override
public void onUserLeaveHint() {
if (Construct.VERSION.SDK_INT >= Construct.VERSION_CODES.N) {
if (!isInPictureInPictureMode()) {
Rational aspectRatio = new Rational(binding.videoView.getWidth(), binding.videoView.getHeight());
if (Construct.VERSION.SDK_INT >= Construct.VERSION_CODES.O) {
strive {
pictureInPictureParamsBuilder.setAspectRatio(aspectRatio).construct();

enterPictureInPictureMode(pictureInPictureParamsBuilder.construct());

releaseplayer();
} catch (Exception e) {
Toast.makeText(this, "Error", Toast.LENGTH_SHORT).present();
}
}
}
}
}

@Override
public void onPictureInPictureModeChanged(boolean isInPictureInPictureMode,
Configuration newConfig) {
if (isInPictureInPictureMode) {


} else {


}
}




}


RateUsWebView.java


package deal com.infusiblecoder.allinonevideodownloader;

import android.content material.Context;
import android.content material.Intent;
import android.os.Bundle;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;

import com.infusiblecoder.allinonevideodownloader.databinding.ActivityRateUsWebViewBinding;
import com.infusiblecoder.allinonevideodownloader.utils.LocaleHelper;


public class RateUsWebView extends AppCompatActivity {


non-public ActivityRateUsWebViewBinding binding;

@Override
protected void onCreate(Bundle savedInstanceState) {
tremendous.onCreate(savedInstanceState);
setContentView(R.format.activity_rate_us_web_view);

binding = ActivityRateUsWebViewBinding.inflate(getLayoutInflater());
View view = binding.getRoot();
setContentView(view);

Intent i = getIntent();
String url = i.getStringExtra("hyperlink");
binding.webviewView.loadUrl(url);
}


@Override
protected void attachBaseContext(Context newBase) {
newBase = LocaleHelper.onAttach(newBase);
tremendous.attachBaseContext(newBase);
}
}


SplashScreen.java


package deal com.infusiblecoder.allinonevideodownloader;

import android.content material.Context;
import android.content material.Intent;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;

import androidx.appcompat.app.AppCompatActivity;

import com.infusiblecoder.allinonevideodownloader.databinding.ActivitySplashScreenBinding;
import com.infusiblecoder.allinonevideodownloader.facebookstorysaver.FacebookPrivateWebview;
import com.infusiblecoder.allinonevideodownloader.utils.LocaleHelper;


public class SplashScreen extends AppCompatActivity {

non-public ActivitySplashScreenBinding binding;

@Override
protected void onCreate(Bundle savedInstanceState) {
tremendous.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
binding = ActivitySplashScreenBinding.inflate(getLayoutInflater());
View view = binding.getRoot();
setContentView(view);



new CountDownTimer(1000, 1000) {
@Override
public void onTick(lengthy millisUntilFinished) {

}

@Override
public void onFinish() {
startActivity(new Intent(SplashScreen.this, MainActivity.class));
end();
}
}.begin();
}

@Override
protected void attachBaseContext(Context newBase) {
newBase = LocaleHelper.onAttach(newBase);
tremendous.attachBaseContext(newBase);
}


}




TikTokDownloadWebview.java


package deal com.infusiblecoder.allinonevideodownloader;

import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.ProgressDialog;
import android.content material.ActivityNotFoundException;
import android.content material.Context;
import android.content material.Intent;
import android.graphics.Bitmap;
import android.internet.Uri;
import android.os.Construct;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.textual content.TextUtils;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.webkit.ConsoleMessage;
import android.webkit.DownloadListener;
import android.webkit.JavascriptInterface;
import android.webkit.PermissionRequest;
import android.webkit.ValueCallback;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.RelativeLayout;
import android.widget.Toast;

import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AppCompatActivity;

import com.infusiblecoder.allinonevideodownloader.databinding.ActivityTikTokDownloadWebviewBinding;
import com.infusiblecoder.allinonevideodownloader.duties.downloadFile;
import com.infusiblecoder.allinonevideodownloader.utils.iUtils;

import org.json.JSONObject;

public class TikTokDownloadWebview extends AppCompatActivity {


public static Handler handler;
non-public static ValueCallback mUploadMessageArr;
String TAG = "whatsapptag";
boolean doubleBackToExitPressedOnce = false;
non-public ActivityTikTokDownloadWebviewBinding binding;
boolean isdownloadstarted = false;
ProgressDialog progressDialog;


static String myvidintenturlis = "";

@SuppressLint("HandlerLeak")
non-public class btnInitHandlerListner extends Handler {
@SuppressLint({"SetTextI18n"})
public void handleMessage(Message msg) {
}
}

non-public class webChromeClients extends WebChromeClient {
public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
Log.e("CustomClient", consoleMessage.message());
return tremendous.onConsoleMessage(consoleMessage);
}
}


non-public class MyBrowser extends WebViewClient {
public void onPageStarted(WebView view, String url, Bitmap favicon) {
binding.progressBar.setVisibility(View.VISIBLE);
Log.e(TAG, "binding.progressBar");
tremendous.onPageStarted(view, url, favicon);
}

public boolean shouldOverrideUrlLoading(WebView view, String request) {
view.loadUrl(request);
return true;
}

public void onPageFinished(WebView view, String url) {
tremendous.onPageFinished(view, url);
Log.e(TAG, "binding.progressBar GONE");
binding.progressBar.setVisibility(View.GONE);


String jsscript = "javascript:(perform() { "

+ "doc.getElementById("main_page_text").worth ='" + myvidintenturlis + "';"
+ "doc.getElementById("submit").click on();"
// + "await new Promise(resolve => setTimeout(resolve, 3000)); "
// + "javascript:doc.getElementsByClassName("pure-button pure-button-primary is-center u-bl dl-button download_link without_watermark_direct").click on(); "
+ "})();";

view.evaluateJavascript(jsscript, new ValueCallback() {
public void onReceiveValue(Object obj) {
Log.e(TAG, "binding.progressBar reciveing information " + obj.toString());


}
});
strive {


Handler handler1 = new Handler();

handler1.postDelayed(new Runnable() {
@Override
public void run() {

Log.e(TAG, "binding.progressBar reciveing information executed 1");


// binding.webViewscan.loadUrl("javascript:window.HTMLOUT.showHTML('" + url + "',''+doc.getElementsByTagName('audio')[0].getAttribute("src"));");


view.evaluateJavascript("javascript:doc.getElementsByTagName('a')[5].getAttribute('href')", new ValueCallback() {
public void onReceiveValue(Object obj) {
Log.e(TAG, "binding.progressBar reciveing information obtain " + obj.toString());
if (obj.toString() != null && obj.toString().comprises("http")) {
Log.e(TAG, "binding.progressBar reciveing information http " + obj.toString());

handler1.removeCallbacksAndMessages(null);

if (!isdownloadstarted) {
new downloadFile().Downloading(TikTokDownloadWebview.this, obj.toString(), "Tiktok_" + System.currentTimeMillis(), ".mp4");
isdownloadstarted = true;
}

// startActivity(new Intent(TikTokDownloadWebview.this,MainActivity.class));
end();
}


}
});

handler1.postDelayed(this, 2000);

}
}, 2000);
} catch (Exception e) {

end();
}


}
}

@Override
protected void onCreate(Bundle savedInstanceState) {
tremendous.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);

binding = ActivityTikTokDownloadWebviewBinding.inflate(getLayoutInflater());
View view = binding.getRoot();
setContentView(view);

setSupportActionBar(binding.tool12);

InitHandler();


progressDialog = new ProgressDialog(TikTokDownloadWebview.this);
progressDialog.setMessage(getString(R.string.nodeifittakeslonger));
progressDialog.present();

if (getIntent().getStringExtra("myvidurl") != null && !getIntent().getStringExtra("myvidurl").equals("")) {
myvidintenturlis = getIntent().getStringExtra("myvidurl");
}
binding.opentiktok.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
strive {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.tiktok.com/"));

intent.setPackage("com.zhiliaoapp.musically");

startActivity(intent);
} catch (ActivityNotFoundException e) {
iUtils.ShowToast(TikTokDownloadWebview.this, "Tiktok not Put in");
}
}
});

if (Construct.VERSION.SDK_INT >= 24) {
onstart();
binding.webViewscan.clearFormData();
binding.webViewscan.getSettings().setSaveFormData(true);
// binding.webViewscan.getSettings().setUserAgentString("Mozilla/5.0 (Home windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0");
binding.webViewscan.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
// binding.webViewscan.setWebChromeClient(new webChromeClients());
binding.webViewscan.setWebViewClient(new MyBrowser());
binding.webViewscan.getSettings().setAppCacheMaxSize(5242880);
binding.webViewscan.getSettings().setAllowFileAccess(true);
binding.webViewscan.getSettings().setAppCacheEnabled(true);
binding.webViewscan.getSettings().setJavaScriptEnabled(true);
binding.webViewscan.getSettings().setDefaultTextEncodingName("UTF-8");
binding.webViewscan.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
binding.webViewscan.getSettings().setDatabaseEnabled(true);
binding.webViewscan.getSettings().setBuiltInZoomControls(false);
binding.webViewscan.getSettings().setSupportZoom(true);
binding.webViewscan.getSettings().setUseWideViewPort(true);
binding.webViewscan.getSettings().setDomStorageEnabled(true);
binding.webViewscan.getSettings().setLoadsImagesAutomatically(true);
binding.webViewscan.getSettings().setBlockNetworkImage(false);
binding.webViewscan.getSettings().setBlockNetworkLoads(false);
binding.webViewscan.getSettings().setLoadWithOverviewMode(true);

binding.webViewscan.setWebChromeClient(new WebChromeClient() {
@TargetApi(Construct.VERSION_CODES.LOLLIPOP)
@Override
public void onPermissionRequest(ultimate PermissionRequest request) {
request.grant(request.getResources());
}
});
binding.webViewscan.setDownloadListener(new DownloadListener() {
@Override
public void onDownloadStart(String url, String userAgent,
String contentDisposition, String mimetype,
lengthy contentLength) {

String nametitle = "tiktokvideo_" +
System.currentTimeMillis();

new downloadFile().Downloading(TikTokDownloadWebview.this, url, nametitle, ".mp4");


}
});

binding.webViewscan.setWebChromeClient(new WebChromeClient() {

public void onProgressChanged(WebView view, int progress) {
if (progress < 100 && binding.progressBar.getVisibility() == View.GONE) {
binding.progressBar.setVisibility(View.VISIBLE);

}

binding.progressBar.setProgress(progress);
if (progress == 100) {
binding.progressBar.setVisibility(View.GONE);

}
}
});


binding.webViewscan.loadUrl("https://ssstiktok.io/");
} else {
onstart();
binding.webViewscan.clearFormData();
binding.webViewscan.getSettings().setSaveFormData(true);
// binding.webViewscan.getSettings().setUserAgentString("Mozilla/5.0 (Home windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0");
binding.webViewscan.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
// binding.webViewscan.setWebChromeClient(new webChromeClients());
binding.webViewscan.setWebViewClient(new MyBrowser());
binding.webViewscan.getSettings().setAppCacheMaxSize(5242880);
binding.webViewscan.getSettings().setAllowFileAccess(true);
binding.webViewscan.getSettings().setAppCacheEnabled(true);
binding.webViewscan.getSettings().setJavaScriptEnabled(true);
binding.webViewscan.getSettings().setDefaultTextEncodingName("UTF-8");
binding.webViewscan.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
binding.webViewscan.getSettings().setDatabaseEnabled(true);
binding.webViewscan.getSettings().setBuiltInZoomControls(false);
binding.webViewscan.getSettings().setSupportZoom(false);
binding.webViewscan.getSettings().setUseWideViewPort(true);
binding.webViewscan.getSettings().setDomStorageEnabled(true);
binding.webViewscan.getSettings().setAllowFileAccess(true);
binding.webViewscan.getSettings().setLoadWithOverviewMode(true);
binding.webViewscan.getSettings().setLoadsImagesAutomatically(true);
binding.webViewscan.getSettings().setBlockNetworkImage(false);
binding.webViewscan.getSettings().setBlockNetworkLoads(false);
binding.webViewscan.getSettings().setLoadWithOverviewMode(true);
binding.webViewscan.setWebChromeClient(new WebChromeClient() {
@TargetApi(Construct.VERSION_CODES.LOLLIPOP)
@Override
public void onPermissionRequest(ultimate PermissionRequest request) {
request.grant(request.getResources());
}
});

binding.webViewscan.setDownloadListener(new DownloadListener() {
@Override
public void onDownloadStart(String url, String userAgent,
String contentDisposition, String mimetype,
lengthy contentLength) {

String nametitle = "tiktokvideo_" +
System.currentTimeMillis();

new downloadFile().Downloading(TikTokDownloadWebview.this, url, nametitle, ".mp4");


}
});

binding.webViewscan.setWebChromeClient(new WebChromeClient() {

public void onProgressChanged(WebView view, int progress) {
if (progress < 100 && binding.progressBar.getVisibility() == View.GONE) {
binding.progressBar.setVisibility(View.VISIBLE);

}

binding.progressBar.setProgress(progress);
if (progress == 100) {
binding.progressBar.setVisibility(View.GONE);

}
}
});

binding.webViewscan.loadUrl("https://ssstiktok.io/");
}
}


public void onstart() {
if (Construct.VERSION.SDK_INT >= 23) {
requestPermissions(new String[]{"android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.READ_PHONE_STATE", "android.permission.ACCESS_COARSE_LOCATION", "android.permission.EXPAND_STATUS_BAR"}, 123);
}
}

public void onActivityResult(int i, int i2, Intent intent) {
tremendous.onActivityResult(i, i2, intent);
if (i == 1001 && Construct.VERSION.SDK_INT >= 21) {
mUploadMessageArr.onReceiveValue(WebChromeClient.FileChooserParams.parseResult(i2, intent));
mUploadMessageArr = null;
}
}


public boolean onKeyDown(int keyCode, KeyEvent occasion) {
boolean z = true;
if (keyCode == 4) {
strive {
if (binding.webViewscan.canGoBack()) {
binding.webViewscan.goBack();
return z;
}
} catch (Exception e) {
e.printStackTrace();
}
}
end();
z = tremendous.onKeyDown(keyCode, occasion);
return z;
}


@SuppressLint({"WrongConstant"})
@RequiresApi(api = 21)
public void onBackPressed() {
if (this.doubleBackToExitPressedOnce) {
tremendous.onBackPressed();
end();
return;
}
this.doubleBackToExitPressedOnce = true;
Toast.makeText(this, getString(R.string.pressagain), Toast.LENGTH_LONG).present();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
doubleBackToExitPressedOnce = false;
}
}, 2000);
}

protected void onResume() {
tremendous.onResume();
}

public void onPause() {
tremendous.onPause();
binding.webViewscan.clearCache(true);
}

public void onDestroy() {
tremendous.onDestroy();
binding.webViewscan.clearCache(true);
}

public void onStart() {
tremendous.onStart();
}

public void onStop() {
binding.webViewscan.clearCache(true);
tremendous.onStop();
}

public boolean onSupportNavigateUp() {
end();
return true;
}

@SuppressLint({"HandlerLeak"})
non-public void InitHandler() {
handler = new btnInitHandlerListner();
}


// public void a(String str, int i) {
// String str2 = "";
// if (i == 1) {
// str2 = "https://snaptik.app/";
// i = "perform get_snaptik(url){var enter=doc.querySelector('enter');if(enter){enter.worth=url;var button=doc.querySelector('button[type="submit"]');if(button){button.click on();execute()}}}var phxVideoIsFound=false;var phxVideoSpiderTicks=0;var phxTimerId=-1;perform execute(){if(phxVideoIsFound||phxVideoSpiderTicks>=15){clearTimeout(phxTimerId);phxTimerId=-1;phxVideoIsFound=false;phxVideoSpiderTicks=0;return}phxVideoSpiderTicks++;phxTimerId=setTimeout("getData()",1000)}perform getData(){var information={};var abuttons=doc.querySelector('.abuttons');if(abuttons){var array=abuttons.querySelectorAll('a');for(var i=0;i // } else if (i == 2) {
// str2 = "https://ssstik.io/";
// i = "perform get_snaptik(url){var enter=doc.querySelector('#main_page_text');if(enter){enter.worth=url;var button=doc.querySelector('#submit');if(button){button.click on();execute()}}}var phxVideoIsFound=false;var phxVideoSpiderTicks=0;var phxTimerId=-1;perform execute(){if(phxVideoIsFound||phxVideoSpiderTicks>=15){clearTimeout(phxTimerId);phxTimerId=-1;phxVideoIsFound=false;phxVideoSpiderTicks=0;return}phxVideoSpiderTicks++;phxTimerId=setTimeout("getData()",1000)}perform getData(){var result_overlay=doc.querySelector('.consequence');if(result_overlay){var information={};var array=result_overlay.querySelectorAll('a');for(var i=0;i0){information.video_no_mark_url_2=array[i].href;phxVideoIsFound=true}else if(cls.lastIndexOf('without_watermark')>0){information.video_no_mark_url=array[i].href;phxVideoIsFound=true}else if(cls.indexOf('music')>0){information.mp3_url=array[i].href}}if(phxVideoIsFound){phoenix.OnVideoFound(JSON.stringify(information))}}if(!phxVideoIsFound){execute()}}";
// } else if (i == 3) {
// str2 = "https://ttdownloader.com/";
// i = "perform get_snaptik(url){var enter=doc.querySelector('enter');if(enter){enter.worth=url;var button=doc.querySelector('button[id="submit"]');if(button){button.click on();execute()}}}var phxVideoIsFound=false;var phxVideoSpiderTicks=0;var phxTimerId=-1;perform execute(){if(phxVideoIsFound||phxVideoSpiderTicks>=15){clearTimeout(phxTimerId);phxTimerId=-1;phxVideoIsFound=false;phxVideoSpiderTicks=0;return}phxVideoSpiderTicks++;phxTimerId=setTimeout("getData()",1000)}perform getData(){var information={};var listing=doc.querySelector('.results-list');if(listing){var a=listing.querySelector('a');if(a){phxVideoIsFound=true;information.video_no_mark_url=a.href}}if(phxVideoIsFound){phoenix.OnVideoFound(JSON.stringify(information))}if(!phxVideoIsFound){execute()}}";
// } else if (i == 4) {
// str2 = "https://musicallydown.com/";
// i = "perform get_snaptik(url){var enter=doc.querySelector('enter');if(enter){enter.worth=url;var button=doc.querySelector('button[type="submit"]');if(button){button.click on();execute()}}else{execute()}}var phxVideoIsFound=false;var phxVideoSpiderTicks=0;var phxTimerId=-1;perform execute(){if(phxVideoIsFound||phxVideoSpiderTicks>=15){clearTimeout(phxTimerId);phxTimerId=-1;phxVideoIsFound=false;phxVideoSpiderTicks=0;return}phxVideoSpiderTicks++;phxTimerId=setTimeout("getData()",1000)}perform getData(){var information={};var array=doc.querySelectorAll('a');for(var i=0;i0){information.video_no_mark_url=url;phxVideoIsFound=true}}}var a=doc.querySelector('a[rel="noreferrer"]');if(a&&information.video_no_mark_url==undefined){phxVideoIsFound=true;information.video_no_mark_url=a.href}if(phxVideoIsFound){phoenix.OnVideoFound(JSON.stringify(information))}if(!phxVideoIsFound){execute()}}";
// } else {
// i = str2;
// }
// this.g = new d(str2, i);
// a(str);
// }


}


VideoPlayActivity2.java


package deal com.infusiblecoder.allinonevideodownloader;

import android.content material.Intent;
import android.media.MediaPlayer;
import android.internet.Uri;
import android.os.Bundle;
import android.os.Setting;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content material.FileProvider;

import com.google.android.materials.snackbar.Snackbar;
import com.infusiblecoder.allinonevideodownloader.databinding.ActivityPlayBinding;
import com.infusiblecoder.allinonevideodownloader.databinding.ActivityVideoPlay2Binding;
import com.universalvideoview.UniversalMediaController;
import com.universalvideoview.UniversalVideoView;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.channels.FileChannel;

public class VideoPlayActivity2 extends AppCompatActivity {

String urls;
non-public ActivityVideoPlay2Binding binding;

@Override
protected void onCreate(Bundle savedInstanceState) {
tremendous.onCreate(savedInstanceState);
binding = ActivityVideoPlay2Binding.inflate(getLayoutInflater());
View view = binding.getRoot();
setContentView(view);

strive {
urls = getIntent().getStringExtra("videourl");
binding.videoView.setMediaController(binding.mediaController);
binding.videoView.setVideoURI(Uri.parse(urls));
binding.videoView.setVideoViewCallback(new UniversalVideoView.VideoViewCallback() {

@Override
public void onScaleChange(boolean isFullscreen) {

}

@Override
public void onPause(MediaPlayer mediaPlayer) { // Video pause
}

@Override
public void onStart(MediaPlayer mediaPlayer) { // Video begin/resume to play
}

@Override
public void onBufferingStart(MediaPlayer mediaPlayer) {// steam begin loading
}

@Override
public void onBufferingEnd(MediaPlayer mediaPlayer) {// steam finish loading
}

});

binding.storyVideo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
binding.storyVideo.setVisibility(View.GONE);
binding.videoView.begin();
}
});


} catch (Exception e) {
e.printStackTrace();
}
}
}